•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 427,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,924 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 293 | Replies: 1
![]() |
•
•
Join Date: Jun 2008
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 0
Hey you all
I have a simple question :
How do we call a shell script from a python script ? (Windows)
I tried this :
and this :
I played with the sh, adding it, removing it, adding .exe
I played with the slashes ..
I couldn't get this work
Thanks
I have a simple question :
How do we call a shell script from a python script ? (Windows)
I tried this :
import os
os.system('sh C:\temp\script.sh')and this :
import subprocess
subprocess.call("C:\temp\script.sh",shell=True)I played with the sh, adding it, removing it, adding .exe
I played with the slashes ..
I couldn't get this work
Thanks
if you can type exactly that command into your command window, then os.system() with *exactly* that command will work.
What doesn't work about it? Are you getting an error?
What doesn't work about it? Are you getting an error?
Let's Go Pens!
** Just because I reply to your question does not invite you to PM me. Keep discussions on the thread of topic, I will not answer your questions over PM. **
** Just because I reply to your question does not invite you to PM me. Keep discussions on the thread of topic, I will not answer your questions over PM. **
![]() |
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- execute python script from shell/Interactive Window (Python)
- gather a variable created in a batch file being executed. (Python)
- Python Error (Python)
- os.popen (Python)
Other Threads in the Python Forum
- Previous Thread: simple coding help
- Next Thread: Need help with confusing issue !!


Linear Mode