kindall

Seattle, WA

engyrus.com

Age: 47

I'm a technical writer at Tecplot, Inc., makers of fine data visualization software for aerospace/CFD, oil and gas exploration, and general scientific/engineering uses. Python is my Swiss Army Knife of choice. I use it to help build and validate our documentation and help, among other things. I also have some proficiency with HTML, XML, AppleScript, C#, C, and if anyone ever has a question about 6502 assembly language, I'm your man. :-)

I occasionally do Python-related blogging at http://www.engyrus.com/.

10h
comment Passing arguments for functions while opening python file from terminal in Linux
If you want to use commas between the numbers as in the OP's question, you could use ast.literal_eval as the type argument; that will convert it to a tuple of integers. E.g. parser.add_argument('integers', type=ast.literal_eval). Or just ast.literal_eval(sys.arvg[1]) if there are no other args.
12h
revised My quicksort code is not working. What's wrong with it?
Removed > symbols that would keep people from easily copying the code to try it out
12h
answered getting not-full answer as the output of the function
14h
comment =+ Python operator is syntactically correct
+ before a value invokes the object's __pos__() method if it has one. Most types don't have such a method, so it's a no-op. Decimal is one type that does use it; stackoverflow.com/questions/16819023/…
14h
comment Find out the calling command from Python
The script always ends up executed by python no matter how it's invoked from the command line. You could make mpirun an alias that adds an extra command line or sets an environment variable or something of the sort, however, specifically for this detection.
14h
comment Find out the calling command from Python
Possible duplicate of How can my program detect, whether it was launch via mpirun
14h
comment Dynamically select which subclass to inherit methods from?
The factory functions work fine with issubclass and isinstance when properly implemented. Saying "there is no easy way to say 'is this object belonging to a class created in the class factory`" is simply false.
1d
comment Dynamically select which subclass to inherit methods from?
Adding a use_foo argument is trivial. Also, the isinstance example is in the answer: isinstance(obj1, makeclass(Foo))
1d
revised Dynamically select which subclass to inherit methods from?
pep8
1d
revised Dynamically select which subclass to inherit methods from?
added 165 characters in body
1d
comment Dynamically select which subclass to inherit methods from?
Both seem to work fine to me; added examples.
1d
revised Dynamically select which subclass to inherit methods from?
added 165 characters in body
1d
answered Dynamically select which subclass to inherit methods from?
1d
revised creating function(expected an indented block)
fix you're -> your
1d
comment What is the fastest way to flatten arbitrarily nested lists in Python?
@nolanconaway The routine as written skips anything that's not a list or a tuple, so what you're saying happens can never happen.
1d
comment How to copy file from a network using Python
There's no difference between accessing files on a network and accessing files on your local disk.
2d
comment Extra backslashes appear in raw strings
Looks fine to me.
2d
awarded Good Question
Feb
3
comment Recording the Python script execution method
Pass the method of invocation as an argument.
Feb
2
comment Python decorator module - kwargs
The wrapped function works perfectly well either way, so it doesn't matter.
1 2 3 4 5