!C99Shell v. 1.0 pre-release build #13!

Software: Apache/2.0.54 (Unix) mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.54 OpenSSL/0.9.7l DAV/2 FrontPage/5.0.2.2635 PHP/4.4.0 mod_gzip/2.0.26.1a 

uname -a: Linux snow.he.net 4.4.276-v2-mono-1 #1 SMP Wed Jul 21 11:21:17 PDT 2021 i686 

uid=99(nobody) gid=98(nobody) groups=98(nobody) 

Safe-mode: OFF (not secure)

/opt/doc/python-2.3.4/html/Python-Docs-2.3.4/lib/   drwxr-xr-x
Free 318.34 GB of 458.09 GB (69.49%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     optparse-defining-callback-option.html (7.57 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
6.20.4.1 Defining a callback option


6.20.4.1 Defining a callback option

As always, you can define a callback option either by directly instantiating the Option class, or by using the add_option() method of your OptionParser object. The only option attribute you must specify is callback, the function to call:

parser.add_option("-c", callback=my_callback)

Note that you supply a function object here--so you must have already defined a function my_callback() when you define the callback option. In this simple case, optparse knows nothing about the arguments the -c option expects to take. Usually, this means that the option doesn't take any arguments - the mere presence of -c on the command-line is all it needs to know. In some circumstances, though, you might want your callback to consume an arbitrary number of command-line arguments. This is where writing callbacks gets tricky; it's covered later in this document.

There are several other option attributes that you can supply when you define an option attribute:

type
has its usual meaning: as with the ``store'' or ``append'' actions, it instructs optparse to consume one argument that must be convertible to type. Rather than storing the value(s) anywhere, though, optparse converts it to type and passes it to your callback function.

nargs
also has its usual meaning: if it is supplied and "nargs > 1", optparse will consume nargs arguments, each of which must be convertible to type. It then passes a tuple of converted values to your callback.

callback_args
a tuple of extra positional arguments to pass to the callback.

callback_kwargs
a dictionary of extra keyword arguments to pass to the callback.

See About this document... for information on suggesting changes.

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0249 ]--