Reputation: 11
I'm running a simple script that compares two values and prints it's result, and I want to anyone who executes it, opens the CMD or Powershell and keep it on top of every other window, as if it was the GUI of the script (just to show Python prints).
E.G.
NUM1 = 0
NUM2 = 5
while NUM1 != NUM2:
print(NUM1, NUM2)
NUM1 += 1
print(NUM1, NUM2, 'are equals.')
The goal I have in mind is to create an .exe or keep as a script, which uses CMD as if it was its "GUI" to show my Python script prints, the same way as if you were using CMD commands (cd ~/main.py) to run the script.
When executed, it should open and resize that CMD window and make it always on top, and then run the Python code.
For now, I'm forcing the users to use a .bat file, which is re-sized, executes main.py, and recommending using Autohotkey to keep it on top.
Actual .bat file
mode con: cols=60 lines=10
timeout 10
cls
python main.py
Thanks in advance and sorry if I'm skipping something, it's my first post on StackOverflow😅
Upvotes: 1
Views: 350