Python Forum
Runs perfect in Python but fails to print last statement when converted to .exe. Help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Runs perfect in Python but fails to print last statement when converted to .exe. Help
#1
This code runs perfect in Python but fails to print last statement(printing calculation) when converted to .exe using pyinstaller. Please Help!

# Defining a function to print error when input is wrong.
def exp():
print('Error! Enter Valid Number')
# Unless entered value is correct ask to enter correct value.
# If the value is wrong call the function
while True:
try:
p=float(input('ENTER SUM'))
break
except:
exp()
# Unless entered value is correct ask to enter correct value.
# If the value is wrong call the function
while True:
try:
r=float(input('ENTER RATE'))
break
except:
exp()
# Unless entered value is correct ask to enter correct value.
# If the value is wrong call the function
while True:
try:
fz=float(input('ENTER TIME IN MONTH'))
break
except:
exp()
t=(fz/12)
# Print the calculation.
print('Interest=Rs',p*t*r/100,'\nAmount to pay=Rs',p+p*t*r/100)
Reply


Messages In This Thread
Runs perfect in Python but fails to print last statement when converted to .exe. Help - by sunil422 - Aug-13-2020, 06:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Are there errors in the code for my coin toss systems? Matlibplot is too perfect . Coolkat 0 342 Nov-13-2023, 11:54 AM
Last Post: Coolkat
  How to do 100 runs simulation based on the current codes? dududada 6 900 Sep-03-2023, 01:43 PM
Last Post: deanhystad
  Anaconda 2.4.2: The JupyterLab 3.5.3 fails to run the python code of the Geographical jamalnuman 0 312 Aug-23-2023, 07:48 AM
Last Post: jamalnuman
  Converted EXE file size is too large Rajasekaran 0 1,445 Mar-30-2023, 11:50 AM
Last Post: Rajasekaran
  Another program runs bho68 7 1,143 Nov-08-2022, 08:16 PM
Last Post: bho68
  Python converted EXE not working Rajasekaran 1 1,545 Aug-22-2022, 05:56 PM
Last Post: hismail_sa
  Issue when using open() in converted exe skakalpes 2 1,533 Feb-02-2022, 02:42 PM
Last Post: snippsat
  UnicodeEncodeError caused by print when program runs from Popen SheeppOSU 5 2,846 Jan-13-2022, 08:11 AM
Last Post: SheeppOSU
  Importing a function from another file runs the old lines also dedesssse 6 2,478 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  Why doesn't this print statement work? stylingpat 10 5,588 Mar-23-2021, 07:54 PM
Last Post: buran

Forum Jump:

User Panel Messages

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