473,385 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

calling different python scripts from a main script

3
hi all
How can diff python scripts be called from a main script which is again a .py? os.system("python external_script.py") works fine, but what if I want to handle the un handled exceptions of the external scripts in the main script??

thanx in advance
Sep 21 '10 #1
2 1725
bvdet
2,851 Expert Mod 2GB
Why not import the other python files?
Sep 21 '10 #2
dwblas
626 Expert 512MB
Try subprocess or pexpect.
Sep 22 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: windozbloz | last post by:
Bye Bye Billy Bob... Hello All, I'm a fairly literate windoz amateur programmer mostly in visual basic. I have switched to SuSE 9.2 Pro and am trying to quickly come up to speed with Python...
8
by: Jan Danielsson | last post by:
Hello all, How do I make a python script actually a _python_ in unix:ish environments? I know about adding: #!/bin/sh ..as the first row in a shell script, but when I installed python on...
5
by: Helmut Jarausch | last post by:
Hi, I'm still looking for an elegant and clear means to terminate the main script in Python. Unfortunately, Python doesn't allow a 'return' instruction in the main script. Using...
20
by: Ramdas | last post by:
How do I add users using Python scripts on a Linux machine? Someone has a script?
6
by: Ishpeck | last post by:
I'm using Python to automate testing software for my company. I wanted the computers in my testing lab to automatically fetch the latest version of the python scripts from a CVS repository and...
24
by: Mark | last post by:
Hi, I'm new to python and looking for a better idiom to use for the manner I have been organising my python scripts. I've googled all over the place about this but found absolutely nothing. I'm...
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
9
by: matthias | last post by:
Howdy ! I started using the assert() stmt and found it quite useful :-) I have only one problem: I don't know how to turn them off again. I know that "-O" turns off assertions in general. ...
3
by: Anthony Smith | last post by:
In my php page I am calling a Python cgi. The problem is that originally the Python script was being called directly and it could access the environment variables that were being set. Now since the...
9
by: Catherine Moroney | last post by:
I have one script (Match1) that calls a Fortran executable as a sub-process, and I want to write another script (Match4) that spawns off several instances of Match1 in parallel and then waits...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.