Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 18th, 2012, 02:28 AM
jepot jepot is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 17 jepot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 17 m 23 sec
Reputation Power: 0
Executing py scripts from separate directories with an exe

Hey so my directory structure currently looks like this:

Code:
main
---folder1
-------one.py
---folder2
-------two.py


I would like to create an exe inside the main folder that runs one.py and then two.py so that when I hand over my main folder to someone who doesn't have python installed, they can just click on the exe file. Also inside folder1 and folder2 are some py scripts which are related respectively to one.py and two.py

Reply With Quote
  #2  
Old July 18th, 2012, 11:07 AM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,458 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 6 h 26 m 43 sec
Reputation Power: 403
A batch script, rather than a .exe is more likely to be appropriate.
Also, they'll need python installed to use the .py files.

Do you want the batch script to install python if python is not installed?

I suggest asking this question in the
http://forums.devshed.com/windows-help-34/
forum. I'd tell you to install cygwin and show you a bash script. I suppose the DOS script, without checking for python installation, would look something like

cd folder1
start python one.py
cd ..\folder2
start python two.py

or you'd use start idle instead of start python
I can say I that I don't know how to run non-gui jobs in the background in DOS. I expect it's learnable. Learnable? Learnable.
__________________
[code]Code tags[/code] are essential for python code!

Reply With Quote
  #3  
Old July 18th, 2012, 03:49 PM
jepot jepot is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2008
Posts: 17 jepot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 17 m 23 sec
Reputation Power: 0
Ok thanks, is it not possible to compile the scripts inside folder1 and folder2 to an exe so that a Python installation is not required?

Reply With Quote
  #4  
Old July 18th, 2012, 04:20 PM
b49P23TIvg's Avatar
b49P23TIvg b49P23TIvg is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Aug 2011
Posts: 3,458 b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level)b49P23TIvg User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 6 h 26 m 43 sec
Reputation Power: 403
I hate to hear impossible---unless it involves backward time travel. (OK, a particle with imaginary mass (a neutrino?) can travel in time. It doesn't end up here, though. It ends up there.)

I searched the internet as you could have:

http://www.logix4u.net/component/content/article/27-tutorials/44-how-to-create-windows-executable-exe-from-python-script

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Executing py scripts from separate directories with an exe

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap