Re: Retrieve item deep in dict tree?

2014-04-03 Thread Ian Kelly
On Wed, Apr 2, 2014 at 10:15 PM, Rustom Mody wrote: > On Thursday, April 3, 2014 8:11:33 AM UTC+5:30, Rustom Mody wrote: >> On Wednesday, April 2, 2014 11:28:16 PM UTC+5:30, Roy Smith wrote: >> > I have a big hairy data structure which is a tree of nested dicts. I have >> > a sequence of strings

Re: Unicode Chars in Windows Path

2014-04-03 Thread alister
On Wed, 02 Apr 2014 16:27:04 -0700, Steve wrote: > Hi All, > > I'm in need of some encoding/decoding help for a situation for a Windows > Path that contains Unicode characters in it. > > CODE > > import os.path import codecs import sys > > All_Tests = > [u"c:\automation_common\Python

Re: Unicode Chars in Windows Path

2014-04-03 Thread Marko Rauhamaa
Chris Angelico : > Small clarification: The Windows *API* accepts both types of slash > (you can open a file using forward slashes, for instance), but not all > Windows *applications* are aware of this (generally only > cross-platform ones take notice of this), and most Windows *users* > prefer ba

Compact way to assign values by slicing list in Python

2014-04-03 Thread Mark Lawrence
Came across this http://stackoverflow.com/questions/22756632/compact-way-to-assign-values-by-slicing-list-in-python?newsletter=1&nlcode=245176|202f - just curious what you guys and gals thought of the answers. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can

Gauteng Usergroup Meeting

2014-04-03 Thread Frank Millman
A meeting of python users in Gauteng, South Africa has been arranged for Saturday 12th April. Full discussion and details can be found here - https://groups.google.com/forum/#!topic/gpugsa/qZEy-ptVxac I was not aware of this group until recently, even though I live in Gauteng, so I thought I w

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Terry Reedy
On 4/1/2014 5:26 PM, Mark H Harris wrote: I didn't really start using unicode until about 5 years ago; python has only really used it since python3. right? If you narrowly meant "The python interpreter only starting using unicode as the default text class in 3.0", then you are, in that narro

Re: Examples of modern GUI python programms

2014-04-03 Thread Sturla Molden
Wolfgang Keller wrote: >> Id like to ask.. do you know any modern looking GUI examples of > Judging from the example screenshots on their website, Kivy might be > adequate. If you want to build something from scratch, libSDL is excellent and free (zlib license). Official supported platforms are:

Test post via gmane.

2014-04-03 Thread Terry Reedy
Gmane has stopped receiving mail from the lists it mirrors at about 0:30 apr 2 (utc, I presume). I want to see what happens if I send to the list via gmane. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Calculating time differences given daylight savings time

2014-04-03 Thread Chris “Kwpolska” Warrick
On Thu, Apr 3, 2014 at 3:45 AM, Washington Ratso wrote: > I am running Python 2.7 and would like to be able to calculate to the second > the time difference between now and some future date/time in the same > timezone while taking into account daylight savings time. I do not have > pytz. Any

Re: Examples of modern GUI python programms

2014-04-03 Thread Sturla Molden
Wolfgang Keller wrote: > Judging from the example screenshots on their website, Kivy might be > adequate. Kivy depends on PyGame which is GPL, and can only be used to build GPL software. -- https://mail.python.org/mailman/listinfo/python-list

Re: Test post via gmane.

