Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
i have a approach, it may not be best fld = [ ] for data in shlex.split(ln): fld.append(data) On Sat, 29 Sep 2018 at 07:52, wrote: > On Friday, September 28, 2018 at 11:03:17 AM UTC-7, Chris Green wrote: > > I have a list created by:- > > > > fld = shlex.split(ln) > > > > It may

Re: What's an elegant way to test for list index existing?

2018-09-29 Thread Glen D souza
fld = [ ] data = shlex.split(ln) for item in data: fld.append(item) fld = fld + [0] * (5 - len(data)) On Sat, 29 Sep 2018 at 11:03, Glen D souza wrote: > i have a approach, it may not be best > > fld = [ ] > for data in shlex.split(ln): >fld.append(data) > &g

[issue27448] Race condition in subprocess.Popen which causes a huge memory leak

2018-05-02 Thread Glen Walker
Glen Walker <g...@walker.gen.nz> added the comment: Correct me if I'm wrong, the change released in Python 2.7.15 doesn't actually fix this race condition. The race is: * T1: gc_was_enabled = gc.isenabled() # True * T1: gc.disable() * T2: gc_was_enabled = gc.isenabled() # Fals

[issue33300] Bad usage example in id() DocString

2018-04-17 Thread Glen Neff
New submission from Glen Neff <gn...@trioptimum.com>: The DocString for id() in 3.5.x & 3.6.x seems to have an incorrect usage example, specifically ``id(obj, /)``. This is present in 3.5.x & 3.6.x. It does not appear to be present in 2.7.x or 3.4.x.: Python 3.6.4 (v3.6.4:d

[issue24074] string, center, ljust, rjust, width paramter should accept None

2015-04-29 Thread Glen Fletcher
New submission from Glen Fletcher: I've only list python 2.7, as I'm not sure that version 3 doesn't accept None, if so this should be changed there too. If these function are passed None, as the width they should return the string unchanged, just as they would for with a width set to 0

PyTexas 2014 Conference

2014-07-24 Thread Glen Zangirolami
Pythonistas, PyTexas 2014 http://pytexas.org/ is well on its way. This year it will be be located at the Texas AM University Memorial Student Center https://www.pytexas.org/2014/about/venue/ and will take place Friday October 3rd through Sunday October 5th. Friday will be a tutorial day. Saturday

Re: Several Topics - Nov. 19, 2013

2013-11-19 Thread glen herrmannsfeldt
that to machine code and execute it. This is common for Java, and more recently for languages like Matlab. -- glen -- https://mail.python.org/mailman/listinfo/python-list

Re: Several Topics - Nov. 19, 2013

2013-11-19 Thread glen herrmannsfeldt
In comp.lang.fortran Rainer Weikusat rweiku...@mobileactivedefense.com wrote: glen herrmannsfeldt g...@ugcs.caltech.edu writes: In comp.lang.fortran E.D.G. edgrs...@ix.netcom.com wrote: E.D.G. edgrs...@ix.netcom.com wrote in message news:ro-dnch2dptbrhnpnz2dnuvz_rsdn...@earthlink.com

struct calcsize discrepency?

2011-12-04 Thread Glen Rice
In IPython: import struct struct.calcsize('4s') 4 struct.calcsize('Q') 8 struct.calcsize('4sQ') 16 This doesn't make sense to me. Can anyone explain? -- http://mail.python.org/mailman/listinfo/python-list

Re: struct calcsize discrepency?

2011-12-04 Thread Glen Rice
On Dec 4, 9:38 am, Duncan Booth duncan.bo...@invalid.invalid wrote: Glen Rice glen.rice.n...@gmail.com wrote: In IPython: import struct struct.calcsize('4s') 4 struct.calcsize('Q') 8 struct.calcsize('4sQ') 16 This doesn't make sense to me.  Can anyone explain? When you mix

Re: Python/Fortran interoperability

2009-08-24 Thread glen herrmannsfeldt
terminating strings with unusual (likely not null) characters was also done. -- glen -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric literal syntax

2008-09-09 Thread glen stark
On Tue, 09 Sep 2008 08:32:29 +1000, Tom Harris wrote: I agree. So did Forth's early designers. That is why Forth's number parser considers a word that starts with a number and has embedded punctuation to be a 32 bit integer, and simply ignores the punctuation. I haven't used Forth in years,

Re: What can we do about all the spam that the list is getting?

2008-04-18 Thread glen stark
On Thu, 17 Apr 2008 13:30:18 -0500, Grant Edwards wrote: When using Google Groups can one kill all posts made via Google Groups? Presuming he has no burning need to see his own posts (something that can't be said for everybody in the history of Usenet), it might still be a viable approach.

Re: lowercase class names, eg., qtgui ? (PyQt4)

2007-04-26 Thread Glen
. Maybe vim was just displaying the text wrong for a minute. Had me going though. Thanks again. Glen Are you sure? That's strange. I have never seen that. Here is a snippet of one of my typical .py files generated by 'pyuic4': self.gridlayout = QtGui.QGridLayout(self.centralwidget

lowercase class names, eg., qtgui ? (PyQt4)

2007-04-25 Thread Glen
(dldialog) What exactly is going on here? Are these instances that are defined somewhere else (their not in the local scope.)? Can I do the same in my code when I import something? Thanks, Glen Glen -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner: Formatting text output (PyQt4) Solved

2007-04-23 Thread Glen
in the process of learning Python and PyQt simultaneously. Glen -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner: Simple Output to a Dialog PyQt4

2007-04-23 Thread Glen
On Sat, 21 Apr 2007 03:15:00 +0200, David Boddie wrote: On Tuesday 17 April 2007 07:42, Glen wrote: # Just to avoid any misunderstanding: the form is actually stored as XML. # You can create C++ code with uic or Python code with pyuic4. Right. I do remember noticing that when I opened one

Beginner: Formatting text output (PyQt4)

2007-04-18 Thread Glen
]) ).rightJustified(2) + ':' + QtCore.QString( str(tL2[i][1]) ).rightJustified(4) ) This still gives me uneven columns. Any suggestions? Thanks, Glen -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner: Formatting text output (PyQt4)

