@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> erm are you still der
<0> i need someone active to talk to
<1> Hey, I'm trying to run a command from a python script in windows, but no matter what is run I get a 1 as the status output
<1> I am running the script by double clicking the .py file
<1> my line is 'print commands.getstatusoutput("iexplore");
<1> (1, '') is the result
<1> I have tried with full path to iexplore, have also tried batch files
<2> what about files that don't exist?
<2> those should fail..
<1> files that don't exist get the same result
<1> 1,''
<3> LaptopZZ: http://docs.python.org/lib/module-commands.html
<1> environment is windows xp
<4> LaptopZZ, 1 is the return code for an error
<3> "Availability: Unix".
<4> There you go



<1> heh
<1> I overlooked that clearly
<1> is thre another command I can use to run a command?
<1> *function
<1> popen stuff?
<4> os.system(), but it will replace the current proc
<1> that's fine
<3> pjs: It will not, the current process is just paused.
<1> as long as it gets this command runs, the originating python script is done with its work
<3> With GUI programs on windows, that might run it in the background.
<1> ideally I'd like it to run in the background so the python window closes
<1> but if it stays open, I won't complain
<3> Try os.system() :)
<4> hund, Ahh, I see.
<1> I am trying ti now
<4> Sorry, not a windows guy in any sense :)
<1> I hate that I have to do this in windows
<1> but.. you don't always get to choose your environments
<3> Yes you do. :)
<1> not when you're getting paid to make a solution you don't
<0> at last
<3> Well, not after accepting hte job.
<1> :-)
<3> Of course, you could quit and starve, like Buddha. Worked for him.
<1> har har har
<4> heh
<0> im trying to write a download script
<1> process pauses till command finishes
<1> :-)
<1> thanks guys
<0> but when i issue the request command i keep getting errors
<3> You're welcome.
<0> req.request('GET', 'kcrw/audio/tu/tu060407The_Walls.mp3')
<1> codar: curl/wget :-P
<0> omdz
<4> codar, try /kcrw/audio....
<4> leading with /
<0> yh ive already done that dat was just a mistype
<4> paste your code (refer to topic), and error.. We cant do much to help until you do
<0> ok
<0> i'll be back in 10 rewriting the code since i deleted it out of fustration
<4> haha
<4> ok
<0> ok pjs here it comes
<0> if your there
<0> import httplib
<0> def download(podlink):
<0> req = httplib.urlsplit(podlink, scheme = '')
<0> conn = httplib.HTTPConnection(req[0] + '://' + req[1],'80')
<0> conn.request('GET', req[2])
<0>
<0> f = file('podcasts.txt', 'r')
<0> while True:
<0> srry about that
<0> i guess im going to have to type it out
<3> No.
<0> ?
<3> 23:44:14 < pjs> paste your code (refer to topic), and error.. We cant do much to help until you do
<0> ???
<0> dats what im trying to do



<4> codar, read the channel topic
<3> -!- Topic for #Python: Welcome to the Python programming language! | Use a pastebin for pastes like http://rafb.net/paste/
<0> im new to irc
<0> i don't know how to do a pastebin
<4> http://rafb.net/paste/
<0> oh
<4> You do know how to browse a website right?
<0> yh i do
<0> http://rafb.net/paste/results/DdxQIn90.html
<0> and this is what is in the podcasts.txt file
<0> 'http://aolradio.podcast.aol.com/kcrw/audio/tu/tu060407The_Walls.mp3'
<0> 'http://aolradio.podcast.aol.com/kcrw/audio/mb/mb060317The_Chalets.mp3'
<0> i know that the download function isn't complete but i cant do anything until the error is cleared
<3> Why can't you use httplib.urlopen()?
<0> im still learning python i guess i missed that
<3> If you're only going to save it to a file, there's urlretrieve() too.
<3> http://docs.python.org/lib/module-urllib.html
<0> oh thanks
<0> hey hund could you please give me a quick example of how urlretrieve is used
<0> itz ok
<3> The docs are pretty straightforward.
<0> so how would i go about programming a download status
<0> using '=' as the symbol
<3> Status while you're downloading or after?
<0> whilst downloading
<5> Hi
<5> How do I decompress a file?
<5> decompression doesnt seem to be in the manual
<6> How is this file compressed?
<5> .zip
<5> sorry im late =(
<6> What OS are you running?
<5> XP
<6> winzip.com
<5> No with Python
<6> zip
<5> Zip? that will decompress it
<5> ?
<6> http://docs.python.org/lib/module-zipfile.html
<6> No, it's zipfile, sorry
<6> Get to know docs.python.org
<5> I don't see any functions there
<5> And yes I've been through there
<5> =/
<6> Look harder
<5> =P
<5> I read everything on that page and I don't see it
<5> =(
<6> Go to the next page
<5> By pressing the right arrow?
<6> Yeah
<5> Okay
<5> With the function be under "zipfile objects"
<5> *would
<5> Is there just one function I do it with or do I need to use multiple functions
<5> Like unzip(archivelocation, destination)
<5> Hypothetically
<6> MercuryTW, I suggest you play with it in the interpreter. It's simple to test these kinds of things. Start off with: import zipfile; z = zipfile.ZipFile("archive.zip")
<7> Searching co-developers for the Evolutionary Knowledge System. See http://eks.nongnu.org for further information. PM me when you're interested.
<0> is any one here
<3> codar: Keep it in the channel. And it's impossible to help you if you don't explain, in detail, what the problem is.
<0> ok
<0> well basically all i need is an example on using urllib.urlretrieve
<0> i don't know how to use some of its functions
<0> such as report hook
<0> or filename
<0> heres the code
<0> http://rafb.net/paste/results/5Vfko585.html
<8> hello
<8> how do i get a reference to the file that is being executed
<8> like i used __import__ on the file


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

#ubuntu
#beginner
videobox xxxpass
ubuntu virtualpc2004 vga
#windows
mayoony
#nintendo
#solaris
#nhl
im not a perfect person i never ment to do those things to you



Home  |  disclaimer  |  contact  |  submit quotes