Giter Site home page Giter Site logo

kevinjosethomas / py-mon Goto Github PK

View Code? Open in Web Editor NEW
55.0 55.0 11.0 34 KB

๐Ÿ” Automatically restart application when file changes are detected; made for development

Home Page: https://pypi.org/project/py-mon/

License: MIT License

Python 100.00%
automated-testing developer-tools development package pypi python testing

py-mon's Introduction

Hello! ๐Ÿ‘‹ I'm Kevin Thomas // wakatime

I'm a high school junior from Vancouver with a passion for computer science and software development. I'm working on developing efficient software with modern design and exceptional user experiences. Outside of the academic grind, I invest my time into learning new tech, participating in hackathons and working on a few side projects. Check out my work on my portfolio โœŒ๏ธ

Technology

TypeScript Python PostgreSQL next Stack

Code

Total Time: 1,791 hrs 46 mins

Python                     545 hrs 57 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   30.04 %
JavaScript                 417 hrs 29 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   22.97 %
TypeScript                 296 hrs         โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   16.28 %
JSX                        198 hrs 33 mins โ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   10.92 %
HTML                       135 hrs 35 mins โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   07.46 %
JSON                       37 hrs 44 mins  โ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   02.08 %
CSS                        35 hrs 13 mins  โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   01.94 %
Java                       31 hrs 5 mins   โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   01.71 %
SQL                        28 hrs 47 mins  โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   01.58 %
Other                      25 hrs 56 mins  โ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   01.43 %

py-mon's People

Contributors

hosam1696 avatar kevinjosethomas avatar mariovalney avatar mcuxdaredevil avatar nrdybhu1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

py-mon's Issues

Feature Request: Clean Interface Mode:

feature: Add Arguments

[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

args split as characters

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.

Run pymod in docker container

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

Constantly restarting regardless of changes

As soon as I run pymon test.py where test.py is just a file with print("hello world")
It floods the terminal with constant prompts of restarting due to changes detected

Edit: I am using Python 3.11.6 and the latest version of py-mon

This is what is looks like for me:
image

eventlet server dosnt restart

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

Is it possible to pass args to the command?

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

ModuleNotFoundError: No module named 'colorama'

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.

pymon Cann't run without the ".py" ext

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

Issue with Input Handling in PyMon

Code

age = input("Enter your age: ")
age_input = int(age)
print("Your age is:", age_input)

day = input("Enter the day of the week: ")

Description

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.

Steps to Reproduce:

  • Run a Python script within the PyMon environment.
  • When prompted to enter the age, input a value and press Enter.
  • Notice that the cursor moves to the next line without displaying the prompt for entering the day of the week.
  • Again press enter when prompted (if applicable).
  • Observe the ValueError thrown by the script.

Expected Behavior:

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.

Additional Information:

  • PyMon version: 2.0.4
  • Python version: 3.9.4
  • Operating system: Windows

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.

Command 'pymon' not found

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:
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.