2007-04-18 Thread Glen
On Wed, 18 Apr 2007 22:50:14 +, Glen wrote: Ok, obviously, my post didn't come out the way I wanted it to. In the first example from my text file below, the dictionary pairs, constructed from sorted tuples were in straight columns. When I write them to my QTextEdit, however, the columns

Beginner: Simple Output to a Dialog PyQt4

2007-04-17 Thread Glen
Hello, I've written a script in python and put together a simple QFrame with a QTextBrowser with Designer. I've translated the C++ into python using puic4. The .py file is called outputWin.py. My Script and its functions are in cnt.py. Finally, my main is in pball.py which follows

Re: Access to static members from inside a method decorator?

2006-10-08 Thread glen . coates . bigworld
is to avoid that kind of thing ... Cheers, Glen -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to static members from inside a method decorator?

2006-10-05 Thread glen . coates . bigworld
methods. Thanks for the help though, Glen -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to static members from inside a method decorator?

2006-10-05 Thread glen . coates . bigworld
, Glen Maric Michaud wrote: Le jeudi 05 octobre 2006 17:18, [EMAIL PROTECTED] a écrit : I guess my solution is slightly less elegant because it requires this ugly explicit init call outside the classes that it actually deals with, however it is more efficient because the dir() pass happens

Access to static members from inside a method decorator?

2006-10-04 Thread glen . coates . bigworld
means that static tracking of the list of exposed methods is impossible (at least, if I want to use decorators). Any ideas that will enable my initial design, or suggestions for an elegant, workable alternative would be much appreciated. Cheers, Glen -- http://mail.python.org/mailman/listinfo/python

Detect TKinter window being closed?

2005-12-02 Thread Glen
Is it possible to to detect a Tkinter top-level window being closed with the close icon/button (top right), for example to call a function before the window actually closes? Python 2.4 / Linux (2.6 kernel) if that makes any difference. Any info would be greatly appreciated. Thanks Glen -- http

Re: Detect TKinter window being closed?

2005-12-02 Thread Glen
Thanks Fredrik and Adonis that's just what I needed, plus a bit more to learn about. -- http://mail.python.org/mailman/listinfo/python-list

How to stop a linux process

2005-11-28 Thread Glen
When I used the following line to play a midi file in linux, return_value = os.system('timidity test.mid') I have encountered two problems. 1. The python script halts until timidity has finished. 2. If I had control of the script, I can't think how I would stop timidity. Any advice on the

Re: How to stop a linux process

2005-11-28 Thread Glen
Simon Brunning wrote: The subprocess module might be worth a look. That looks about right for what I need (once I understand it!). Thanks very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newb: Telnet 'cooked data','EOF' queries

2005-08-01 Thread glen
Could someone explain what cooked data is. discussed in the telnet RFC, which is in RFC854 telnetlib docstring. Cooked data is data after these special sequences are removed. 'when' is an EOF received. the only EOF in telnet is when the other side closes the socket. Thanks, thats got me

Newb: Telnet 'cooked data','EOF' queries.

2005-07-31 Thread glen
While experimenting with telnetlib, Ive come across a couple of 'features' that confuse me a little (lot!). Could someone explain what cooked data is. Also when trying read_all() the program seems to lock up, which I assume is because it is waiting for an EOF, but 'when' is an EOF received. Glen

Begniner Question

2005-03-21 Thread Glen
#!/usr/local/bin/python import sys print 1.\tDo Something print 2.\tDo Something print 3.\tDo Something print 4.\tDo Something print 5.\tDo Something print 6.\tExit choice=raw_input(Please Enter Choice: ) if int(choice)==1: print Here else: pass if int(choice)==2: else: pass if