Re: Duplicate keys in dict?

2010-03-09 Thread Yinon Ehrlich
On Mar 7, 6:23 pm, vsoler wrote: > Hello, > > My code snippet reads data from excel ranges. First row and first > column are column headers and row headers respectively. After reding > the range I build a dict. > > What is the best approach for this problem? Can anybody help? Have you tried xlrea

Re: subprocess returncode is masked

2009-12-30 Thread Yinon Ehrlich
On Dec 30, 7:59 pm, Nobody wrote: > On Mon, 28 Dec 2009 17:12:23 +0100, Emmanuel wrote: > > I'm using Python 2.6 and the new subprocess module to get the exit value > > of an external executable. It appears the return value given by wait() > > or poll() operations is masked under Unix: I only get

Re: how to debug extended module?

2009-12-05 Thread Yinon Ehrlich
On Dec 3, 8:40 am, junyoung wrote: > On 12월2일, 오전9시54분, junyoung wrote: > > > > > On 12월1일, 오후6시14분, "Diez B. Roggisch" wrote: > > > > junyoung schrieb: > > > > > Hi, I am a newbie who want to implement a extend module to use native > > > > python language with my own shared library. > > > > If

Re: subprocess kill

2009-12-05 Thread Yinon Ehrlich
On Dec 5, 12:13 pm, luca72 wrote: > On 5 Dic, 03:06, Carl Banks wrote: > > > > > On Dec 4, 3:44 pm, luca72 wrote: > > > > On 5 Dic, 00:14, luca72 wrote: > > > > > On 5 Dic, 00:03, luca72 wrote: > > > > > > On 4 Dic, 23:23, Mike Driscoll wrote: > > > > > > > On Dec 4, 3:50 pm, luca72 wrote: >

Re: python gui builders

2009-11-17 Thread Yinon Ehrlich
On Nov 18, 8:10 am, sturlamolden wrote: > On 17 Nov, 19:34, r wrote: > > > Agreed! Tkinter (besides myself) seems to be the whipping boy of > > c.l.py. Tkinter has it's place in Python because of the same > > simplicity people laboriously lament about! Until something else comes > > along that ca

Re: How to specify Python version in script?

2009-11-12 Thread Yinon Ehrlich
> Is there some way to specify at the very beginning of the script > the acceptable range of Python versions? sys.hexversion, see http://mail.python.org/pipermail/python-list/2009-June/185939.html -- Yinon -- http://mail.python.org/mailman/listinfo/python-list

Re: Obtaining Python version

2009-08-04 Thread Yinon Ehrlich
On Aug 4, 1:19 am, John Nagle wrote: > This works, but it seems too cute: > >  >>> pyver = map(int,sys.version.split()[0].split('.')) >  >>> print(pyver) > [2, 6, 1] > > Is it guaranteed that the Python version string will be in a form > suitable for that?  In other words, does "sys.version" begin

Re: Only run one specific test

2009-05-31 Thread Yinon Ehrlich
> > Yes, that works indeed. But in practice the modules_to_import list is > filled by parsing the contents of a test/*.py directory. That's why I > import dynamically with __import__. > > Nevertheless, you got me on the right track. After I explicitly added > the modules to the global namespace (g

Re: Help needed with filenames

2009-05-10 Thread Yinon Ehrlich
> I did notice that when a windows command window does a directory > listing of these files the characters seem to be translated into close > approximations (long dash to minus, special double quotes to simple > double quotes, but still retains many of the accent chars).  I looked > at translate t

Re: problem with pydoc under python 2.6.1

2009-03-05 Thread Yinon Ehrlich
On Mar 5, 1:48 pm, yino...@gmail.com wrote: > On Mar 5, 1:29 pm, steve.ferg.bitbuc...@gmail.com wrote: > > > > > Has anybody encountered problems running pydoc with version 2.6.1? > > I'm getting an error message that pydoc cannot import namedtuple > > (details below). > > (I'm running under 64-bit

Re: unittest, order of test execution

2009-01-27 Thread Yinon Ehrlich
On Jan 27, 11:33 am, Yinon Ehrlich wrote: > > But I was wondering, *should* this test be separated into two unit > > tests, one for each function? On the face of it, it looks that's how it > > should be done. > > > This, however, raises the question: what's t

Re: unittest, order of test execution

2009-01-27 Thread Yinon Ehrlich
> But I was wondering, *should* this test be separated into two unit > tests, one for each function? On the face of it, it looks that's how it > should be done. > > This, however, raises the question: what's the order of test execution > in the unittest? And how to pass values between unit tests?

Re: ethical questions about global variables

2008-12-16 Thread Yinon Ehrlich
On Dec 16, 4:45 am, "Giampaolo Rodola'" wrote: > Hi, > in a module of mine (ftpserver.py) I'd want to add a (boolean) global > variable named "use_gmt_times" to decide whether the server has to > return times in GMT or localtime but I'm not sure if it is a good idea > because of the "ethical" doub

Re: os.environ.get('SSH_ORIGINAL_COMMAND') returns None

2008-12-16 Thread Yinon Ehrlich
On Dec 15, 8:51 pm, Tzury Bar Yochay wrote: > Trying to follow a technique found at bzr I did the following > > added to ~/.ssh/authorized_keys the command="my_parder" parameter > which point to a python script file named 'my_parser' and located in / > usr/local/bin  (file was chmoded as 777) > >

Re: Limit traceback from most recent call

2008-12-15 Thread Yinon Ehrlich
On Dec 14, 8:07 pm, Brian Allen Vanderburg II wrote: > I've looked at traceback module but I can't find how to limit traceback > from the most recent call if it is possible.  I see that extract_tb has > a limit parameter, but it limits from the start and not the end.   > Currently I've made my own