std in and stdout
Laszlo Nagy
gandalf at designaproduct.biz
Mon Jul 10 08:48:24 EDT 2006
Juergen Huber írta:
> hello,
>
> i have a question!
>
> how would i fix the following problem:
>
> now i have an input file with a fix name and an output file!
> i have this two files hardcoded written in the sourcecode of this function!
>
> in the future i will start this script with the command line.
> the syntax should be look like this:
>
> Python Function | Source File | Output File
> -------------------------------------------------------
> fileanalyse.py sourcefile.csv filenalyse.txt
>
> i will call the programm always with the commandline, that i could type in
> various filenames for the input and output files!
>
> could anybody help me?!
>
>
You might want to use sys.argv or the much nicer optparse module:
http://docs.python.org/lib/module-optparse.html
I might not have understood your problem, though. :)
Laszlo
More information about the Python-list
mailing list