2014-04-03 Thread Chris Angelico
On Thu, Apr 3, 2014 at 10:39 AM, Terry Reedy wrote: > Gmane has stopped receiving mail from the lists it mirrors at about 0:30 apr > 2 (utc, I presume). I want to see what happens if I send to the list via > gmane. Looks like Gmane has started transmitting after fourteen hours (at least, that's w

Re: Compact way to assign values by slicing list in Python

2014-04-03 Thread Marco Buttu
On 04/02/2014 01:17 AM, Mark Lawrence wrote: Came across this http://stackoverflow.com/questions/22756632/compact-way-to-assign-values-by-slicing-list-in-python?newsletter=1&nlcode=245176|202f - just curious what you guys and gals thought of the answers. I prefere this one: bar = ['a','b','c',

Re: Unicode Chars in Windows Path

2014-04-03 Thread random832
On Thu, Apr 3, 2014, at 5:00, Marko Rauhamaa wrote: > In fact, proper dealing with punctuation in pathnames is one of the main > reasons to migrate to Python from bash. Even if it is often possible to > write bash scripts that handle arbitrary pathnames correctly, few script > writers are pedantic

Re: python nose unit test - test plan preparation

2014-04-03 Thread Mark Lawrence
On 03/04/2014 03:02, Rustom Mody wrote: On Wednesday, April 2, 2014 6:52:04 PM UTC+5:30, Hareesha Karunakar wrote: Hello Group, I am using python's nose testing frame work for my automated testing. I would like to run my python cases and generate only the documentation without actually running/

Re: Examples of modern GUI python programms

2014-04-03 Thread Robert Kern
On 2014-04-02 12:52, Sturla Molden wrote: Wolfgang Keller wrote: Judging from the example screenshots on their website, Kivy might be adequate. Kivy depends on PyGame which is GPL, and can only be used to build GPL software. It is not. http://www.pygame.org/LGPL -- Robert Kern "I have c

Re: Examples of modern GUI python programms

2014-04-03 Thread Fabio Zadrozny
On Wed, Apr 2, 2014 at 8:52 AM, Sturla Molden wrote: > Wolfgang Keller wrote: > > > Judging from the example screenshots on their website, Kivy might be > > adequate. > > Kivy depends on PyGame which is GPL, and can only be used to build GPL > software. Actually, PyGame is LGPL: http://www.pyga

Re: Unicode Chars in Windows Path

2014-04-03 Thread Peter Otten
Marko Rauhamaa wrote: > Chris Angelico : > >> Small clarification: The Windows *API* accepts both types of slash >> (you can open a file using forward slashes, for instance), but not all >> Windows *applications* are aware of this (generally only >> cross-platform ones take notice of this), and m

Re: Unicode Chars in Windows Path

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 12:57 AM, wrote: > An argument [in a position where a list of filenames is expected] with * > or ? in it _always_ gets globbed, so "C:\dir with spaces\*.txt" can be > used. This is part of the reason the program is responsible for globbing > rather than the shell - because

Re: Examples of modern GUI python programms

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 1:00 AM, Fabio Zadrozny wrote: > Actually, PyGame is LGPL: http://www.pygame.org/LGPL (it's also what their > source files say, although I noted that in their homepage the link which > points to http://www.pygame.org/LGPL *wrongly* says GPL when the actual link > goes to LGP

Re: Examples of modern GUI python programms

2014-04-03 Thread Sturla Molden
On 03/04/14 16:02, Robert Kern wrote: Kivy depends on PyGame which is GPL, and can only be used to build GPL software. It is not. http://www.pygame.org/LGPL Their web paged says GPL, but I assume that is an error. Is Python allowed on iOS anyway? Apple used to ban any code not written in

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Lucas Malor
Thank you for reading and commenting my proposal. Here are my replies: In reply to Chris Angelico: > I don't like the "iterable vs non-iterable" distinction. Compare: [...] > case "Test": # And there's your problem. Yes, I had already thought after I posted that testing against string it's a pr

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Mark H Harris
On 4/1/14 5:33 PM, Terry Reedy wrote: hi Terry, hope you are well today, despite gmane difficulties; If you narrowly meant "The python interpreter only starting using unicode as the default text class in 3.0", then you are, in that narrow sense, correct. Yes. When I speak of 'python' I

Two Questions about Python on Windows

2014-04-03 Thread Walter Hurry
Normally my Python development is done on FreeBSD and Linux. I know that on *ix I simply have to make foo.py executable (the shebang line is present, of course) to make it runnable. For my son's school assignment, I have to help him with Python for Windows. As I understand it, on Windows a .py

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Marko Rauhamaa
Mark H Harris : > So, python(3)'s use of unicode is exciting, not only as a step forward > for the python interpreter, but also as a leadership step forward in > computer science around the world. Big words. I don't think computer science has experienced major steps forward since the 1930's: comb

Re: Two Questions about Python on Windows

2014-04-03 Thread maxerickson
On Thursday, April 3, 2014 1:06:29 PM UTC-4, Walter Hurry wrote: > Normally my Python development is done on FreeBSD and Linux. I know that on > *ix I simply have to make foo.py executable (the shebang line is present, of > course) to make it runnable. > > For my son's school assignment, I have

Re:Retrieve item deep in dict tree?

2014-04-03 Thread Yimr Zero
Here is a tricky method : reduce(lambda x,y:x[str(y)],keys,tree) -- Forwarded message -- From: Roy Smith To: Python List Cc: Date: Wed, 2 Apr 2014 13:58:16 -0400 Subject: Retrieve item deep in dict tree? I have a big hairy data structure which is a tree of nested dicts. I hav

Re: Two Questions about Python on Windows

2014-04-03 Thread Ian Kelly
On Apr 3, 2014 11:12 AM, "Walter Hurry" wrote: > > Normally my Python development is done on FreeBSD and Linux. I know that on *ix I simply have to make foo.py executable (the shebang line is present, of course) to make it runnable. > > For my son's school assignment, I have to help him with Pytho

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ian Kelly
On Thu, Apr 3, 2014 at 10:02 AM, Lucas Malor <3kywjyd...@snkmail.com> wrote: >> __contains__ is not part of the interface for iterables > > For what I know there's not an Iterable interface. For example List simply > extends Object. I hope that an ABC Iterable class will be introduced in a > futu

Re: Test post via gmane.

2014-04-03 Thread Terry Reedy
On 4/3/2014 9:48 AM, Chris Angelico wrote: On Thu, Apr 3, 2014 at 10:39 AM, Terry Reedy wrote: Gmane has stopped receiving mail from the lists it mirrors at about 0:30 apr 2 (utc, I presume). I want to see what happens if I send to the list via gmane. Looks like Gmane has started transmitting

Re: Two Questions about Python on Windows

2014-04-03 Thread Terry Reedy
On 4/3/2014 1:06 PM, Walter Hurry wrote: Normally my Python development is done on FreeBSD and Linux. I know that on *ix I simply have to make foo.py executable (the shebang line is present, of course) to make it runnable. For my son's school assignment, I have to help him with Python for Wind

Re: Unicode Chars in Windows Path

2014-04-03 Thread Terry Reedy
On 4/2/2014 11:10 PM, Chris Angelico wrote: On Thu, Apr 3, 2014 at 1:37 PM, Steven D'Aprano wrote: Windows accepts both forward and backslashes in file names. Small clarification: The Windows *API* accepts both types of slash To me, that is what Steven said. (you can open a file using for

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Rustom Mody
On Thursday, April 3, 2014 10:44:16 PM UTC+5:30, Marko Rauhamaa wrote: > Mark H Harris: > > So, python(3)'s use of unicode is exciting, not only as a step forward > > for the python interpreter, but also as a leadership step forward in > > computer science around the world. > Big words. I don't t

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ethan Furman
On 04/03/2014 09:02 AM, Lucas Malor wrote: In reply to Ian Kelly: Instead of disabling fallthrough by default, why not disable it all together? I was tempted but there are cases in which it's useful. An example switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"):

Default mutable parameters in functions

2014-04-03 Thread fbicknel
Hi all, So I was reading about default values for functions and spied this: Important warning: The default value is evaluated only once. This makes a difference when the default is a mutable object such as a list, dictionary, or instances of most classes. That's ok - guess I can get used to t

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Mark H Harris
On 4/3/14 12:14 PM, Marko Rauhamaa wrote: Mark H Harris : So, python(3)'s use of unicode is exciting, not only as a step forward for the python interpreter, but also as a leadership step forward in computer science around the world. Big words. I don't think computer science has experienced ma

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Terry Reedy
On 4/3/2014 12:02 PM, Lucas Malor wrote: A more suitable place to propose this would be the python-ideas mailing list. You're right. I posted here because this list was linked by PEP 1. But now that I read more there's also python-ideas listed. Let me know if I have to continue there instead

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Marko Rauhamaa
Mark H Harris : > computer science covers everything from a linked list to virtual > reality, from cpu pipe lining to flash memory, from punched tape i/o > to plasma displays--- to led back-lit flat panels. From the point of view of computer science, those barely register. We have had a revolutio

Re: Two Questions about Python on Windows

2014-04-03 Thread Ethan Furman
On 04/03/2014 10:54 AM, Ian Kelly wrote: On Apr 3, 2014 11:12 AM, "Walter Hurry" wrote: Secondly, on *ix, if there's an up-to-date .pyc in the right place and I run foo.py, Python will automagically use foo.pyc. I don't believe this is exactly correct. Python will only use a .pyc automatica

Re: Two Questions about Python on Windows

2014-04-03 Thread Mark Lawrence
On 03/04/2014 18:54, Ian Kelly wrote: On Apr 3, 2014 11:12 AM, "Walter Hurry" mailto:walterhu...@gmail.com>> wrote: > > Normally my Python development is done on FreeBSD and Linux. I know that on *ix I simply have to make foo.py executable (the shebang line is present, of course) to make it ru

Re: Test post via gmane.

2014-04-03 Thread Dave Angel
Terry Reedy Wrote in message: > On 4/3/2014 9:48 AM, Chris Angelico wrote: >> On Thu, Apr 3, 2014 at 10:39 AM, Terry Reedy wrote: >>> Gmane has stopped receiving mail from the lists it mirrors at about 0:30 apr >>> 2 (utc, I presume). I want to see what happens if I send to the list via >>> gmane

Re: Default mutable parameters in functions

2014-04-03 Thread Ian Kelly
On Thu, Apr 3, 2014 at 12:49 PM, wrote: > Now call it with a value: > foo([ 3 ]) > > as you might expect: > It's a parrot, not a cheese: [3] > > But now go back to no parameter in the call: > foo() > foo() > foo() > > It's a parrot, not a cheese: [46] > It's a parrot, not a cheese: [47] > It's a

Re: Default mutable parameters in functions

2014-04-03 Thread Ethan Furman
On 04/03/2014 11:49 AM, fbick...@gmail.com wrote: I put this into pythontutor.com's code visualization tool (http://goo.gl/XOmMjR) and it makes more sense what's going on. I thought this was interesting; thought I would share. That visualization tool is certainly neat, thanks! -- ~Ethan~ --

Re: Unicode Chars in Windows Path

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 5:41 AM, Terry Reedy wrote: > On 4/2/2014 11:10 PM, Chris Angelico wrote: >> >> On Thu, Apr 3, 2014 at 1:37 PM, Steven D'Aprano >> wrote: >>> >>> Windows accepts both forward and backslashes in file names. >> >> >> Small clarification: The Windows *API* accepts both types o

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 5:12 AM, Ian Kelly wrote: > Use this instead: > > switch day case in ("Mon", "Tue", "Wed", "Thu", "Fri"): > go_to_work = True > day_type = "ferial" > if day in ("Tue", "Thu"): > lunch_time = datetime.time(11, 30) > meeting_time = datetime.time(12,

Re: Examples of modern GUI python programms

2014-04-03 Thread Sturla Molden
Chris Angelico wrote: > Where? I can't see it. The home page redirects me to /news.html which > doesn't say anything about GPL (other than in its collection of tags, > which seem to be for finding other people's projects - that is, > clicking that link takes you to a list of all pygame-using proj

Re: Two Questions about Python on Windows

2014-04-03 Thread Ian Kelly
On Thu, Apr 3, 2014 at 2:15 PM, Mark Lawrence wrote: > On 03/04/2014 18:54, Ian Kelly wrote: >> >> >> On Apr 3, 2014 11:12 AM, "Walter Hurry" > > wrote: >> > >> > Normally my Python development is done on FreeBSD and Linux. I know >> that on *ix I simply have to mak

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 3:38 AM, Mark H Harris wrote: >'Useful' must always be taken in context, and also contextually evaluated > with an on-going methodology which constantly informs 'usefulness' on a > continuum. I admire and encourage the core devs, in their pursuit of > excellence. Asking

Re: Examples of modern GUI python programms

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 9:31 AM, Sturla Molden wrote: > Chris Angelico wrote: > >> Where? I can't see it. The home page redirects me to /news.html which >> doesn't say anything about GPL (other than in its collection of tags, >> which seem to be for finding other people's projects - that is, >> cl

Re: Two Questions about Python on Windows

2014-04-03 Thread Mark Lawrence
On 03/04/2014 23:41, Ian Kelly wrote: On Thu, Apr 3, 2014 at 2:15 PM, Mark Lawrence wrote: On 03/04/2014 18:54, Ian Kelly wrote: On Apr 3, 2014 11:12 AM, "Walter Hurry" mailto:walterhu...@gmail.com>> wrote: > > Normally my Python development is done on FreeBSD and Linux. I know that on *

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Mark Lawrence
On 02/04/2014 15:53, Lucas Malor wrote: Hi all. I would proposeto you all a switch-case syntax for Python. I already read PEP 3103 and I'm not completely satisfied by any of the proposed solutions. This is my proposal: switch_stmt ::= "switch" identifier "case" expression_list ":" suite

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 10:03 AM, Mark Lawrence wrote: > Please don't take this personally, but there's more chance of me being the > first ever World President than of anybody getting a switch/case statement > past the BDFL. The language in PEP 3103 (written by Guido) doesn't suggest this to me.

Re: Unicode Chars in Windows Path

2014-04-03 Thread David
On 4 April 2014 01:17, Chris Angelico wrote: > > -- Get info on all .pyc files in a directory and all its subdirectories -- > C:\>dir some_directory\*.pyc /s > $ ls -l `find some_directory -name \*.pyc` > > Except that the ls version there can't handle names with spaces in > them, so you need to f

Re: Default mutable parameters in functions

2014-04-03 Thread Mark Lawrence
On 03/04/2014 19:49, fbick...@gmail.com wrote: Hi all, So I was reading about default values for functions and spied this: [snip] I was rather expecting it to start with 4! I just wish I had a quid for every time somebody expects something out of Python, that way I'd have retired years a

Re: Unicode Chars in Windows Path

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 11:15 AM, David wrote: > On 4 April 2014 01:17, Chris Angelico wrote: >> >> -- Get info on all .pyc files in a directory and all its subdirectories -- >> C:\>dir some_directory\*.pyc /s >> $ ls -l `find some_directory -name \*.pyc` >> >> Except that the ls version there can

Re: COM Server data from python

2014-04-03 Thread Chris Farrow
On Wednesday, April 2, 2014 8:39:01 AM UTC-5, schapm...@gmail.com wrote: > I am attempting to provide a bit of data through a com server I did a > comparison of speed of my COM interface to ADODB and It seems massively > slower. I'm not sure if there is something I need to adjust or maybe that I

Re: Compact way to assign values by slicing list in Python

2014-04-03 Thread alex23
On 3/04/2014 11:50 PM, Marco Buttu wrote: I prefere this one: bar = ['a','b','c','x','y','z'] v1, _, _, v2, v3, _ = bar I also like the solution with itemgetter: v1, v2, v3 = itemgetter(0, 3, 4)(bar) but I think it is less readable than the previous one What if you wanted the 2nd, 37th, and

Re: Unicode Chars in Windows Path

2014-04-03 Thread David
On 4 April 2014 12:16, Chris Angelico wrote: > On Fri, Apr 4, 2014 at 11:15 AM, David wrote: >> On 4 April 2014 01:17, Chris Angelico wrote: >>> >>> -- Get info on all .pyc files in a directory and all its subdirectories -- >>> C:\>dir some_directory\*.pyc /s >>> $ ls -l `find some_directory -na

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread MRAB
On 2014-04-03 19:23, Ethan Furman wrote: On 04/03/2014 09:02 AM, Lucas Malor wrote: In reply to Ian Kelly: Instead of disabling fallthrough by default, why not disable it all together? I was tempted but there are cases in which it's useful. An example switch day casein ("Monday", "Thursday

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread alex23
On 4/04/2014 2:38 AM, Mark H Harris wrote: If I speak of the python community, and I rarely do Maybe you speak "of" them rarely but you claim to speak "for" them fairly often. Python3 is not perfect; but python3 is *way* more consistent than python2 and consequently *way* more useful th

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Mark H Harris
On 4/3/14 5:43 PM, Chris Angelico wrote: So your definition of "useful" for the Decimal module is "fast" and your definition of "useful" for Unicode is "mandated into use". No. I did not define 'useful'. I placed 'useful' on a continuum whereby 'useful' is non definitive & relative. Go re

converting strings to hex

2014-04-03 Thread dave em
Hello, I am taking a cryptography class and am having a tough time with an assignment similar to this. Given plain text message 1 and cipher 1 compute cipher 2 for message 2 Work flow will be: - figure out the key - use key to compute c2 So this is what I have so far and am getting nowhere fas

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Mark H Harris
On 4/3/14 9:07 PM, alex23 wrote: On 4/04/2014 2:38 AM, Mark H Harris wrote: If I speak of the python community, and I rarely do Maybe you speak "of" them rarely but you claim to speak "for" them fairly often. I am sorry, and I do apologize (genuinely). I knowingly speak for my users, bec

Re: converting strings to hex

2014-04-03 Thread Tim Chase
On 2014-04-03 19:10, dave em wrote: > So my first step is to compute the key. I suspect my error below > is because c1 is a float and m1 is a string but I don't know how to > turn the string into a float. For the record, "c1" in your example should be an integer/long It sounds like you want the

Re: converting strings to hex

2014-04-03 Thread Mark H Harris
On 4/3/14 9:10 PM, dave em wrote: I am taking a cryptography class and am having a tough time with an assignment similar to this. hi Dave, if your instructor wanted you to work on this with other people she would have made it a group project and ordered pizza for everyone. I'll give you so

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ethan Furman
On 04/03/2014 07:04 PM, MRAB wrote: On 2014-04-03 19:23, Ethan Furman wrote: On 04/03/2014 09:02 AM, Lucas Malor wrote: In reply to Ian Kelly: Instead of disabling fallthrough by default, why not disable it all together? I was tempted but there are cases in which it's useful. An example s

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 1:04 PM, MRAB wrote: > I thought [continue] went to the end of the loop, but because it's a loop, it > just wraps around back to the top... It goes to the bottom of the loop, and then the loop condition may or may not send it to the top of the loop. ChrisA -- https://mail

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-04-03 Thread Mark H Harris
On 4/3/14 2:43 PM, Marko Rauhamaa wrote: What does computer science have to show of late? A better mutual exclusion algorithm? Dancing trees? Ok, cryptography has been pretty exciting. The back and forth between feasibility and unfeasibility. The ongoing cat and mouse. Computer science i

Re: converting strings to hex

2014-04-03 Thread dave em
On Thursday, April 3, 2014 8:31:42 PM UTC-6, Tim Chase wrote: > On 2014-04-03 19:10, dave em wrote: > > > So my first step is to compute the key. I suspect my error below > > > is because c1 is a float and m1 is a string but I don't know how to > > > turn the string into a float. > > > > For

Re: converting strings to hex

2014-04-03 Thread Mark H Harris
On 4/3/14 10:10 PM, dave em wrote: Thanks, got it. Sometimes the simple things can be difficult. Dave You haven't seen nothing yet, wait till M.L. catches you on the flip side for using gg. {running for cover} marcus -- https://mail.python.org/mailman/listinfo/python-list

Re: converting strings to hex

2014-04-03 Thread dave em
> You haven't seen nothing yet, wait till M.L. catches you on the flip > > side for using gg. {running for cover} Who is ML? -- https://mail.python.org/mailman/listinfo/python-list

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Ethan Furman
On 04/03/2014 08:09 PM, Chris Angelico wrote: On Fri, Apr 4, 2014 at 1:04 PM, MRAB wrote: I thought [continue] went to the end of the loop, but because it's a loop, it just wraps around back to the top... It goes to the bottom of the loop, and then the loop condition may or may not send it to

Re: Switching between cmd.CMD instances

2014-04-03 Thread Josh English
On Wednesday, April 2, 2014 4:33:07 PM UTC-7, Jason Swails wrote: > From there, you can implement a method interface in which the child Cmd > subclasses can call to indicate to BossCmd that do_exit has been called and > it should quit after the child's cmdloop returns.  So something like this: >

Re: Yet Another Switch-Case Syntax Proposal

2014-04-03 Thread Chris Angelico
On Fri, Apr 4, 2014 at 2:13 PM, Ethan Furman wrote: > On 04/03/2014 08:09 PM, Chris Angelico wrote: >> >> On Fri, Apr 4, 2014 at 1:04 PM, MRAB wrote: >>> >>> I thought [continue] went to the end of the loop, but because it's a >>> loop, it >>> just wraps around back to the top... >> >> >> It goes

Re: converting strings to hex

2014-04-03 Thread James Harris
"Mark H Harris" wrote in message news:533e1b2e.5040...@gmail.com... > On 4/3/14 9:10 PM, dave em wrote: >> >> I am taking a cryptography class and am having a >> tough time with an assignment similar to this. >> > > hi Dave, if your instructor wanted you to work on this with other people > she w