Is there a way to execute batch &amp; .exe files with a Python Code ?   Because i try to write a programm what should execute a batch and later a .exe file at different paths.
2579
How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?
10025
In Windows I can write a file containing commands for cmd (usually .cmd or .bat files).  When I click on those files it will open cmd.exe and run them commands the file contains.  How would I do this in Ubuntu?         I'm sure this is a duplicate, but I can't find my answer. Its similar to these questions, but they don't answer the question:
90919
I know how to program Console application with parameters, example : myProgram.exe param1 param2.  My question is, how can I make my program works with |, example : echo "word" | myProgram.exe?
93899
I have a Python script that needs to execute an external program, but for some reason fails.  If I have the following script:  import os; os.system("C:\\Temp\\a b c\\Notepad.exe"); raw_input();   Then it fails with the following error:     'C:\Temp\a' is not recognized as an internal or external command, operable program or batch file.   If I escape the program with quotes:  import os; os.system('"C:\\Temp\\a b c\\Notepad.exe"'); raw_input();   Then it works. However, if I add a parameter, it stops working again:  import os; os.system('"C:\\Temp\\a b c\\Notepad.exe" "C:\\test.txt"'); raw_input();   What is the right way to execute a program and wait for it to complete? I do not need to read output from it, as it is a visual program that does a job and then just exits, but I need to wait for it to complete.  Also note, moving the program to a non-spaced path is not an option either.    This does not work either:  import os; os.system("'C:\\Temp\\a b c\\Notepad.exe'"); raw_input();   Note the swapped single/double quotes.  With or without a parameter to Notepad here, it fails with the error message     The filename, directory name, or volume label syntax is incorrect.
66146
We are having trouble adding our batch scripts to the Windows 7, 8 or 10 taskbar or start menu.  Our batchfiles take some arguments and just execute other application based on those arguments . To keep it simple, we created some shortcuts for our customers which they just need to click in order to get everything running.  The question here is: How can we pin those shortcuts or batch files to the taskbar or start menu?  (The customers aren't supposed to access the file system and that's why they can only see the taskbar)
89847
I have a setup.bat file which install some applications and i want to execute it.  This is content of .bat file :  @echo off cls Rip_7z.exe x Rip0.7z cls del Rip0.7z cls Rip_7z.exe x Rip1.7z cls del Rip1.7z   I think the Rip_7z.exe file extracts the Rip0.7z and Rip1.7z files and builds the app.   How can I do this in the Ubuntu 11.04 Terminal?
23803
I would like to execute multiple commands in a row:  i.e. (just to illustrate my need):  cmd (the shell)  then  cd dir  and  ls  and read the result of the ls.  Any idea with subprocess module?  Update:  cd dir and ls are just an example. I need to run complex commands (following a particular order, without any pipelining). In fact, I would like one subprocess shell and the ability to launch many commands on it.
61827
How can I setup an array variable in a DOS batch script?  I would like to load it with a list of file names to process.  I really would like to keep this as simple as possible.  Thank you.
2870
If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file?  I also need an installer for my program.
61275
I have a batch file which is in a directory and must be run from there as well because it updates files within this directory. This works perfectly fine, except when the user runs the batch file as administrator (required on Vista). Then the starting directory is C:\Windows\System32. Is there any way to still be able to know from which directory the batch file was run? I dont want the user to enter the directory manually.
95856
I have some Python code that works correctly when I use python.exe to run it, but fails if I use pythonw.exe.       def runStuff(commandLine):         outputFileName = 'somefile.txt'         outputFile = open(outputFileName, "w")          try:             result = subprocess.call(commandLine, shell=True, stdout=outputFile)         except:             print 'Exception thrown:', str(sys.exc_info()[1])      myThread = threading.Thread(None, target=runStuff, commandLine=['whatever...'])     myThread.start()   The message I get is:       Exception thrown: [Error 6] The handle is invalid   However, if I don't specify the 'stdout' parameter, subprocess.call() starts okay.  I can see that pythonw.exe might be redirecting output itself, but I can't see why I'm blocked from specifying stdout for a new thread.
58481
I'm running Windows and the shell/OS automatically runs Python based on the registry settings when you run a program on the command line. Will this break if I install a 2.x and 3.x version of Python on the same machine?  I want to play with Python 3 while still being able to run 2.x scripts on the same machine.
5312
I thought I heard that  was able to do this, but I never figured it out.  Has anyone successfully done this?  Can I see your setup.py file, and what command line options you used?  Basically I'm thinking of it giving me a single executable file that does something like unzips itself to maybe /temp and runs.
96977
Say I have a file called calc.exe ( for example).  When I go to CMD and I run calc.exe it runs  because Windows has PATH settings in its environment variables.  Path information is  also accessible via typing path in cmd. ( as we all know).  Question  But - Is there any command in cmd that shows me information like this :   c:\&gt; locate_Where_It_Will_run_From calc.exe   Response :   c:\windows   I mean , the only solution which I see now is to run :   dir /s  calc.exe   And then to match results with the PATH information .  Is there any such command which will show me the information of my example above ?
13938
I am a super newbie for Ubuntu and basically need Ubuntu for a Python package.  I would like to run a Python file in say e:/username/folder1/folder2/python.py. I tried every method online and the only reply is bash: cd./e: No such file or directory. I am not sure whether it is because of the bash windows or virtualenv.  When I use bash on Ubuntu on Windows, ls, it says VIRTUALENV_DIR. cd, it says /home/username. The cd .. etc changes the directory a little, but not another drive, nor the folder I would like it to find.
51670
Is there a way to step through a .bat script? The thing is, I have a build script , which calls a lot of other scripts, and I would like to see what is the order in which they are called, so that I may know where exactly I have to go about and add my modifications.
102244
Lately all of my work has been in Python (and Ruby), and I'm in love with those two languages. There are many libraries for game development on Python but the problem I see is that many of those frameworks don't cover the "distribution" aspect of game creation. I'd like to code my game on Python (and any other pure Python extra libraries I need) and be able to distribute an executable for the main PC platforms (Windows, Mac and Linux).  Any options out there or what are the best combinations for this? (maybe pyglet + cx_freeze)