0

I've made a simple python script that is activated by a MS Word macro, and requires user input.

When I run it, it opens a command line window that I must maximise from the menu line in Win 10.

Is there any way to make that window pop up automatically?

I found an alternative solution: instead of activating the script from a Word macro, I made a .bat file that activates the script, made a shortcut to the .bat file on the desktop, and made assigned global shortcut keys to the shortcut. This way I can acrivate the script while in any windows program, and the program window pops up as desired.

Jac_Pike
  • 1
  • 1
  • maybe use some GUI framework instead of standard `input()` - ie. `tkinter`, – furas Feb 15 '22 at 14:32
  • I thought about tkinter and pysimplegui, but the script offers a number of options for the user to choose between, and the number may vary. Making a tkinter window of variable size that uses a variable number of options seems a little complicated, and since my script works fine in a cmd window, I thought I'd try to avoid using a GUI – Jac_Pike Feb 15 '22 at 16:16
  • on Linux you could resize command line window (terminal/console) like in question [Resize the terminal with Python?](https://stackoverflow.com/questions/6418678/resize-the-terminal-with-python) but I don't know if Windows has something similar. And I don't use Windows to check it. Maybe using [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/) you could send some `key shortcut` to resize window, or control mouse to click some button. – furas Feb 15 '22 at 17:41
  • using Google I found [python - Automatically Resize Command Line Window - Stack Overflow](https://stackoverflow.com/questions/9458870/automatically-resize-command-line-window) – furas Feb 15 '22 at 17:44
  • I tested that. It doesn't make the window pop up – Jac_Pike Feb 17 '22 at 07:56

0 Answers0