try this:
import sys
sys.argv = ['arg1', 'arg2']
execfile('abc.py')
Note that when abc.py
finishes, control will be returned to the calling program. Note too that abc.py
can call quit()
if indeed finished.
More Related Contents:
- Enhancement of unix script [closed]
- how to get the time after two minutes [closed]
- Execute python script while open terminal
- Running shell command and capturing the output
- Is there a simple way to get rid of junk values that come when you SSH using Python’s Paramiko library and fetch output from CLI of a remote machine?
- Some Unix commands fail with ” not found”, when executed using Python Paramiko exec_command
- How to save a Python interactive session?
- Execute multiple commands in Paramiko so that commands are affected by their predecessors
- Seeing escape characters when pressing the arrow keys in python shell
- Execute terminal command from python in new terminal window?
- How do I pipe a subprocess call to a text file?
- Is there any simple way to benchmark Python script?
- Shell Script: Execute a python program from within a shell script
- Call Python script from bash with argument
- Why is an MD5 hash created by Python different from one created using echo and md5sum in the shell?
- python getoutput() equivalent in subprocess [duplicate]
- Conda command working in command prompt but not in bash script
- Calling a python script from command line without typing “python” first
- When to use Shell=True for Python subprocess module [duplicate]
- Implement an interactive shell over ssh in Python using Paramiko?
- How to repeat last command in python interpreter shell?
- How to run a python script from IDLE interactive shell?
- Why does subprocess.Popen() with shell=True work differently on Linux vs Windows?
- assigning value to shell variable using a function return value from Python
- Can’t execute shell script from python subprocess: permission denied
- Hiding console output produced by os.system
- Cannot find the file specified when using subprocess.call(‘dir’, shell=True) in Python
- How to execute a script remotely in Python using SSH?
- What is the subprocess.Popen max length of the args parameter?
- Python | change text color in shell [duplicate]