Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem in a python2 file
#15
(Aug-08-2018, 07:39 AM)sylas Wrote: Did you try the files on python2 ? My problem is on python2 since I cannot use python3 because python3 cannot import click.
yes, python2. that is why I say I have problem because you use input and not raw_input.
and as already explained to you several times - install click for python3 if you want to run it with python3
C:\>C:/Python27/python.exe c:/solver.py
solver.py  in python2.7
Resolve second degree equation. Enter the coefficients(numbers): a,b,c
 Are you ready: y/n ? y
('you entered:  ', 'y')
a 1
b 6
c 9
(-3.0, -3.0)
do you want to begin again for another equation ?
sylas
Do you agree ? y/n
We wiil continue
a s
Traceback (most recent call last):
  File "c:/solver.py", line 42, in <module>
    Solver().demo()
  File "c:/solver.py", line 13, in demo
    a = float(input("a "))
  File "<string>", line 1, in <module>
NameError: name 's' is not defined
Also note that it doesn't matter which version I use - if there is indentation error it will be the same in python2 and python3
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
Problem in a python2 file - by sylas - Aug-07-2018, 09:36 AM
RE: Problem in a python2 file - by Larz60+ - Aug-07-2018, 09:57 AM
RE: Problem in a python2 file - by wavic - Aug-07-2018, 10:06 AM
RE: Problem in a python2 file - by sylas - Aug-07-2018, 10:08 AM
RE: Problem in a python2 file - by Gribouillis - Aug-07-2018, 10:23 AM
RE: Problem in a python2 file - by sylas - Aug-07-2018, 10:55 AM
RE: Problem in a python2 file - by Gribouillis - Aug-07-2018, 11:57 AM
RE: Problem in a python2 file - by sylas - Aug-07-2018, 01:03 PM
RE: Problem in a python2 file - by snippsat - Aug-07-2018, 01:09 PM
RE: Problem in a python2 file - by sylas - Aug-08-2018, 06:59 AM
RE: Problem in a python2 file - by buran - Aug-08-2018, 07:05 AM
RE: Problem in a python2 file - by sylas - Aug-08-2018, 07:15 AM
RE: Problem in a python2 file - by buran - Aug-08-2018, 07:32 AM
RE: Problem in a python2 file - by sylas - Aug-08-2018, 07:39 AM
RE: Problem in a python2 file - by buran - Aug-08-2018, 07:42 AM
RE: Problem in a python2 file - by sylas - Aug-08-2018, 08:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python3 decoding problem but python2 OK mesbah 0 1,862 Nov-30-2019, 04:42 PM
Last Post: mesbah
  Trying to run a python2 script dagamer1991 3 2,617 Aug-12-2019, 12:33 PM
Last Post: buran
  python2.7 executables thus the system python2.7 was erroring utility.execute()? vivekm 1 1,826 May-20-2019, 11:24 AM
Last Post: vivekm
  Python2 is not supported Skaperen 2 2,244 Mar-01-2019, 07:50 PM
Last Post: stranac
  Posting zip file on HTTP network using Python2.7 deepti92 1 6,857 May-15-2018, 12:41 PM
Last Post: deepti92

Forum Jump:

User Panel Messages

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