How can I pass command line arguments when python is embedded ???

Luc acid_til at yahoo.com
Thu Jan 30 13:29:19 EST 2003


Thanks a lot !!! That's exactly what I was looking for :) :) :) :)

Luc.

Werner Schiendl wrote:
> Hi,
> 
> sorry, I missed the "when python is embedded" because it was not visible 
> in the message overview.
> 
> To setup sys.argv, you use the function PySys_SetArgv after Py_Initialize.
> 
> See Modules/main.c in the Python Source distribution on how to do it.
> 
> best regards
> Werner
> 
> 
> On Thu, 30 Jan 2003 18:45:07 +0100, Werner Schiendl 
> <n17999924.temp.werner at neverbox.com> wrote:
> 
>> Hi,
>>
>> you find the command line parameters in sys.argv
>>
>> e. g.
>>
>> import sys
>>
>> for arg in sys.argv:
>> print arg
>>
>> The first item is the name of the script, the remainder are the 
>> parameters.
>>
>> hth
>> Werner
>>
>>
>> On Thu, 30 Jan 2003 11:51:32 -0500, Luc <acid_til at yahoo.com> wrote:
>>
>>> Hello fellow Python users :)
>>>
>>> Like the subject says, how can I do it ??? What I want to do is pass 
>>> a number to the python script file that is to be used to determined 
>>> when to load from a database.
>>>
>>> Thanks in advance for any help.
>>>
>>> Luc.
>>>
>>>
>>
>>
>>
> 
> 





More information about the Python-list mailing list