Re: Yet Another Switch-Case Syntax Proposal

2014-04-02 Thread Ian Kelly
On Wed, Apr 2, 2014 at 7:06 PM, Steven D'Aprano wrote: > If we're going to add "switch" and "case" keywords, how about we also add > "of"? Then we can write: > > switch x case of a, b, c: > # x equals one of a, b or c > case of d, e, f: > # x equals one of d, e or f > case in g, h, i: >

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Steven D'Aprano
On Wed, 02 Apr 2014 21:15:23 -0700, Rustom Mody wrote: reduce(dict.get, ['a','b','c'], nested) > 'Hiii!!' Nice! -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Rustom Mody
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 which represents a path through the tree. Different > >

Re: Unicode Chars in Windows Path

2014-04-02 Thread Chris Angelico
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 (you can open a file using forward slashes, for instance), but not all Windows *applications* are aware of this (

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Rustom Mody
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 which represents a path through the tree. Different > leaves in the tree will be at different depths (which range from 1 to abou

Re: Unicode Chars in Windows Path

2014-04-02 Thread Steven D'Aprano
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\Py

Re: python nose unit test - test plan preparation

2014-04-02 Thread Rustom Mody
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/executing the cases. > How is this

Calculating time differences given daylight savings time

2014-04-02 Thread Washington Ratso
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 ideas how to do it? If it requires having pytz, how would I do i

[ANN] ClamAV for Python 0.1

2014-04-02 Thread rymg19
ClamAV for Python is a simple set of Python bindings for libclamav. It uses CFFI for the bindings. Please give all user input. I'm anxious to see what others think of this. -- https://mail.python.org/mailman/listinfo/python-list

Re: Yet Another Switch-Case Syntax Proposal

2014-04-02 Thread Steven D'Aprano
On Thu, 03 Apr 2014 08:50:47 +1100, Chris Angelico wrote: > On Thu, Apr 3, 2014 at 1:53 AM, Lucas Malor <3kywjyd...@snkmail.com> > wrote: >> For example, in a "switch x" statement, the code "case iterable: " is >> identical to "if x in iterable: " (or elif etc). So if you want to >> perform the sa

Re: Switching between cmd.CMD instances

2014-04-02 Thread Jason Swails
On Wed, Apr 2, 2014 at 1:03 AM, Josh English wrote: > I have a program with several cmd.Cmd instances. I am trying to figure out > what the best way to organize them should be. > > I've got my BossCmd, SubmissionCmd, and StoryCmd objects. > > The BossCmd object can start either of the other two, a

Unicode Chars in Windows Path

2014-04-02 Thread Steve
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\TestCases\list_dir_script.txt"] for curr_test in All_Tests:

Re: Recording instruction/data flow for a python script/program.

2014-04-02 Thread Dan Stromberg
Google is your friend: https://docs.python.org/2/library/trace.html On Wed, Apr 2, 2014 at 4:02 PM, Skybuck Flying wrote: > Hello, > > Is there a way for a python script's execution to be capture in an > instruction/data flow log ? > > Since python is an interpreter this should be easy to do ? >

Recording instruction/data flow for a python script/program.

2014-04-02 Thread Skybuck Flying
Hello, Is there a way for a python script's execution to be capture in an instruction/data flow log ? Since python is an interpreter this should be easy to do ? Such a feature would then allow the script to be played back in some kind of log player for a script or something ? And compare h

Re: Yet Another Switch-Case Syntax Proposal

2014-04-02 Thread Chris Angelico
On Thu, Apr 3, 2014 at 1:53 AM, Lucas Malor <3kywjyd...@snkmail.com> wrote: > For example, in a "switch x" statement, the code "case iterable: " is > identical to "if x in iterable: " (or elif etc). So if you want to perform > the same case block for more than one value, you have only to specify

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Ethan Furman
On 04/02/2014 01:18 PM, Steven D'Aprano wrote: On Wed, 02 Apr 2014 13:58:16 -0400, Roy Smith wrote: I have a big hairy data structure which is a tree of nested dicts. I have a sequence of strings which represents a path through the tree. Different leaves in the tree will be at different depths

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Steven D'Aprano
On Wed, 02 Apr 2014 13:58:16 -0400, Roy Smith wrote: > I have a big hairy data structure which is a tree of nested dicts. I > have a sequence of strings which represents a path through the tree. > Different leaves in the tree will be at different depths (which range > from 1 to about 4 or 5 at m

Calling macro from python script bombs out when custom table style is used

2014-04-02 Thread accessnewbie
I have a python script (2.7.5) that calls a macro from an excel template. Both scripts ran fine until i tried to apply a custom table style within excel. I suspect this has something to do with the win32.com client application not recognizing custom table styles. Does anyone have a work around s

Re: Retrieve item deep in dict tree?

2014-04-02 Thread Ethan Furman
On 04/02/2014 10:58 AM, Roy Smith wrote: I have a big hairy data structure which is a tree of nested dicts. I have a sequence of strings which represents a path through the tree. Different leaves in the tree will be at different depths (which range from 1 to about 4 or 5 at most). I want t

Re: Yet Another Switch-Case Syntax Proposal

2014-04-02 Thread Ian Kelly
On Wed, Apr 2, 2014 at 8:53 AM, Lucas Malor <3kywjyd...@snkmail.com> 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: A more suitable place to propose th

Re: Retrieve item deep in dict tree?

2014-04-02 Thread John Gordon
In Roy Smith writes: > I have a big hairy data structure which is a tree of nested dicts. I = > have a sequence of strings which represents a path through the tree. = > Different leaves in the tree will be at different depths (which range = > from 1 to about 4 or 5 at most). I want to get th

Retrieve item deep in dict tree?

2014-04-02 Thread Roy Smith
I have a big hairy data structure which is a tree of nested dicts. I have a sequence of strings which represents a path through the tree. Different leaves in the tree will be at different depths (which range from 1 to about 4 or 5 at most). I want to get the value stored at that path. Thus,

python nose unit test - test plan preparation

2014-04-02 Thread Hareesha Karunakar
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/executing the cases. How is this possible? I head "collect-only" plugin will help to achieve the same. But I think I

Yet Another Switch-Case Syntax Proposal

2014-04-02 Thread Lucas Malor
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 ("case" expression_list ":" suite)* ["e

Re: Python to be replaced by the new language called Cookie !

2014-04-02 Thread Grant Edwards
On 2014-04-02, Chris Angelico wrote: > On Wed, Apr 2, 2014 at 3:15 PM, Dan Sommers wrote: >> On Wed, 02 Apr 2014 02:19:38 +1100, Chris Angelico wrote: >> >>> These improvements are absolutely critical to the language, and should >>> be made in Python 2.5.7, 2.6.9, and 3.0.2. Anyone using a newer

COM Server data from python

2014-04-02 Thread schapman1974
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 am making so many calls to the COM server that each call takes time and pos

Re: Switching between cmd.CMD instances

2014-04-02 Thread William Ray Wing
On Apr 2, 2014, at 1:03 AM, Josh English wrote: > I have a program with several cmd.Cmd instances. I am trying to figure out > what the best way to organize them should be. > > I've got my BossCmd, SubmissionCmd, and StoryCmd objects. > > The BossCmd object can start either of the other two, a

Telepathy is server or client?

2014-04-02 Thread Wesley
Hi, These days I see Telepathy on the net. Not so much examples for this guy. Is it used to write client or server? I mean, for example, I wanna develop a voice chatting system, so, can use this guy to develop a client or server? Thanks. Wesley -- https://mail.python.org/mailman/listinfo/pyth

Re: Installing binwalk on Portable Python

2014-04-02 Thread mtabesh
On Tuesday, March 18, 2014 2:22:57 AM UTC+4:30, lagu...@mail.com wrote: > Yes, that  help. > Installation start, but then failed due to "Pre-requisite failure: failed to > find libmagic. Check your installation. Please install the python-magic > module, or download and install it from source: >

Re: Python to be replaced by the new language called Cookie !

2014-04-02 Thread alex23
On 2/04/2014 3:42 PM, Chris Angelico wrote: Python 2.8 is supported only on Windows XP 64-bit, and you should upgrade to 32-bit Python That would be Python 1.4 -- https://mail.python.org/mailman/listinfo/python-list