Python Forum
Since PyCharm knows which file is "main", how can I tell it "run this project"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Since PyCharm knows which file is "main", how can I tell it "run this project"
#2
This section of the code:
if __name__ == '__main__':
    print(minmax(lessthan, 4, 2, 1, 5, 6, 3))    # Self-test code
    print(minmax(grtrthan, 4, 2, 1, 5, 6, 3))
is only run if starting if the module is called directly, by pressing run in PyCharm,
or from command line by typing:
python minmax.py
Reply


Messages In This Thread
RE: Since PyCharm knows which file is "main", how can I tell it "run this project" - by Larz60+ - Aug-31-2017, 07:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pycharm can't read file Genericgamemaker 5 1,581 Jul-24-2024, 08:10 PM
Last Post: deanhystad
  How to Randomly Print a Quote From a Text File When User Types a Command on Main Menu BillKochman 13 4,246 Apr-24-2024, 05:47 AM
Last Post: Bronjer
  Web project and running a .py file emont 0 1,223 Dec-11-2022, 11:15 PM
Last Post: emont
  export project to an installable software in Pycharm jalal0034 2 2,385 Oct-17-2022, 06:15 PM
Last Post: deanhystad
  python run all py files from main py file mg24 6 3,572 Oct-12-2022, 04:41 AM
Last Post: mg24
  PyCharm One Interpreter for every file? muzikman 3 2,593 Sep-28-2021, 02:09 AM
Last Post: snippsat
  Read csv file through PyCharm kimx0961 3 5,681 Aug-01-2021, 07:05 PM
Last Post: perfringo
  help with project of reading and searching big log file korenron 6 3,334 Jun-24-2021, 01:57 PM
Last Post: korenron
  guys please help me , pycharm is not able to identify my xlsx file CrazyGreenYT7 1 2,670 Jun-13-2021, 02:22 PM
Last Post: Larz60+
  Calling main in project structure fails sandro4912 0 1,953 Aug-22-2020, 01:51 PM
Last Post: sandro4912

Forum Jump:

User Panel Messages

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