kevinjosethomas / py-mon Goto Github PK
View Code? Open in Web Editor NEW๐ Automatically restart application when file changes are detected; made for development
Home Page: https://pypi.org/project/py-mon/
License: MIT License
๐ Automatically restart application when file changes are detected; made for development
Home Page: https://pypi.org/project/py-mon/
License: MIT License
[pymon] watching path: .
[pymon] watching patterns: *.py
[pymon] enter 'rs' to restart or 'stop' to terminate
[pymon] starting main.py
Clean Interface:
Hide unnecessary logs by default, ensuring a cleaner and more focused interface for users.
don't show restart again and again.
pymon main.py -c
age = input("Enter your age: ")
age_input = int(age)
print("Your age is:", age_input)
day = input("Enter the day of the week: ")
When running Python scripts within the PyMon environment, I encountered an issue related to user input handling. After entering the age as prompted, pressing Enter causes the cursor to move to the next line without displaying the prompt for entering the day of the week. Subsequently, when re-entering the age, the script throws a ValueError, as shown below:
Traceback (most recent call last):
File "C:\Users\....", line 2, in <module>
age_input = int(age)
ValueError: invalid literal for int() with base 10: ''
This behavior makes it difficult to proceed with the script execution as expected.
After entering the age and pressing Enter, the prompt for entering the day of the week should be displayed, allowing the user to continue providing input as expected.
This issue significantly affects the usability of the PyMon environment, especially for scripts requiring user input at multiple points. Any guidance or workaround for addressing this issue would be greatly appreciated.
vlad@vlad-Dell-G15-5510:~/Github/python-pg$ pip install py-mon
Defaulting to user installation because normal site-packages is not writeable
Collecting py-mon
Using cached py_mon-2.0.5-py3-none-any.whl (5.5 kB)
Requirement already satisfied: watchdog in /home/vlad/.local/lib/python3.10/site-packages (from py-mon) (4.0.0)
Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (from py-mon) (0.4.4)
Installing collected packages: py-mon
WARNING: The script pymon is installed in '/home/vlad/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed py-mon-2.0.5
vlad@vlad-Dell-G15-5510:~/Github/python-pg$ pymon index.py
Command 'pymon' not found, but can be installed with:
...
Hello everyone,
it looks like that pymon
requires input stream, therefore it throw a error on running within a container
ai-1 | [pymon] watching patterns: *.py
ai-1 | [pymon] enter 'rs' to restart or 'stop' to terminate
ai-1 | [pymon] starting src/main.py
ai-1 | Traceback (most recent call last):
ai-1 | File "/usr/local/bin/pymon", line 8, in <module>
ai-1 | sys.exit(main())
ai-1 | ^^^^^^
ai-1 | File "/usr/local/lib/python3.11/site-packages/pymon/main.py", line 64, in main
ai-1 | cmd = input()
ai-1 | ^^^^^^^
ai-1 | EOFError: EOF when reading a line
I suggest add addition flag to disable pymon commands during execution.
Thank you
Hello, after install the latest version using poetry, the error bellow are showed when I try to run: pymon main.py
Traceback (most recent call last):
File "/home/user/.cache/pypoetry/virtualenvs/someproject-Gh1HaAQO-py3.10/bin/pymon", line 5, in <module>
from pymon.main import main
File "/home/user/.cache/pypoetry/virtualenvs/someproject-Gh1HaAQO-py3.10/lib/python3.10/site-packages/pymon/main.py", line 6, in <module>
from colorama import Fore, Style, init
ModuleNotFoundError: No module named 'colorama'
Also the same error is showed for watchdog package:
ModuleNotFoundError: No module named 'watchdog'
This can easily be fixed just installing the packages with poetry, but I think, adding these two packages as a dependency for the py-mon` application can help new users a lot with these errors.
I have a script that requires arguments to be passed when starting the script like so: python main.py dev
Is this possible? I tried directly doing pymon main.py dev
but it didn't work
when a call without '.py' is called
pymon SOMEFILE
gets [Errno 2] No such file or directory
it's will be nice if it works without adding the Extention
I can't get py-mon to work properly when using --args "text".
Instead of invoking my python script with "text" in argv, it send "t", "e", "x", "t".
In main.py code, I dump sys.argv
array.
I invoke pymon like this :
"pymon main.py --args config.yaml"
And then I get :
['main.py', 'c', 'o', 'n', 'f', 'i', 'g', '.', 'y', 'a', 'm', 'l']
The argument is correctly parsed by argparse
as a string, but then in line 60 of monitor.py
you use this construct :
self.process = subprocess.Popen([executable, self.filename, *self.args])
That's where the string is turned into an array, which is wrong.
I've patched it for my own use, since I only need one arg.
But I guess it would be more useful to allow to provide several args on the command line, and use them with subprocess.Popen.
tried running a flask app , didn't work. got this message instead: [pymon] restarting due to opened...
When using the python socketIO get started example [ Get it here: https://python-socketio.readthedocs.io/en/latest/intro.html#server-examples ]:
The first boot works and the server is reachable on port:5000
On save i get the following message:
[pymon] restarting due to modified...
[pymon] restarting due to closed...
The server doesn't start again after a save.
Maybe it's a problem of my system or of the servers used but making that work would be great.
Regards, Stevetec
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.