raw_input with a pre-compiled data
davea at ieee.org
Sat Jun 20 21:27:50 CEST 2009
> Could you use if elif statements? Don't understand what you mean really?
> On Sat, Jun 20, 2009 at 3:01 PM, Dave Angel <davea at ieee.org> wrote:
>> Luca wrote:
>>> Hi all.
>>> I need to use a function like the raw_input to read data from user
>>> command line, but I really like to pre-compile the choice and I'm not
>>> able to do this. There is some other function/module I can use?
>>> I wanna to pre-compile the raw_input input line with the current working
>> You'll have to define several terms for us:
>> 1) "pre-compile" - Are you coding in Python, or in C, or some other
>> compiled language? Microsoft C has (had?) something called pre-compiled
>> headers, but they never worked very well, so I kept them disabled.
>> 2) "the choice" - what choice would that be?
>> 3) "this" - what's this?
>> 4) "current working path" - what does this mean? Do you perhaps mean
>> "current directory" aka "current working directory" ? Or do you mean the
>> path to the __main__ file?
>> The only thing I can understand clearly is "read data from user command
>> line". You get that from sys.argv usually, or you can parse it with
>> optparse. Or if you need the line unmodified, AND if you're on Windows, you
>> can use the win32 module to call something like GetCommandLine(). I'd have
>> to check that last one, though.
This was sent off-list. And it was top-posted, so I'll have to copy his
two questions here...
> Could you use if elif statements?
Yes. Whenever they're needed. But I don't see the relevance to this
> Don't understand what you mean really?
This "question" doesn't parse.
More information about the Python-list