#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    WA, USA
    Posts
    6
    Rep Power
    0

    Question Launching files with Python


    Hi there,

    Can anyone tell me how to open (launch) a file? For example, let's say I have a .bat file within the same directory as my .py file. What am i supposed to do?

    Thanks.

    Berk Can Celebisoy
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I'm assuming your on windows since you mentioned batch files for some reason.. Anyway you should be able to execute a Python program/file simply by double clicking on it!

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    133
    Rep Power
    12
    I'm guessing you want to open other files, not execute the python one.

    Anyway, if you can execute the other file, such as a bat-file, you should be able to execute them from within a python script with "os.system('path-to-file')". If it's a regular file, you'd need some other utility to open it with the application of your choice.

IMN logo majestic logo threadwatch logo seochat tools logo