Python Forum
How To Set Up And Execute A Python File
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To Set Up And Execute A Python File
#4
I seem to have got it working now.

After trying what Larz60+ said, in Python, I right clicked on the code I had opened and selected "Run Code in Python Console". When I did, I noticed that it was telling me that none of the packages I required for the code were installed- although I had them installed for this code file on Pycharm. So the code was falling over and hence not working outside Pycharm.

I went and installed all the required packages for my code in the directory of the file I was trying to use and ran it again in "Run Code in Python Console" inside Pycharm to check for any other errors. Nothing came up so the code worked there.

Now when I double click the .py file in windows explorer, it fires up Python and runs it successfully without needing to open Pycharm.

Thanks again Larz60+. I have spend hours outside Pycharm fiddling without success to get this to work and only after you directed me back inside Pycharm, I tried other things and got lucky.
Reply


Messages In This Thread
RE: How To Set Up And Execute A Python File - by knight2000 - May-31-2022, 03:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Failed to execute child process (No such file or directory) uriel 1 1,700 Sep-15-2022, 03:48 PM
Last Post: Gribouillis
  execute python script guy7200 1 1,629 Oct-25-2021, 09:55 PM
Last Post: Axel_Erfurt
  Possible to execute a python script before log off/shutdown with input commands? Kaltex 1 2,317 May-18-2021, 06:31 AM
Last Post: Skaperen
  Using python to execute app or cmd that requires admin credentials thewolf 0 2,146 Mar-05-2021, 08:15 PM
Last Post: thewolf
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 4,750 Nov-30-2020, 03:24 PM
Last Post: gacg1
  Execute DBCC CHECKDB from python script susja 1 2,166 Aug-12-2020, 02:09 AM
Last Post: susja
  Trying to write and execute first Python script garvind25 3 2,956 May-23-2020, 07:36 PM
Last Post: garvind25
  How to assess elapsed time to execute a .exe file or opening a desktop application? Sudershan 2 2,182 Apr-18-2020, 01:40 PM
Last Post: buran
  How to execute Python code leemao 2 2,216 Dec-21-2019, 02:35 PM
Last Post: leemao
  Execute .sql file in python pradeepkumarbe 3 14,398 Nov-05-2019, 08:55 AM
Last Post: MckJohan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020