https://github.com/naseem1amjad/python-based-process-executor-and-controller
Run Python Within Python Script demonstration. The web based python script controls another script execution.
https://github.com/naseem1amjad/python-based-process-executor-and-controller
execution flask monitor python3 scripts shell website
Last synced: about 2 months ago
JSON representation
Run Python Within Python Script demonstration. The web based python script controls another script execution.
- Host: GitHub
- URL: https://github.com/naseem1amjad/python-based-process-executor-and-controller
- Owner: naseem1amjad
- License: other
- Created: 2021-10-01T01:05:35.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-01T01:13:39.000Z (almost 5 years ago)
- Last Synced: 2025-09-06T10:39:37.492Z (10 months ago)
- Topics: execution, flask, monitor, python3, scripts, shell, website
- Language: Python
- Homepage:
- Size: 2.76 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Python-Based-Process-Executor-And-Controller
README file by Naseem Amjad
Run Python From Another Python Script (using Web)
=====================================
Introduction:
-------------
There are 2 main open source scripts developed by me called control.py and test_run.py , this is a demonstration of how you can run a python script within another script. As control.py can be accessed through web (Flask), this means you can control test_run.py script remotely using a web browser.

Making Script (control.py) ready to run:
----------------------------------------
Create Virtual Environment by issuing following command:
>> python3 -m venv ./myenv/
(you may need to use sudo for getting enough permission and issue above command)
Use following command to activate the Virtual Environment just created
>> source myenv/bin/activate
To install Flask, use following command.
>> sudo apt install python3-flask
___________________________
Configuration of Environment:
-----------------------------
>> export FLASK_APP=control
then enter following command
>> flask run
Give following url in your web browser http://127.0.0.1:5000/check
Note: to make server accessible on net then issue following command
>> flask run --host=0.0.0.0
Now you can use http://yourIP:5000/ to access the web page.
___________________________
ABOUT test_run.py:
------------------
test_run.py is a sample script called from controll.py , you may click on web page to Start/Stop/Monitor test_run.py
test_run.py shows current datetime and runs for 30 seconds approx.
______________________________
About Developer:
----------
You may contact me @ naseem[at]technologist.com for further detail / assistance.
https://www.ajsoftpk.com/naseem_amjad/