Python Forum
1st Script written doesn't output anything. Need some else's eyes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
1st Script written doesn't output anything. Need some else's eyes
#2
In your "main" function, you need to change you're elif's to look like the "if" statement, you can also remove all the redundant parenthesis:

        if operation == '+':
            print(add(var1, var2))
        elif operation == '-':
            print(sub(var1, var2))
        elif operation == '*':
            print(mul(var1, var2))
        else:
            print(div(var1, var2))
Then you need to call the function "main()". Add this to the end of your script:

if __name__ == "__main__":
    main()
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply


Messages In This Thread
RE: 1st Script written doesn't output anything. Need some else's eyes - by sparkz_alot - Feb-20-2018, 01:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to crop eyes/nose/mouth in the face only? [OpenCV] buzzdarkyear 0 2,207 Jan-11-2022, 01:41 PM
Last Post: buzzdarkyear
  Real-Time output of server script on a client script. throwaway34 2 2,110 Oct-03-2021, 09:37 AM
Last Post: ibreeden
  string function doesn't work in script ClockPillow 3 2,464 Jul-13-2021, 02:47 PM
Last Post: deanhystad
  Python script to summarize excel tables, then output a composite table? i'm a total n surfer349 1 2,422 Feb-05-2021, 04:37 PM
Last Post: nilamo
  Curses script doesn't work wavic 1 4,214 Jan-08-2021, 09:11 PM
Last Post: wavic
  Import output from python script to another varietyjones 1 1,942 Oct-12-2020, 09:07 PM
Last Post: bowlofred
  Reading from the written output buduboti 0 1,219 Apr-25-2020, 09:17 PM
Last Post: buduboti
  Manipulating the filename of an output script mckinneycm 4 11,955 Jan-15-2020, 07:29 PM
Last Post: mckinneycm
  Python Script Spawned by Cron or Systemd doesn't write files..? johnnyrobot 2 2,637 May-24-2019, 07:04 PM
Last Post: Larz60+
  Redircet output of Python script to .txt file gurbhej_singh 7 8,525 May-20-2019, 01:11 AM
Last Post: woooee

Forum Jump:

User Panel Messages

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