I'm getting a different screen resolution (in a Python script) depending on whether I type commands into Cygwin manually or run them using a shell script, and I can't understand why.
I'm running Windows 8.1 / Cygwin 2.8.2 (and XWin Server at startup) / Python 2.7.13 (and am new to Cygwin and Python; please let me know if I can provide more details).
When I start Windows, open a Cygwin terminal, enter
export DISPLAY=:0.0 and then enter
python c:/users/<my directories>/<python-file>.py, my GUI Python script runs normally.
w, h = root.winfo_screenwidth(), root.winfo_screenheight() appears in the Python script, for example, then the outputted values, corresponding to the screen resolution, are (1920, 1200).)
However, if I try to automate this process by double-clicking on the following Windows batch file:
c:\cygwin\bin\bash c:/users/<my directories>/<shell-file>.sh
where the shell file contains
#!/bin/sh export DISPLAY=:0.0 python c:/users/<my directories>/<python-file>.py
then my GUI Python script runs but is distorted (i.e., it's too large for the screen), and the resolution comes back as (1280, 800).
Why do these two methods give different results? How might I get a Python script to run with a resolution of (1920, 1200) in an automated way? Thank you.