Question: I have a script named `test1.py` which is not in a module. It just has code that should execute when the script itself is run. There are no functions, classes, methods, etc. I have another script which runs as a service. I want to call `test1.py` from the script running as a service.

For example:

File **`test1.py`**:

```
print "I am a test"
print "see! I do nothing productive."

```

File **`service.py`**:

```
# Lots of stuff here
test1.py # do whatever is in test1.py

```

I'm aware of one method which is opening the file, reading the contents, and basically evaluating it. I'm assuming there's a better way of doing this. Or at least I hope so.

Answer: 
```
import os

os.system("python myOtherScript.py arg1 arg2 arg3")  

```

Using os you can make calls directly to your terminal. If you want to be even more specific you can concatenate your input string with local variables, ie.

```
command = 'python myOtherScript.py ' + sys.argv[1] + ' ' + sys.argv[2]
os.system(command)

```
As it's already mentioned, `runpy` is a nice way to run other scripts or modules from current script. 

By the way, it's quite common for a tracer or debugger to do this, and under such circumstances methods like importing the file directly or running the file in a subprocess usually do not work.

It also needs attention to use `exec` to run the code. You have to provide proper `run_globals` to avoid import error or some other issues. Refer to `runpy._run_code` for details.