On 2/05/2022 10:31 am, Brent Hunter wrote:

Hello Mike,

Thanks for your reply.  My apologies, I should have provided more background information.

I was recently running a Windows 10 machine and I believe it was running Python 3.8.  All I did was create a batch file titled Start-AIG.bat which simply contained the following: "pythonw AIG.py".  It started a python program titled "AIG.py" and the Python dialog box was displayed on my screen, running all day and night.  I set up Windows to run this batch file upon startup and it worked fine.  I remember having to do a bunch of research before I learned that I needed to put "pythonw AIG.py" in the batch file as opposed to "python AIG.py".


I have avoided Windows 11 so far.

In Windows 10, Python 3.8 prints Hello world

# hello.py
print("Hello world")

:: hello.bat
python c:/users/mike/bin/hello.py

Open a cmd window and run hello.bat

This does not print Hello world ...

:: hello.bat
pythonw c:/users/mike/bin/hello.py

I don't know (or care) why because I've never used pythonw.

Try that and if it doesn't work the problem is Windows 11 or your version of Python or something else I haven't considered.

However, my old windows 10 desktop crashed and I have a new Windows 11 machine.  I installed the latest stable version of Python, which is 3.10.  Now, when I try to execute the same batch file, it doesn't launch the app.  It could be because I'm using Windows 11 or could be because I now have a newer version of Python.

With this additional information, do you have any ideas what I should do to get the Python script running in the same way I had it running before?

Thank you!

Brent

*From:* Mike Dewhirst <mi...@dewhirst.com.au>
*Sent:* Saturday, April 30, 2022 7:15 PM
*To:* Brent Hunter <br...@brenthunter.tv>; python-l...@python.org
*Subject:* Re: Python Question re Executing a Script

On 1/05/2022 8:37 am, Brent Hunter wrote:

    Hello,

    I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 
bit).  I can't figure out from your documentation, how do I:

       1.  Run a python script that is located in the same directory ( 
C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 
3.10 )

       1.  How do I automatically run a python app at Windows startup?


https://www.windowscentral.com/how-launch-apps-automatically-during-login-windows-11

Personally, I write a batch file containing the 'python /location/of/script.py' command line and call that batch file. That assumes python.exe is on the Windows path.

Once tested and working it lets me edit the batch file to adjust the payload without having to touch the Windows stuff again.





    Thank you!

    Brent Hunter




--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7a854961-3ac2-7202-ca03-7337690655c4%40dewhirst.com.au.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to