Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-20 Thread Robin Becker
. so obviously I need to install some version of boost libs or Boost.Python etc etc. Gave up :( -luddite-ly yrs- Robin Becker The aur repository, no ? https://aur.archlinux.org/packages/python-exiv2/ Vincent that would work (if I had thought hard about it), but not for a pip instal

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-19 Thread Cameron Simpson
On 19Aug2020 08:53, Chris Green wrote: >I have quite a lot of things installed with pip, however I've never >had this problem with dependencies before. Adding to the fun is that >my system has still got Python 2 as the default Python so I have to >run pip3 explicitly to get P

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-19 Thread Vincent Vande Vyvre
Le 19/08/20 à 10:15, Robin Becker a écrit : > On 18/08/2020 20:05, Vincent Vande Vyvre wrote: > . >>> >> Hi, >> >> Two solutions: >> 1. Install exiv2-dev and py3exiv2 with pip >> $ sudo apt-get install libexiv2-dev >> $ sudo pip3 install py3exiv2 >> >> 2. Install my ppa >>    

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-19 Thread Chris Green
#x27;gcc' failed with exit status 1 > > so obviously I need to install some version of boost libs or Boost.Python > etc etc. Gave up :( > -luddite-ly yrs- OP here, yes, that's exactly where I got to as well! :-) I've used Vincent's PPA before so I took that route and it worked flawlessly, my code is now working again in 20.04 running Python 3. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-19 Thread Chris Green
rying to get it to work on Python 3 as I have just upgraded to > > Ubuntu 20.04 and on that Python 3 is now the default version of Python. > > > > I seem to be descending into a horrible morass of dependencies (or > > failed dependencies) when I try to install pyexiv2 (pr

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-19 Thread Robin Becker
On 18/08/2020 20:05, Vincent Vande Vyvre wrote: . Hi, Two solutions: 1. Install exiv2-dev and py3exiv2 with pip     $ sudo apt-get install libexiv2-dev     $ sudo pip3 install py3exiv2 2. Install my ppa     $ sudo add-apt-repository ppa:vincent-vandevyvre/vvv     $ sudo apt-ge

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-19 Thread Chris Green
> > I am trying to get it to work on Python 3 as I have just upgraded to > > Ubuntu 20.04 and on that Python 3 is now the default version of Python. > > > > I seem to be descending into a horrible morass of dependencies (or > > failed dependencies) when I try to install

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-18 Thread Vincent Vande Vyvre
Le 18/08/20 à 19:22, Chris Green a écrit : > I have a fairly simple Python program that I wrote a while ago in > Python 2 that transfers images from my camera to a date ordered > directory hierarchy on my computer. > > I am trying to get it to work on Python 3 as I have just upgra

Re: Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-18 Thread Chris Angelico
On Wed, Aug 19, 2020 at 3:36 AM Chris Green wrote: > > I have a fairly simple Python program that I wrote a while ago in > Python 2 that transfers images from my camera to a date ordered > directory hierarchy on my computer. > > I am trying to get it to work on Python 3 as I hav

Finding it very difficult to move pyexiv2 code from Python 2 to Python 3

2020-08-18 Thread Chris Green
I have a fairly simple Python program that I wrote a while ago in Python 2 that transfers images from my camera to a date ordered directory hierarchy on my computer. I am trying to get it to work on Python 3 as I have just upgraded to Ubuntu 20.04 and on that Python 3 is now the default version

Python 3 Feature Request: `pathlib` Use Trailing Slash Flag

2020-08-09 Thread Adam Hendry
`pathlib` trims trailing slashes by default, but certain packages require trailing slashes. In particular, `cx_Freeze.bdist_msi` option "directories" is used to build the package directory structure of a program and requires trailing slashes. Does anyone think it would be a good idea to add a f

Re: Escaping confusion with Python 3 + MySQL

2020-04-21 Thread moorthy . rs
On Sunday, March 26, 2017 at 7:55:09 PM UTC+5:30, Νίκος Βέργος wrote: > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε: > > > You need to change the placeholders back. The poster who told you to > > replace them was misinformed. > > okey altered them back to > > cur.execu

Re: How to read the original data line by line from stdin in python 3 just like python 2?

2020-01-28 Thread Greg Ewing
On 29/01/20 6:27 pm, Peng Yu wrote: Suppose that I use this to read from stdin. But `line` contains decoded data in python 3. In python 2, it contains the original data. What is the best way to get the original data in python 3? Read from stdin.buffer, which is a stream of bytes. -- Greg

How to read the original data line by line from stdin in python 3 just like python 2?

2020-01-28 Thread Peng Yu
Suppose that I use this to read from stdin. But `line` contains decoded data in python 3. In python 2, it contains the original data. What is the best way to get the original data in python 3? Thanks. ``` for line in sys.stdin: ... ``` -- Regards, Peng -- https://mail.python.org/mailman

posted via a python 3 script too yes

2020-01-13 Thread aa
2 3 torsocks python3 ./3usenet.py 4 5 10 lines 6 7 some random garbage ... x lines cant be empty 8 9 tenth line starting at 14 -- https://mail.python.org/mailman/listinfo/python-list

posted via a python 3 script too

2020-01-13 Thread aa
2 3 4 5 10 lines 6 7 some random garbage ... x lines cant be empty 8 9 tenth line starting at 14 -- https://mail.python.org/mailman/listinfo/python-list

Re: python 3 prefix to infix without too many parethesis

2019-12-09 Thread DL Neil via Python-list
On 10/12/19 8:40 AM, Terry Reedy wrote: On 12/9/2019 6:21 AM, jezka...@gmail.com wrote: Hi, I have got a problem. Is this homework? Same question - that way we know that our task is to help you learn to code in Python, cf a problem with Python itself... Similarly, you may like to know th

Re: python 3 prefix to infix without too many parethesis

2019-12-09 Thread Terry Reedy
On 12/9/2019 6:21 AM, jezka...@gmail.com wrote: Hi, I have got a problem. Is this homework? I wrote a code for prefix to infix. It works, but I need improve it so on input there will be only necessary parentheses. Define 'necessary'; give multiple input/output examples. Put them in a test f

python 3 prefix to infix without too many parethesis

2019-12-09 Thread jezkator
Hi, I have got a problem. I wrote a code for prefix to infix. It works, but I need improve it so on input there will be only necessary parentheses. Can u help me? Here is the code: import re a = input() class Calculator: def __init__ (self): self.stack = [] def push (self, p):

Tahoe-LAFS on Python 3 - Call for Porters

2019-09-24 Thread Jean-Paul Calderone
Hello Pythonistas, Earlier this year a number of Tahoe-LAFS <https://tahoe-lafs.org/trac/tahoe-lafs> community members began an effort to port Tahoe-LAFS from Python 2 to Python 3. Around five people are currently involved in a part-time capacity. We wish to accelerate the effort to en

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-16 Thread Chris Angelico
On Mon, Sep 16, 2019 at 4:38 AM Spencer Graves wrote: > >Is anyone interested in contacting these companies -- or the > companies from which they buy cybersecurity insurance -- and inviting > them to provide paid staff to maintain 2.7 and to offer further offer > consulting services to hel

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-15 Thread Peter J. Holzer
On 2019-09-14 08:10:50 -0500, Spencer Graves wrote: >   As I'm thinking about it, the companies that provide cybersecurity > insurance could be the best points of leverage for this, because they think > about these kinds of things all the time. Insurance companies for decades I wouldn't set my

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-15 Thread Spencer Graves
On 2019-09-14 07:30, Gene Heskett wrote: On Saturday 14 September 2019 04:37:14 Larry Martell wrote: On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro wrote: https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has -35-million-lines-of-python-code-and-wont-be-updated-to-python-3

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-14 Thread Gene Heskett
s-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in > >>-time/ > >> > >> I doubt this is unusual, and presume JP Morgan is big enough to > >> handle the change of status, either by managing security releases > >> in-house or relying on th

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-14 Thread Terry Reedy
On 9/14/2019 4:37 AM, Larry Martell wrote: On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro wrote: https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ I doubt this is unusual, and presume JP Morgan is big

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-14 Thread Gene Heskett
On Saturday 14 September 2019 04:37:14 Larry Martell wrote: > On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro > > > wrote: > > https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has > >-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-t >

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-14 Thread o1bigtenor
On Sat, Sep 14, 2019 at 3:39 AM Larry Martell wrote: > > On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro > wrote: > > > > > > https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-ti

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-14 Thread Larry Martell
On Fri, Sep 13, 2019 at 1:37 PM Skip Montanaro wrote: > > > https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ > > I doubt this is unusual, and presume JP Morgan is big enough to handle

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread tommy yama
"35 million lines of python code" it is insane. On Fri, Sep 13, 2019 at 9:39 PM Skip Montanaro wrote: > > > https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ > > I doubt this i

Re: TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread Skip Montanaro
> https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ I doubt this is unusual, and presume JP Morgan is big enough to handle the change of status, either by managing security releases in-house or relying

TechRepublicDEVELOPERCXO JPMorgan's Athena has 35 million lines of Python code, and won't be updated to Python 3 in time

2019-09-13 Thread Larry Martell
https://www.techrepublic.com/google-amp/article/jpmorgans-athena-has-35-million-lines-of-python-code-and-wont-be-updated-to-python-3-in-time/ -- https://mail.python.org/mailman/listinfo/python-list

Re: super() in Python 3

2019-07-17 Thread DL Neil
On 16/07/19 10:08 PM, אורי wrote: Hi, 1. When we use super() in Python 3, we don't pass it the first argument (self). Why? What happens if the first argument is not self? def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) I think it would make more sense t

Re: super() in Python 3

2019-07-16 Thread Rhodri James
[Rearranged and snipped so this makes any kind of sense] On 16/07/2019 16:43, אורי wrote: On Tue, Jul 16, 2019 at 3:13 PM Rhodri James wrote: On 16/07/2019 11:08, אורי wrote: 2. I want to override a function called build_suite in an inherited class. The function receives an argument "test_l

Re: super() in Python 3

2019-07-16 Thread אורי
lot of the answers to your questions are at least implied > in the Fine Manual > (https://docs.python.org/3/library/functions.html#super), but it's not > very clear and written more for precision than comprehension. Here's my > attempt at explaining :-) > > On 16/07/2019 1

Re: super() in Python 3

2019-07-16 Thread Rhodri James
אורי wrote: Hi, 1. When we use super() in Python 3, we don't pass it the first argument (self). Why? Actually the first argument to super() isn't self, it's the class that we want the superclass of. The *second* argument is self. In the normal course of using super() ins

super() in Python 3

2019-07-16 Thread אורי
Hi, 1. When we use super() in Python 3, we don't pass it the first argument (self). Why? What happens if the first argument is not self? def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) I think it would make more sense to use something like self.super().__init__(

Re: Implement C's Switch in Python 3

2019-03-15 Thread jfong
Sayth Renshaw at 2019/2/3 UTC+8 AM9:52:50 wrote: > Or perhaps use a 3rd party library like > https://github.com/mikeckennedy/python-switch Thank you for this link. It's a good general implementation. --Jach -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3 Boto Unable to parse pagination error

2019-02-27 Thread MRAB
On 2019-02-26 20:06, Tim Dunphy wrote: Hi all, I'm trying to create a python 3 script that takes a list of AWS instance IDs. It then prints out some information about the instances and then terminates them. I am very new to python, so still working through some basic issues. This is the

Python 3 Boto Unable to parse pagination error

2019-02-27 Thread Tim Dunphy
Hi all, I'm trying to create a python 3 script that takes a list of AWS instance IDs. It then prints out some information about the instances and then terminates them. I am very new to python, so still working through some basic issues. This is the error I get when I run the s

Zato blog post: A successful Python 3 migration story

2019-02-11 Thread Terry Reedy
The migration was from 2.7 to 2.7 and 3.x, rather than 3.x only. I think it worth reading for anyone interested in the subject. https://zato.io/blog/posts/python-3-migration-success-story.html 60,000 lines of Python and Cython, 130 external dependencies (but only 10 not already 3.x ready) took

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-07 Thread Christian Gollwitzer
Am 05.02.19 um 02:20 schrieb DL Neil: So, even with the French making their dates into sentences, not a single one uses ordinals! - did the computer people in all these languages/cultures decide that the more numeric approach was better/easier/... (ie simpler/less-complex) :) For the two lan

Re: Implement C's Switch in Python 3

2019-02-05 Thread MRAB
) in [0,4,5,6,7,8,9] or (day / 10) == 1: return 'th' return {1: 'st', 2: 'nd', 3: 'rd'}[day % 10] In Python 3, 11/10 == 1.1, not 1. -- https://mail.python.org/mailman/listinfo/python-list

Re: Implement C's Switch in Python 3

2019-02-05 Thread John Sanders
On Saturday, February 2, 2019 at 6:47:49 PM UTC-6, Sayth Renshaw wrote: > Hi > > I am trying to convert a switch statement from C into Python. (why? > practising). > > This is the C code. > > printf("Dated this %d", day); > switch (day) { > case 1: case 21: case 31: > printf("st"

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread DL Neil
On 4/02/19 9:25 PM, Christian Gollwitzer wrote: Am 04.02.19 um 09:18 schrieb Christian Gollwitzer: I think English is quite "unique" with writing out the ending of the ordinals attached to arabic numerals. Of course, there is a Wikipedia page about it: https://en.wikipedia.org/wiki/Ord

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread Christian Gollwitzer
Am 04.02.19 um 09:18 schrieb Christian Gollwitzer: I think English is quite "unique" with writing out the ending of the ordinals attached to arabic numerals. Of course, there is a Wikipedia page about it: https://en.wikipedia.org/wiki/Ordinal_indicator So I was wrong and the abbrevi

Re: Implement C's Switch in Python 3 [OT languages]

2019-02-04 Thread Christian Gollwitzer
Am 04.02.19 um 04:11 schrieb DL Neil: > On 4/02/19 10:00 AM, Christian Gollwitzer wrote: Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ..

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
Christian, On 4/02/19 10:00 AM, Christian Gollwitzer wrote: Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ... language! Only for some

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 10:53 AM Avi Gross wrote: > It is very bad form to have ambiguous compressed formats. Even if you include > a slash or minus sign or period or the delimiter of your choice, I sometimes > see this: > > 01/02/2020 > > And I wonder if it is meant to be January 2nd or February

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 11:08 AM Chris Angelico wrote: > If you need to attach some *other* time zone (which should be rare - > ONLY do this if you absolutely cannot translate to UTC) BTW, there are some legit reasons for keeping something in a different timezone. If you're representing an instant

RE: Implement C's Switch in Python 3

2019-02-03 Thread Avi Gross
Comment at end: -Original Message- From: Python-list On Behalf Of Bob van der Poel Sent: Sunday, February 3, 2019 4:01 PM To: DL Neil Cc: Python Subject: Re: Implement C's Switch in Python 3 I'm surprised that no one has yet addressed the year 1 problem. Hopefully w

Re: Implement C's Switch in Python 3

2019-02-03 Thread Bob van der Poel
On Sun, Feb 3, 2019 at 2:15 PM Chris Angelico wrote: > On Mon, Feb 4, 2019 at 8:02 AM Bob van der Poel wrote: > > > > I'm surprised that no one has yet addressed the year 1 problem. > Hopefully we're doing numeric, not alpha sorts on the stuff before the 1st > '-'. And, the compact versions

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 8:02 AM Bob van der Poel wrote: > > I'm surprised that no one has yet addressed the year 1 problem. Hopefully > we're doing numeric, not alpha sorts on the stuff before the 1st '-'. And, > the compact versions will really screw up :). > Compact versions? You mean non-

Re: Implement C's Switch in Python 3

2019-02-03 Thread Christian Gollwitzer
Am 03.02.19 um 09:32 schrieb DL Neil: Now back to ordinal dates - the "st", "th", etc suffixes only work in English. You'd need another list (but no great coding complexity) to cope with a second, third, ... language! Only for some languages. In other languages there can be, for example, case

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Mon, Feb 4, 2019 at 7:35 AM DL Neil wrote: > > On 3/02/19 10:16 PM, Chris Angelico wrote: > >> There's normal and there's normal - like it's tomato or tomato? > > I dunno. I'm the kind of normal that likes tomatoes (not to be > > confused with tomatoes). Does that help? > > If you like tomatoes

Re: Implement C's Switch in Python 3

2019-02-03 Thread Bob van der Poel
On Sun, Feb 3, 2019 at 1:35 PM DL Neil wrote: > On 3/02/19 10:16 PM, Chris Angelico wrote: > > On Sun, Feb 3, 2019 at 8:09 PM DL Neil > wrote: > >> On 3/02/19 9:45 PM, Chris Angelico wrote: > >>> Which is why I always write dates in sorted format, usually eschewing > >>> delimiters: > >>> //CJA

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
On 3/02/19 10:16 PM, Chris Angelico wrote: On Sun, Feb 3, 2019 at 8:09 PM DL Neil wrote: On 3/02/19 9:45 PM, Chris Angelico wrote: Which is why I always write dates in sorted format, usually eschewing delimiters: //CJA 20160511: Is this still happening? I don't remember seeing it in three part

RE: Implement C's Switch in Python 3

2019-02-03 Thread Avi Gross
The discussion strictly sets a limit of 31 for the largest number of days in a month and asks for suffixes used to make ordinal numbers like 31st. But in reality, you can go to 99th and beyond for other purposes albeit the pattern for making 101 and on seems to repeat. The last algorithm I wrote

Re: Implement C's Switch in Python 3

2019-02-03 Thread Frank Millman
"Sayth Renshaw" wrote in message news:73a1c64c-7fb1-4fc8-98a2-b6939e82a...@googlegroups.com... chooseFrom = { day : nthSuffix(day) for day in range(1,32)} chooseFrom {1: '1st', 2: '2nd', 3: '3rd', 4: '4th', 5: '5th', 6: '6th', 7: '7th', 8: '8th', 9: '9th', 10: '10th', 11: '11th', 12: '12th',

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Sun, Feb 3, 2019 at 8:09 PM DL Neil wrote: > > On 3/02/19 9:45 PM, Chris Angelico wrote: > > Which is why I always write dates in sorted format, usually eschewing > > delimiters: > > > > //CJA 20160511: Is this still happening? I don't remember seeing it in > > three parts of forever. > > Sure

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
Chris, On 3/02/19 9:45 PM, Chris Angelico wrote: On Sun, Feb 3, 2019 at 7:40 PM DL Neil wrote: This would normally see us coding "2019-02-03". The arrangement of larger to ever more precise time-units is very useful in databases and applications such as file-names, because it sequences logical

Re: Implement C's Switch in Python 3

2019-02-03 Thread Chris Angelico
On Sun, Feb 3, 2019 at 7:40 PM DL Neil wrote: > This would normally see us coding "2019-02-03". The arrangement of > larger to ever more precise time-units is very useful in databases and > applications such as file-names, because it sequences logically. > > However, that is not the way 'normal pe

Re: Implement C's Switch in Python 3

2019-02-03 Thread DL Neil
When a client demanded his way on this issue, the action we took was, as below, to create a list (called ordinal) and to use the dd (day) value as an index. [ nthSuffix(day) for day in range(1,32)] ['1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th'

Re: Implement C's Switch in Python 3

2019-02-03 Thread Stefan Behnel
Chris Angelico schrieb am 03.02.19 um 02:23: > Of course, you can also precompute this: > > day_ordinal = mapper( > [1, 21, 31], "st", > [2, 22], "nd", > [3, 23], "rd", > ) > def f(x): return day_ordinal.get(x, "th") … in which case I would also 'precompute' the ".get" and

Re: Implement C's Switch in Python 3

2019-02-02 Thread Sayth Renshaw
fix(day) for day in range(1,32)} > >>> chooseFrom > {1: '1st', 2: '2nd', 3: '3rd', 4: '4th', 5: '5th', 6: '6th', 7: '7th', 8: > '8th', 9: '9th', 10: '10th', 11: '11th', 12:

RE: Implement C's Switch in Python 3

2019-02-02 Thread Avi Gross
7;, 8: '8th', 9: '9th', 10: '10th', 11: '11th', 12: '12th', 13: '13th', 14: '14th', 15: '15th', 16: '16th', 17: '17th', 18: '18th', 19: '19th', 20: '20th', 21: '21st

Re: Implement C's Switch in Python 3

2019-02-02 Thread Igor Korot
t; 13rd > 14th > 15th > 16th > 17th > 18th > 19th > 20th > 21st > 22nd > 23rd > 24th > 25th > 26th > 27th > 28th > 29th > 30th > 31st > > -Original Message- > From: Python-list On > Behalf Of Sayth Renshaw > Sent: Saturday

Re: Implement C's Switch in Python 3

2019-02-02 Thread MRAB
On 2019-02-03 02:51, Avi Gross wrote: I may be missing something, but the focus seems to be only on the rightmost digit. You can get that with I had the same thought, but came across a problem. "11st", "12nd", "13rd"? [snip] Output: for day in range(1, 32): print( nthSuffix(day))

RE: Implement C's Switch in Python 3

2019-02-02 Thread Avi Gross
7th 18th 19th 20th 21st 22nd 23rd 24th 25th 26th 27th 28th 29th 30th 31st -Original Message- From: Python-list On Behalf Of Sayth Renshaw Sent: Saturday, February 2, 2019 8:53 PM To: python-list@python.org Subject: Re: Implement C's Switch in Python 3 > >I am trying to conver

Re: Implement C's Switch in Python 3

2019-02-02 Thread Skip Montanaro
Cameron wrote: > Skip has commented on lists being unhashable. We can elaborate on that > if you like. > > However, even if you went to tuples (which would let you construct the > dict you lay out above), there is another problem. > > You're looking up "x" in the dict. But the keys of the dict are

Re: Implement C's Switch in Python 3

2019-02-02 Thread Sayth Renshaw
> >I am trying to convert a switch statement from C into Python. (why? > >practising). > > > >This is the C code. > > > >printf("Dated this %d", day); > > switch (day) { > >case 1: case 21: case 31: > >printf("st"); break; > >case 2: case 22: > >printf("nd"); break; > >

Re: Implement C's Switch in Python 3

2019-02-02 Thread Cameron Simpson
On 02Feb2019 16:47, Sayth Renshaw wrote: I am trying to convert a switch statement from C into Python. (why? practising). This is the C code. printf("Dated this %d", day); switch (day) { case 1: case 21: case 31: printf("st"); break; case 2: case 22: printf("nd"); break;

Re: Implement C's Switch in Python 3

2019-02-02 Thread Chris Angelico
On Sun, Feb 3, 2019 at 11:51 AM Sayth Renshaw wrote: > > Hi > > I am trying to convert a switch statement from C into Python. (why? > practising). > > This is the C code. > > printf("Dated this %d", day); > switch (day) { > case 1: case 21: case 31: > printf("st"); break; > case

Re: Implement C's Switch in Python 3

2019-02-02 Thread Skip Montanaro
> > I have an unhashable type list. > Try replacing the list with a tuple. Also, read up on immutable v mutable types and dictionary keys for a bit of background on why a list won't work. Skip > -- https://mail.python.org/mailman/listinfo/python-list

Implement C's Switch in Python 3

2019-02-02 Thread Sayth Renshaw
Hi I am trying to convert a switch statement from C into Python. (why? practising). This is the C code. printf("Dated this %d", day); switch (day) { case 1: case 21: case 31: printf("st"); break; case 2: case 22: printf("nd"); break; case 3: case 23: printf

Re: Unable to install Python 3

2019-01-27 Thread Shakti Kumar
On Sun, 27 Jan 2019 at 18:44, Hemant Mehta wrote: > > Dear Team, > > I am unable to install python 3 in my computer. > Kindly find my system configuration details & error details occured at the time of installation. Unable to find the system configuration details & erro

Unable to install Python 3

2019-01-27 Thread Hemant Mehta
Dear Team, I am unable to install python 3 in my computer. Kindly find my system configuration details & error details occured at the time of installation. Please do the needful on priority. Regards, Hemant Mehta -- https://mail.python.org/mailman/listinfo/python-list

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-27 Thread sjmsoft
After chickening out a couple of times over the past few years, about eight months ago we migrated our small code base from 2.7.14 to 3.6.5. Some notes: On 2.7 we spent a couple of years coding with 3.x in mind, using import from __future__ and coding to Python 3 standards wherever possible

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-24 Thread Tim Chase
On 2019-01-22 19:20, Grant Edwards wrote: > > For anyone who has moved a substantial bunch of Python 2 to Python > > 3, can you please reply with your experience? > > If you used bytes (or raw binary strings) at all (e.g. for doing > things like network or serial protocols

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-24 Thread Pete Forman
Robin Becker writes: > On 22/01/2019 19:00, Schachner, Joseph wrote: > .. >> For anyone who has moved a substantial bunch of Python 2 to Python 3, >> can you please reply with your experience? Did you run into any >> issues? Did 2to3 do its job well, or di

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-24 Thread Robin Becker
On 23/01/2019 21:51, Ian Kelly wrote: On Wed, Jan 23, 2019 at 1:36 PM Stefan Behnel wrote: . All right, but apart from absolute imports, the print function, and true division, what has Python 3.x ever done for us? *ducks* headaches :) -- Robin Becker -- https://mail.python.org

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-24 Thread Robin Becker
On 22/01/2019 19:00, Schachner, Joseph wrote: .. For anyone who has moved a substantial bunch of Python 2 to Python 3, can you please reply with your experience? Did you run into any issues? Did 2to3 do its job well, or did you have to review its output to eliminate some working

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-23 Thread Ian Kelly
, the print function, and true division, what has Python 3.x ever done for us? *ducks* -- https://mail.python.org/mailman/listinfo/python-list

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-23 Thread Stefan Behnel
Cameron Simpson schrieb am 23.01.19 um 00:21: >  from __future__ import absolute_imports, print_function > > gets you a long way. ... and: division. Stefan -- https://mail.python.org/mailman/listinfo/python-list

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-23 Thread Cameron Simpson
On 23Jan2019 14:15, Grant Edwards wrote: On 2019-01-22, Cameron Simpson wrote: On 22Jan2019 19:20, Grant Edwards wrote: On 2019-01-22, Schachner, Joseph wrote: For anyone who has moved a substantial bunch of Python 2 to Python 3, can you please reply with your experience? If you used

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-23 Thread Grant Edwards
On 2019-01-22, Cameron Simpson wrote: > On 22Jan2019 19:20, Grant Edwards wrote: >>On 2019-01-22, Schachner, Joseph wrote: >>> For anyone who has moved a substantial bunch of Python 2 to Python >>> 3, can you please reply with your experience? >> >>If yo

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Chris Angelico
On Wed, Jan 23, 2019 at 6:10 PM dieter wrote: > > Did 2to3 do its job well > > I have not used "2to3" -- because I doubt, that it can handle > important cases, i.e. when a Python 2 "str" must become a Python 3 bytes > or when a "dict.{keys, values, ite

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread dieter
"Schachner, Joseph" writes: > ... > For anyone who has moved a substantial bunch of Python 2 to Python 3, can > you please reply with your experience? It can be simple and it can be difficult. I have found "http://python-future.org/compatible_idioms.html"; espe

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Cameron Simpson
On 22Jan2019 19:20, Grant Edwards wrote: On 2019-01-22, Schachner, Joseph wrote: For anyone who has moved a substantial bunch of Python 2 to Python 3, can you please reply with your experience? If you used bytes (or raw binary strings) at all (e.g. for doing things like network or serial

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Chris Angelico
On Wed, Jan 23, 2019 at 9:43 AM Akkana Peck wrote: > > Grant Edwards writes: > > On 2019-01-22, Schachner, Joseph wrote: > > > > > For anyone who has moved a substantial bunch of Python 2 to Python > > > 3, can you please reply with your experience? >

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Akkana Peck
Grant Edwards writes: > On 2019-01-22, Schachner, Joseph wrote: > > > For anyone who has moved a substantial bunch of Python 2 to Python > > 3, can you please reply with your experience? > > If you used bytes (or raw binary strings) at all (e.g. for doing > th

Re: What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Grant Edwards
On 2019-01-22, Schachner, Joseph wrote: > For anyone who has moved a substantial bunch of Python 2 to Python > 3, can you please reply with your experience? If you used bytes (or raw binary strings) at all (e.g. for doing things like network or serial protocols) you're in for a

What is your experience porting Python 2.7.x scripts to Python 3.x?

2019-01-22 Thread Schachner, Joseph
... I've told my manager that we need to change from Python 2.7.13 (the last version to which I updated it) to Python 3.x, whatever the latest is, sometime this year and to get that on our roadmap. I should mention that updating from earlier 2.x versions through 2.7.13 has not caused any erro

Re: What's needed for jpegtran in Python 3?

2018-09-28 Thread Chris Green
roject/jpegtran-cffi/ > > > > > > I can't find anything called just "jpegtran" for either Py2 or Py3, > > > but that one claims to work on 3.3+ as well as 2.6 and 2.7. > > > > > I think that must be what I have already installed, it doesn&#x

Re: What's needed for jpegtran in Python 3?

2018-09-27 Thread John Ladasky
On Thursday, September 27, 2018 at 10:48:16 AM UTC-7, Chris Green wrote: > I think that must be what I have already installed, it doesn't make > the module available in Python 3, it just says this when I try and > install it:- > > root@t470:~# pip install jpegtran-cf

Re: What's needed for jpegtran in Python 3?

2018-09-27 Thread Chris Angelico
an" for either Py2 or Py3, > > but that one claims to work on 3.3+ as well as 2.6 and 2.7. > > > I think that must be what I have already installed, it doesn't make > the module available in Python 3, it just says this when I try and > install it:- > > r

Re: What's needed for jpegtran in Python 3?

2018-09-27 Thread Chris Green
need to install in Python3? > > > > Do you mean this? > > https://pypi.org/project/jpegtran-cffi/ > > I can't find anything called just "jpegtran" for either Py2 or Py3, > but that one claims to work on 3.3+ as well as 2.6 and 2.7. > I think that must be

Re: What's needed for jpegtran in Python 3?

2018-09-27 Thread Chris Angelico
On Fri, Sep 28, 2018 at 2:51 AM Chris Green wrote: > > I'm converting an existing Python2 program to Python3, it uses > jpegtran and I can't find what to install to get this in Python3. > > Can anyone advise what I need to install in Python3? > Do you mean this? https://pypi.org/project/jpegtran

What's needed for jpegtran in Python 3?

2018-09-27 Thread Chris Green
I'm converting an existing Python2 program to Python3, it uses jpegtran and I can't find what to install to get this in Python3. Can anyone advise what I need to install in Python3? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: 2 Bugs: in Python 3 tutorial, and in bugs.python.org tracker registration system

2018-09-22 Thread Peter Otten
Brian Oney via Python-list wrote: > That's one thing that confused me. Generators are supposed to be one-off > iterators. Iterators, *I understood* as reusable iterables. The way I think about it, informally: iterables need and __iter__ method, iterators need a __next__ method. In practice all

Re: 2 Bugs: in Python 3 tutorial, and in bugs.python.org tracker registration system

2018-09-22 Thread Cameron Simpson
On 22Sep2018 12:08, Brian Oney wrote: That's one thing that confused me. Generators are supposed to be one-off iterators. Iterators, *I understood* as reusable iterables. You've misread the grammar (the semantics). Iterators are one off - they're something that counts (for want of a better w

<    1   2   3   4   5   6   7   8   9   10   >