Hi I was wondering if anybody knows how to change directories within a python/script file from DOS
I have Windows XP, but prefer running from DOS
So i would executre like this
python filebelow.py
*************** *************** *************** ********
[CODE=python]
import urllib
import os
def saveUrlToFile( url, fileName ):
f = open( fileName, 'wb' )
data = urllib.urlopen( url).read()
f.write( data )
f.close()
saveUrlToFile(
'www.google.ca' ,
'googlepage.txt ' )
[/CODE]
Here is where I want to change to another directory, for example
cd\
cd newdirectory
[CODE=python]
saveUrlToFile(
'www.hotmail.ca ',
'hotmailpage.tx t' )[CODE]
*************** *************** ***
I have Windows XP, but prefer running from DOS
So i would executre like this
python filebelow.py
*************** *************** *************** ********
[CODE=python]
import urllib
import os
def saveUrlToFile( url, fileName ):
f = open( fileName, 'wb' )
data = urllib.urlopen( url).read()
f.write( data )
f.close()
saveUrlToFile(
'www.google.ca' ,
'googlepage.txt ' )
[/CODE]
Here is where I want to change to another directory, for example
cd\
cd newdirectory
[CODE=python]
saveUrlToFile(
'www.hotmail.ca ',
'hotmailpage.tx t' )[CODE]
*************** *************** ***
Comment