Re: Launch file in Notepad

2005-05-13 Thread Roger Upole
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, 12 May 2005 15:34:39 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >> I think the use of forward slashes for command line switches >> was adopted by CP/M from DE

Re: Launch file in Notepad

2005-05-13 Thread Grant Edwards
On 2005-05-13, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 12 May 2005 15:34:39 -, Grant Edwards <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> I think the use of forward slashes for command line switches >> was adopted by CP/M from DEC's OSes (e.g. RSX-11).

Re: Launch file in Notepad

2005-05-12 Thread Brian van den Broek
Fredrik Lundh said unto the world upon 2005-05-12 13:52: > Brian van den Broek wrote: > > >>>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 t

Re: Launch file in Notepad

2005-05-12 Thread Greg Krohn
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? > > (

Re: Launch file in Notepad

2005-05-12 Thread Bengt Richter
On Thu, 12 May 2005 16:30:36 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On Thu, 12 May 2005 15:14:09 GMT, [EMAIL PROTECTED] (Bengt Richter) declaimed >the following in comp.lang.python: > > >> >> I don't know why MS used backslashes when unix had a perfectly good path >> syntax >> (not t

Re: Launch file in Notepad

2005-05-12 Thread Fredrik Lundh
Brian van den Broek wrote: > > 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

Re: Launch file in Notepad

2005-05-12 Thread Grant Edwards
On 2005-05-12, Bengt Richter <[EMAIL PROTECTED]> wrote: >>> There are several ways, but the preferred solution is to switch the >>> slash direction: "c:/test.txt". Python's smart enough to notice its >>> running on Windows and do the right thing with the slash. >> >>Does Python really look at th

Re: Launch file in Notepad

2005-05-12 Thread George
Bengt Richter wrote: > On Thu, 12 May 2005 15:41:14 +0200, George <[EMAIL PROTECTED]> wrote: >>(By the way, b1 comes from a command line parameter, so the user enters >>c:\test.txt as command line parameter.) > > It should be ok then, unless you have somehow processed the command line > paramet

Re: Launch file in Notepad

2005-05-12 Thread Bengt Richter
On Thu, 12 May 2005 14:20:29 -, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2005-05-12, Brian van den Broek <[EMAIL PROTECTED]> wrote: > >>> 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: es

Re: Launch file in Notepad

2005-05-12 Thread George
Grant Edwards wrote: > On 2005-05-12, Brian van den Broek <[EMAIL PROTECTED]> wrote: > Does Python really look at the string and mess with the slash? > I don't think it needs to, since the Windows system calls have > always accepted forward slashses, haven't they? It did, but now not anymore.

Re: Launch file in Notepad

2005-05-12 Thread George
Richie Hindle wrote: >>By the way, b1 comes from a command line parameter, so the user enters >>c:\test.txt as command line parameter. > > > How are you prompting the user? When I run this: > > import os > b1=raw_input("Enter a filename: ") > os.system('notepad.exe ' + b1) > > and enter c:\te

Re: Launch file in Notepad

2005-05-12 Thread Bengt Richter
On Thu, 12 May 2005 15:41:14 +0200, George <[EMAIL PROTECTED]> 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 ope

Re: Launch file in Notepad

2005-05-12 Thread Grant Edwards
On 2005-05-12, Brian van den Broek <[EMAIL PROTECTED]> wrote: >> 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". > There are several ways, but the preferred solution is to switch the > sla

Re: Launch file in Notepad

2005-05-12 Thread Richie Hindle
[George] > b1="c:\test.txt" With this code, your problem is the embedded tab as you say. Use either r"c:\test.txt" or "c:\\test.txt". However, if this is true: > By the way, b1 comes from a command line parameter, so the user enters > c:\test.txt as command line parameter. then there will be

Re: Launch file in Notepad

2005-05-12 Thread Brian van den Broek
George said unto the world upon 2005-05-12 09:41: > 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.tx

RE: Launch file in Notepad

2005-05-12 Thread Michael . Coll-Barth
try b1="c:/test.txt" It seems to work for me on Windows 2000. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] n.org]On Behalf Of George Sent: Thursday, May 12, 2005 9:41 AM To: python-list@python.org Subject: Launch file in Notepad Newbie question: I'm trying to l