Friday, April 22, 2022

Python - Script Main.py call scripts.py

1 - ========================================

script1.py:
#!/usr/bin/env python3
print('Hello World!1')

script2.py:
#!/usr/bin/env python3
print('Hello World!2')


script_main.py:
#!/usr/bin/env python3
import subprocess

subprocess.call("./script1.py", shell=True)
subprocess.call("./script2.py", shell=True)


Permissions scripts:
chmod u+x script1.py
chmod u+x script2.py
chmod u+x script_main.py

Python line:
./script_main.py

2 - ========================================

script_main.py:
#!/usr/bin/env python
# coding: utf-8

import runpy

runpy.run_path(path_name='script1.py')
runpy.run_path(path_name='script2.py')

Python line:
./script_main.py

No comments:

Post a Comment

Power BI APP - Delete or Unpublish

 UNPUBLISH DELETE