[Tutor] Python bz2 IOError: invalid data stream when trying to decompress

2013-04-10 Thread Rodney Lewis
My question is at StackOverflow so I won't repeat it here.

http://stackoverflow.com/questions/15938629/python-bz2-ioerror-invalid-data-stream-when-trying-to-decompress

Thanks so much in advance for any help you can provide regarding this.

http://www.squidoo.com/introductiontopython

-- 
Rodney Lewis
Please Visit My Homepage:
http://www.squidoo.com/dotcomboy
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] os.chdir() will not accept string variable

2011-04-15 Thread Rodney Lewis
I cannot get os.chdir() to accept inputData[0].  os.chdir() works as
expected in the interpreter when I put the little 'r' before the exact
same string but as a literal, e.g.: rF:\Music\Siouxsie and the
Banshees\the rapture

When I try to run it I get the following error in reference to the
os.chdir() line:

WindowsError: [Error 123] The filename, directory name, or volume
label syntax is incorrect 'F:\\Music\\Siouxsie and the Banshees\\the
rapture\n'

Why is it doubling the backslashes and adding '\n' to the end?  How do
I make it stop?  What does the little 'r' mean before a string literal
and how do I do the same for a string variable?

# mdf -- mp3datafixer

import glob, os

def mdf():
inputFile = open( 'mdfinputs.txt', 'r' )
inputData = inputFile.readlines()
inputFile.close()

os.chdir( r'%s' % inputData[0] )
newNames = []
oldNames = glob.glob( '*.*' )
for index, item in enumerate( oldNames ):
print index, item

if __name__ == '__main__':
mdf()
raw_input( \nPress 'enter' to close console window: ) # Keeps
console window open in Windows

Thanks!


-- 
Rodney Lewis
Please Visit My Homepage:
http://www.squidoo.com/dotcomboy
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] I am looking for a book on Beginners who never programmed before or have no experience in programming

2010-09-28 Thread Rodney Lewis
making games is the best way to learn programming, and the book is free

http://programming.gather.com/viewArticle.action?articleId=281474978440241
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor