[Tutor] Re: Tutor Digest, Vol 12, Issue 71

Lobster zen45800 at zen.co.uk
Mon Feb 14 19:32:26 CET 2005


 >> - I am trying to call up an external program
 >> with something like a "Shell" command - can not find a way of doing
 >> this
 >> (in windows)
 >>
 >> Any hints?

    What about os.system('your_command_here')?


=====

That is a good tip and seems to be the place I need to look
- not really quite sure what I am looking at in the help docs
I also have the complication of having to use is it "C:\\"
- two back slashes?

I am trying to get a wikipedia directed search that will load firefox and
search for an inputted word . . .


Anyway this is the code (only my second useful program)
eh - not working so far . . .

usually dumbing down help appreciated

=====

Ed Jason

========= <code>

# Wikipedia search engine
# Sunday Feb 12

import os               

word_sought = raw_input("What is your wikipedia search word? ")
goto_url_location = "http://en.wikipedia.org/wiki/" +  word_sought
print goto_url_location
os.execv('C:\Program Files\Mozilla Firefox\firefox.exe') + goto_url_location

======== </code>


More information about the Tutor mailing list