RE: Launch file in Notepad

Discussion in 'Python' started by Michael.Coll-Barth@VerizonWireless.com, May 12, 2005.

  1. Guest

    try b1="c:/test.txt"

    It seems to work for me on Windows 2000.

    -----Original Message-----
    From:
    python-list-bounces+michael.coll-barth=
    [mailto:python-list-bounces+michael.coll-barth=verizonwireless.com@pytho
    n.org]On Behalf Of George
    Sent: Thursday, May 12, 2005 9:41 AM
    To:
    Subject: Launch file in Notepad


    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
    --
    http://mail.python.org/mailman/listinfo/python-list
    ___________________________________________________________________
    The information contained in this message and any attachment may be
    proprietary, confidential, and privileged or subject to the work
    product doctrine and thus protected from disclosure. If the reader
    of this message is not the intended recipient, or an employee or
    agent responsible for delivering this message to the intended
    recipient, you are hereby notified that any dissemination,
    distribution or copying of this communication is strictly prohibited.
    If you have received this communication in error, please notify me
    immediately by replying to this message and deleting it and all
    copies and backups thereof. Thank you.
     
    , May 12, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JDS
    Replies:
    4
    Views:
    8,278
    ForestHonerkamp
    Nov 11, 2008
  2. =?Utf-8?B?Uk4gRGFz?=
    Replies:
    5
    Views:
    8,277
    srajput
    May 23, 2008
  3. George

    Launch file in Notepad

    George, May 12, 2005, in forum: Python
    Replies:
    17
    Views:
    815
    Roger Upole
    May 13, 2005
  4. boris
    Replies:
    1
    Views:
    1,839
  5. JDS
    Replies:
    3
    Views:
    195
    gnari
    May 24, 2004
Loading...

Share This Page