For example, How can I know whether there is an argument like args.manual_selection in args (args = parser.parse_args())
119584
Is there a way in Python to determine if an object has some attribute?  For example:  &gt;&gt;&gt; a = SomeClass() &gt;&gt;&gt; a.someProperty = value &gt;&gt;&gt; a.property Traceback (most recent call last):   File "&lt;stdin&gt;", line 1, in &lt;module&gt; AttributeError: SomeClass instance has no attribute 'property'   How can you tell if a has the attribute property before using it?
13018
I have the following function:  def my_func():     """My docstring is both funny and informative"""     pass   How do I get access to the docstring?
21256
I'd like to find a Windows batch counterpart to Bash's $@ that holds a list of all arguments passed into a script.   Or I have to bother with shift?
3196
Is there a command line program you can use?
117694
I know that unix has man pages, but is there a place I can look to discover command-line arguments of programs? Going to command prompt and typing notepad /? doesn't give anything.
110291
Example: I am looking to see if "arg" is a special keyword in Lua. I go to the Lua reference manual at . I search for "arg". I find hundreds of occurrences of the word "argument(s)" or "vararg".  Any ideas? I know Firefox won't implement whole words as a core feature (something about cluttering up the ui... argh...), and I couldn't find a good addon that implemented this well.
86322
This is the script  user@linux:~$ cat script.sh  #!/bin/bash for i in `seq $#` do   echo $i done user@linux:~$    Output  user@linux:~$ ./script.sh a b c 1 2 3 user@linux:~$    Desired Output  I would like to get argument value like this .... and not just the number  user@linux:~$ ./script.sh a b c 1 - a 2 - b 3 - c user@linux:~$
83024
I have two arrays:  arrayA=(1 2 3) arrayB=(a b c)   and I want to print out one of them using a command line argument, i.e., without any if else.  I tried a few variations on the syntax with no success. I am wanting to do something like this:  ARG="$1"  echo ${array${ARG}[@]}   but I get a "bad substitution" error. How can I achieve this?
89074
It seems that a common operation needed when defining new commands is to scan over a list of arguments (separated e.g. by a comma, but maybe by something else) and do something with each argument in the list, find the last one, or whatever.  For example to write commands that look like \Command{a,b,c} or \Command{c.d.e} and do something with each a, b, and c. See e.g. questions on  and .  Some solutions have been posted there, but what would be the best idiom to perform such kind of operations? LaTeX's \@for looks very nice, but is it possible to use it to scan anything other than comma-separated lists?
68174
I think I remember a command line utility that did this, but I can't remember what it's called and a few Google searches turn up nothing.
55413
The question is pretty straight forward. I can get the exit code of the previous command by using $?. But what exactly is it?  I don't think it is a variable, because you can't have any special characters in the name of variable other than _.  foo?foo=10   will result in the error: foo?foo=10: command not found  So if it is not a variable, what is it? Are there others like it?
107566
Are there any preprocessor symbols which allow something like  #if CLR_AT_LEAST_3.5 // use ReaderWriterLockSlim #else // use ReaderWriterLock #endif   or some other way to do this?
4875
In some of our projects, there's an class hierarchy that adds more parameters as it goes down the chain. At the bottom, some of the classes can have up to 30 parameters, 28 of which are just being passed into the super constructor.  I'll acknowledge that using automated DI through something like Guice would be nice, but because of some technical reasons, these specific projects are constrained to Java.   A convention of organizing the arguments alphabetically by type doesn't work because if a type is refactored (the Circle you were passing in for argument 2 is now a Shape) it can suddenly be out of order.  This question might be to specific and fraught with "If that's your problem, you're doing it wrong at a design level" criticisms, but I'm just looking for any viewpoints.
37164
Is there a way to get the name of the currently executing method in Java?
207
I have a java program which take path as argument. I want to check whether given path is existing or not before doing other validation. Eg: If i give a path D:\Log\Sample which is not not exist, it has to throw filenotfound exception. How can i do that?
104592
I am running some script which passing the string argument and I want to do if else statement shown as below:  if [ $1 != '' ] &amp;&amp; [ $2 != '' ] then      do something.....   but it shown Error too many argument. Why?
107255
On Linux (or any other OS that uses the man tool), there are typically several sections of the manual. Often, a given entry (such as echo or printf) exists in multiple sections, but not all of them. Is there a simple way to check which sections of the manual that entry can be found in?  Obviously, one can try man [section] [entry] and just run through every section in the manual, but honestly, I'm not even sure what the complete list of sections is (or how to find that definitively), and I'm looking for something a little less brute-force.