Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem in a python2 file
#6
@wavic
sylvain@sylvain-HP-Laptop-15-bw0xx:~$ python3 -m pip install click
Requirement already satisfied: click in /usr/lib/python3/dist-packages (0.4.46+17.10.20170607.3.0ubuntu1)
launchpadlib 1.10.5 requires testresources, which is not installed.
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
@Larz click works well on python 2.7
#python2
import click

click.echo('Do you agree ? [y/n] ', nl=False)
c = click.getchar()
click.echo()
if c == b'y':
    click.echo('We will go on')
elif c == b'n':
    click.echo('Abort!')
    exit()
else:
    click.echo('Invalid input ! ')
    exit()
    
    
print("sylas")
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,837 Nov-30-2019, 04:42 PM
Last Post: mesbah
  Trying to run a python2 script dagamer1991 3 2,587 Aug-12-2019, 12:33 PM
Last Post: buran
  python2.7 executables thus the system python2.7 was erroring utility.execute()? vivekm 1 1,791 May-20-2019, 11:24 AM
Last Post: vivekm
  Python2 is not supported Skaperen 2 2,207 Mar-01-2019, 07:50 PM
Last Post: stranac
  Posting zip file on HTTP network using Python2.7 deepti92 1 6,828 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