G+_Rud Dog Posted September 13, 2015 Share Posted September 13, 2015 Not many DOS batch files communities out there. Running Windows 7 Would like to, from a batch file, launch Dos Prompt Window and type in the following: python setup.py py2exe Any ideas? Link to comment Share on other sites More sharing options...
G+_Eddie Foy Posted September 13, 2015 Share Posted September 13, 2015 start cmd python setup.py py2exe possibly? Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 13, 2015 Author Share Posted September 13, 2015 That pretty much launches DOS cmd prompt window as if you typed in "cmd" does not carry out the "python setup.py py23 exe portion". Been trying a lot of examples seen on line but none so far actually do what is needed. Thanks for your input Eddie. Link to comment Share on other sites More sharing options...
G+_Eddie Foy Posted September 13, 2015 Share Posted September 13, 2015 take out the cmd. might need to quote the string after the start Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 13, 2015 Author Share Posted September 13, 2015 pretty much not working no matter what I try even though I can run the simple calc or notepad from the searches on the web. Link to comment Share on other sites More sharing options...
G+_Jason Davis Posted September 13, 2015 Share Posted September 13, 2015 Why do you want to open a separate cmd prompt you might be able to call the python command to get it to run Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 13, 2015 Author Share Posted September 13, 2015 +Jason Davis Can you give an example using the shown info? Thanks in advance. Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 13, 2015 Author Share Posted September 13, 2015 Got it to work, in this case the python script was not found by the bat file script so by putting the bat file in the same dir it was able to run on the file in question and create executable. What made it possible to see the error after my batch file failed was the "pause" placed inside the batch file. The addition of the pause kept the DOS prompt window open after it ran.This gave me time to see the error, it could not find the "py" file it was looking for. So here is the line in my bat file. Place bat file in the same location as the file you are trying to create executable. C:\Python34\python.exe C:\Python34\Scripts\setup.py py2exe Link to comment Share on other sites More sharing options...
G+_Eddie Foy Posted September 14, 2015 Share Posted September 14, 2015 paths are your friends and enemies. File not found is the first clue. very happy to know you got it working!! Enjoy. Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 14, 2015 Author Share Posted September 14, 2015 Guys, what I posted was a first time test later found removing the path from internals of batch file was not a problem but being overly cautious. After entering this: python.exe setup.py py2exe The batch file still worked. Yes the paths are our friends but desperation called for desperate measures so the paths were included. Now for the answer to the problem in case someone else had this problem and has the proper paths in the PATH Var, the batch file has to be in the same directory as the script you are trying to run it on. setup.py and setup.bat(what I named my bat file with these lines in it: python.exe setup.py py2exe) Works great now, love it when intended project works! Thank you for your input. Link to comment Share on other sites More sharing options...
Recommended Posts