EuroPython 2019: Venue and location selected
After a very work intense RFP with more than 40 venues competing, 17 entries, and two rounds of refinements, we are now happy to announce the winner: EuroPython 2019 will be held in Basel, Switzerland, from July 8 - 14 2019 We will now start work on the contracts and get the organization going, so that we can all enjoy another edition of EuroPython next year. Help spread the word Please help us spread this message by sharing it on your social networks as widely as possible. Thank you ! Link to the blog post: https://www.europython-society.org/post/180894308215/europython-2019-venue-and-location-selected Tweet: https://twitter.com/europythons/status/1071082681000185857 Thank you, -- EuroPython Society https://www.europython-society.org/ -- https://mail.python.org/mailman/listinfo/python-list
Re: tkinter resizable text with grid
Às 07:11 de 07/12/18, Christian Gollwitzer escreveu: > Am 07.12.18 um 03:00 schrieb Paulo da Silva: >> Às 21:15 de 06/12/18, Rick Johnson escreveu: ... > So instead of complaining about lacking support in Tk, the > Python community should do their homework and provide wrappers to the > most common Tk extensions. > That was what I did. When I referred tk was in the context of python. I left tcl/tk long time ago and by that time the problems were the same as tkinter's today, not to mention the angels sex discussions/wars about which oop paradigm to use or if use any at all :-) Regards -- https://mail.python.org/mailman/listinfo/python-list
Focusing on the simple things, KISS, what to use for testing
Hi there. I blogged a bit today, about my surveil project and activity on this mailing list: """ This morning the internet became unavailable, after also being unavailable this weekend for several days. So I decided to take a look at my demo board which does surveillance with a webcam using the surveil app, surveil is here: https://github.com/morphex/surveil Well, one thing lead to another (...), and I locked myself out of the demo board. """ The rest of the blog post is here: http://blogologue.com/blog_entry?id=1544190747X52 Well, I was wondering what framework to use for testing. I see functional/integration testing as the most useful and powerful thing I can do, but it is also nice to be able to do unit-testing, and not end up using different frameworks. I'm thinking functional testing on the command, through URLs, and through SMTP/IMAP/POP etc. I have this old blog software/content management system called the Issue Dealer, which still runs on Python 2.7 and Zope 2, so it would be nice to have a testing system which runs on both Python 2 and 3. This Issue Dealer system is something I might end up ditching, but I guess it doesn't hurt with some forward thinking with what I choose from now on. Regards, Morten -- Videos at https://www.youtube.com/user/TheBlogologue Twittering at http://twitter.com/blogologue Blogging at http://blogologue.com Playing music at https://soundcloud.com/morten-w-petersen Also playing music and podcasting here: http://www.mixcloud.com/morten-w-petersen/ On Google+ here https://plus.google.com/107781930037068750156 On Instagram at https://instagram.com/morphexx/ -- https://mail.python.org/mailman/listinfo/python-list
Why Python don't accept 03 as a number?
>>> 00 0 >>> 03 File "", line 1 03 ^ SyntaxError: invalid token >>> Any particular reason? -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
Às 01:17 de 08/12/18, jf...@ms4.hinet.net escreveu: 00 > 0 03 > File "", line 1 > 03 > ^ > SyntaxError: invalid token > > Any particular reason? > Not sure but I think that after 0 it expects x for hexadecimal, o for octal, b for binary, ... may be others. 0xa 10 0o10 8 0b10 2 -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
On 2018-12-08 01:17, jf...@ms4.hinet.net wrote: 00 0 03 File "", line 1 03 ^ SyntaxError: invalid token Any particular reason? Before Python 3, a leading 0 in an integer literal would indicate an octal (base 8) number. In Python 2.7: >>> 010 8 That notation was borrowed from C. The hexadecimal (base 16) notation of a leading 0x was also borrowed from C (it was a later introduction to the language). Python also has the binary (base 2) notation of a leading 0b. For Python 3, it was felt that it would be clearer to have an octal notation that didn't use just a leading 0, so it was changed to a leading 0o. The old form is now invalid in order to reduce the chance of bugs. If you're coming from Python 2, you might expect that 010 is still octal, and if you're not familiar with that notation, you might expect that it's decimal. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: > Before Python 3, a leading 0 in an integer literal would indicate an > octal (base 8) number. So, the reason is historical. > The old form is now invalid in order to reduce the chance of bugs. I encounter this problem on trying to do something like this: eval('03 + 00 + 15') It takes me some efforts to get rid of those leading zeros:-( Hope someday 03 can be accepted as a valid decimal number in Python 3. Thank you for explaining. --Jach -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
On Sat, Dec 8, 2018 at 1:46 PM wrote: > > MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: > > Before Python 3, a leading 0 in an integer literal would indicate an > > octal (base 8) number. > > So, the reason is historical. > > > The old form is now invalid in order to reduce the chance of bugs. > > I encounter this problem on trying to do something like this: > eval('03 + 00 + 15') > It takes me some efforts to get rid of those leading zeros:-( > > Hope someday 03 can be accepted as a valid decimal number in Python 3. > Definitely not. What happens to all the code that used to be legal and meant octal, and would become legal again but with a different meaning? It'd be bad enough to have Python interpret something in a way that's subtly different from the way other languages do (annoying, but livable), but to do that across versions of the language would be an incredibly bad idea. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
On Fri, Dec 7, 2018 at 7:47 PM wrote: > > MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: > > Before Python 3, a leading 0 in an integer literal would indicate an > > octal (base 8) number. > > So, the reason is historical. > > > The old form is now invalid in order to reduce the chance of bugs. > > I encounter this problem on trying to do something like this: > eval('03 + 00 + 15') > It takes me some efforts to get rid of those leading zeros:-( What is it exactly that you're trying to accomplish with this? Perhaps there's a better way than using eval. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
jf...@ms4.hinet.net writes: > MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: >> Before Python 3, a leading 0 in an integer literal would indicate an >> octal (base 8) number. > > So, the reason is historical. > >> The old form is now invalid in order to reduce the chance of bugs. > > I encounter this problem on trying to do something like this: > eval('03 + 00 + 15') > It takes me some efforts to get rid of those leading zeros:-( > > Hope someday 03 can be accepted as a valid decimal number in Python 3. > > Thank you for explaining. > > --Jach I'd say we *really* don't want that. We'd have old C programmers (like me) expecting 010 to mean 8, and getting really confused... -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
On 2018-12-08 03:49, Joe Pfeiffer wrote: jf...@ms4.hinet.net writes: MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: Before Python 3, a leading 0 in an integer literal would indicate an octal (base 8) number. So, the reason is historical. The old form is now invalid in order to reduce the chance of bugs. I encounter this problem on trying to do something like this: eval('03 + 00 + 15') It takes me some efforts to get rid of those leading zeros:-( Hope someday 03 can be accepted as a valid decimal number in Python 3. Thank you for explaining. --Jach I'd say we *really* don't want that. We'd have old C programmers (like me) expecting 010 to mean 8, and getting really confused... We could just wait until all the old C programmers have died. :-) -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: > What is it exactly that you're trying to accomplish with this? Perhaps > there's a better way than using eval. This problem comes from solving a word puzzle, ab + aa + cd == ce Each character will be translate to a digit and evaluate the correctness, 03 + 00 + 15 == 18 -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
I can understand the difficulty of throwing old thing away and accept new one in human. There seems have a huge inertia there. This phenomenon appears on every aspects, not only on the transition from Python2 to Python3. But, as a new comer of Python like me, I have no difficulty to accept it because of 03 is a valid number in my daily life and never had the experience of treating 010 as 8:-) MBAB wrote: > We could just wait until all the old C programmers have died. :-) Yes, it's the nature way. -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
On 07Dec2018 20:24, Jach Fong wrote: Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: What is it exactly that you're trying to accomplish with this? Perhaps there's a better way than using eval. This problem comes from solving a word puzzle, ab + aa + cd == ce Each character will be translate to a digit and evaluate the correctness, 03 + 00 + 15 == 18 Then you should be evaluating the digits and assembling values from them. Not trying to shoehorn a string through something that _might_ accept this string and do what you want. In Python 2 it will accept your string and not do what you want; at least in Python 3 it doesn't accept your string. My point here is that the structure of your puzzle doesn't map directly into a naive python statement, and you shouldn't be pretending it might. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list
RE: Why Python don't accept 03 as a number?
[[READERS DIGEST CONDENSED ANSWER: use int("string") ]] Since we all agree python will not make notations like "05" work indefinitely, and the need expressed is how to solve a symbolic puzzle (see message below) then it makes sense to look at alternate representations. I have a question first. How are you solving your puzzles? ab + aa + cd == ce Why does 05 ever even appear in your solution? Are you generating all possible answers by setting each variable to one of 0 to 9 then the second to any of the remaining nine choices then the third to the remaining 8 and so on? For any method like that, you can presumably make each component like ab = 10*a + b in the loop. Similarly for aa and cd and ce. If the equality above is true, you found the solution and break out. If there can be multiple solutions, note the solution and keep going. But note for the 5 variables above, you are testing 10*9*8*7*6 combinations. Another idea is to use strings like "05" as bizarrely, the function int() seems to be an ex eption that does NOT care about leading whitespace or zeroes: >>> int("05") 5 >>> int(" 0005") 5 And even handles all zeroes: >>> int("00") 0 You can also use lstrip() with an argument to remove zeros: >>> a = eval("05".lstrip("0")) >>> a 5 If you are in a situation where you only want to remove leading zeroes if the following character is a digit and not "o" or "b" or "x", use regular expressions or other techniques. I will just toss in the possible use of the SymPy module to do actual symbolic computations to solve some of these. Perhaps a tad advanced. -Original Message- From: Python-list On Behalf Of jf...@ms4.hinet.net Sent: Friday, December 7, 2018 11:25 PM To: python-list@python.org Subject: Re: Why Python don't accept 03 as a number? Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: > What is it exactly that you're trying to accomplish with this? Perhaps > there's a better way than using eval. This problem comes from solving a word puzzle, ab + aa + cd == ce Each character will be translate to a digit and evaluate the correctness, 03 + 00 + 15 == 18 -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
A comment from the sideline: one could imagine extending the Python syntax with a (optional) 0d prefix that allows for explicit specification of decimal values. They would "complete" the family: * 0b: binary number * 0o: octal number * 0d: decimal number * 0x: hexadecimal number I understand that changing the syntax/parser is a major move. I wouldn't be surprised if others brought up 0d before. My $.02 Henrik On Fri, Dec 7, 2018, 21:12 Cameron Simpson On 07Dec2018 20:24, Jach Fong wrote: > >Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: > >> What is it exactly that you're trying to accomplish with this? Perhaps > >> there's a better way than using eval. > > > >This problem comes from solving a word puzzle, > >ab + aa + cd == ce > >Each character will be translate to a digit and evaluate the correctness, > >03 + 00 + 15 == 18 > > Then you should be evaluating the digits and assembling values from > them. Not trying to shoehorn a string through something that _might_ > accept this string and do what you want. In Python 2 it will accept your > string and not do what you want; at least in Python 3 it doesn't accept > your string. > > My point here is that the structure of your puzzle doesn't map directly > into a naive python statement, and you shouldn't be pretending it might. > > Cheers, > Cameron Simpson > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Why Python don't accept 03 as a number?
08.12.18 03:17, jf...@ms4.hinet.net пише: 00 0 03 File "", line 1 03 ^ SyntaxError: invalid token In Python 3.8 the error message will be more informative: 03 File "", line 1 SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers -- https://mail.python.org/mailman/listinfo/python-list