[python] spusteni programu s parametry

starenka . starenka0 na gmail.com
Pondělí Únor 10 23:53:24 CET 2014


Ahoj,

no nevim, me to funguje...

starenka /tmp % cat meh.py
#!/usr/bin/env python
# coding=utf-8

import sys

print sys.argv
starenka /tmp % python meh.py -20
['meh.py', '-20']

BTW koukni se spis na argparse (stdlib) nebo docopt (pip /
https://github.com/docopt/docopt)

s.
---
In Perl you shoot yourself in the foot, but nobody can understand how
you did it. Six months later, neither can you. | print
'aknerats'[::-1]


2014-02-10 23:47 GMT+01:00 pythoncaha <pythoncaha at gmail.com>:
> Zdravim vsechny, nemuzu prekonat nasledujici problem, snad nekdo poradi...
>
> Spoustim program  program.py -20   tedy s parametrem  minus20.
> Ale sys.argv[1] mi hodnotu minus 20 nedava.
>
> Jak toho docilit.
>
> diky Ondra
>
> _______________________________________________
> Python mailing list
> python at py.cz
> http://www.py.cz/mailman/listinfo/python
>
> Visit: http://www.py.cz


Další informace o konferenci Python