Ich soll ein Script warten und leider hat der Schreiber es mittels "Optparse" ein wenig (für mich) undurchsichtig gemacht.
folgendes ist der Inhalt:
Code: Alles auswählen
import optparse
parser = optparse.OptionParser(__doc__.strip())
parser.add_option('-v', '--verbose', action='count',
default=0,
dest='verbose_plus',
help="Increase verbosity.")
parser.add_option('-q', '--silent', '--quiet', action='count',
default=0,
dest='verbose_neg',
help="Silent operation, no output unless error.")
parser.add_option('-n', '--dry-run', action='store_true',
help="Dry run, do not really import.")
parser.add_option('-u', '--user', action='store',
default='Administrator',
help="Import as given user.")
parser.add_option('-p', '--project', action='store',
default='Administration',
help="Import in given project.")
parser.add_option('-d', '--destination-folder', action='store',
help="Specify destination folder (relative or not to the "
"project import root folder).")
parser.add_option('-a', '--absolute', '--no-relative-root',
action='store_true', dest='absolute', default=False,
help="The destination folder root is not relative to "
"the project import root folder.")
opts, args = parser.parse_args()
dbname, srcdns = args[0], args[1:]
was genau steht in srcdns bzw. was ist der Unterschied zwischen args[0] und args [1:] und was soll der Doppelpunkt im Arrayindex?
Ich komme nicht wirklich aus der Python Welt, sondern hatte es bislang eher mit Windows Anwendungsentwicklung unter C++ und C# zu tun, da ist eben manches anders....
Danke fuer Eure Hilfe!