On Sat, Oct 29, 2011 at 22:06, Lie Ryan <lie.1...@gmail.com> wrote: > On 10/30/2011 03:55 PM, Richard D. Moores wrote:
>> >> Hm. Problem: >> >>>>> import tarfile >>>>> tar = tarfile.open("C:\Users\Richard\Desktop\uncertainties-1.8.tar.gz") >> >> File "<stdin>", line 1 >> SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes >> in position 2-4: truncated \UXXXXXXXX escape >> > > use forward slash for file names even in Windows, or you had to escape the > backslashes 'C:\\Users\\Richard\\Desktop\\uncertainties-1.8.tar.gz' or use > raw string r"C:\Users\Richard\Desktop\uncertainties-1.8.tar.gz" Should have thought of that. >>> tar = tarfile.open("C:/Users/Richard/Desktop/uncertainties-1.8.tar.gz") >>> tar.extractall() >>> tar.close() >>> Thanks! Dick _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor