George wrote: > Newbie question: > > I'm trying to lauch Notepad from Python to open a textfile: > > import os > b1="c:\test.txt" > os.system('notepad.exe ' + b1) > > However, the t of test is escaped by the \, resulting in Notepad trying > to open "c: est.txt". > > How do I solve this? > > (By the way, b1 comes from a command line parameter, so the user enters > c:\test.txt as command line parameter.) > > George
The \t will only be interpreted as TAB if it was entered as part of your python code. If the \t was entered as a command line arg it will be interpreted as a \ and a t. For example: #test.py import sys b1 = sys.argv[1] b2 = "C:\test.txt" print b1 print b2 will result in this: C:\>test.py C:\test.txt C:\test.txt C: est.txt -greg -- http://mail.python.org/mailman/listinfo/python-list