wxpython-OGL fails to render objects with Python-3

2020-09-17 Thread Frank Miles
I have a substantial wxpython-based application that I'm trying to port from python-2 to -3. Almost everything is working properly, except for a few small but important sections that use the OGL library. That executes without any exceptions, but the objects created within the

Re: python3.7 installation failing - so why?

2019-02-22 Thread Frank Miles
On Sat, 23 Feb 2019 14:56:03 +1100, Chris Angelico wrote: > On Sat, Feb 23, 2019 at 2:51 PM Frank Miles > wrote: >> >> I have a Debian/Linux machine that I just upgraded to the newer >> "testing" >> distribution. I'd done that earlier to another machin

python3.7 installation failing - so why?

2019-02-22 Thread Frank Miles
I have a Debian/Linux machine that I just upgraded to the newer "testing" distribution. I'd done that earlier to another machine and all went well. With the latest machine, python2 is OK but python3 can barely run at all. For example: $ python3 Python 3.7.2+ (default, Feb 2 2019, 14:31:48)

Re: closing image automatically in for loop , python

2017-04-12 Thread Frank Miles
On Wed, 12 Apr 2017 04:18:45 -0700, Masoud Afshari wrote: > filename ="Ex_resample" +'_sdf_'+ str(n)+'.dat' > with open(filename, 'rb') as f: #read binary file data = np.fromfile(f, > dtype='float64', count=nx*ny) #float64 for Double precision float numbers > Ex = np.reshape(data, [ny, nx],

Re: Data exchange between python script and bash script

2017-04-04 Thread Frank Miles
On Tue, 04 Apr 2017 08:01:42 -0700, venkatachalam.19 wrote: > Hello All, > > I am writing a python code for processing a data obtained from a sensor. The > data from sensor is obtained by executing a python script. The data obtained > should be further given to another python module where the

Re: Multiprocessing queue in py2.7

2017-03-28 Thread Frank Miles
On Tue, 28 Mar 2017 15:38:38 -0400, Terry Reedy wrote: > On 3/28/2017 2:51 PM, Frank Miles wrote: >> I tried running a bit of example code from the py2.7 docs >> (16.6.1.2. Exchanging objects between processes) >> only to have it fail. The code is simply: >

Multiprocessing queue in py2.7

2017-03-28 Thread Frank Miles
I tried running a bit of example code from the py2.7 docs (16.6.1.2. Exchanging objects between processes) only to have it fail. The code is simply: # from multiprocessing import Process, Queue def f(q): q.put([42, None, 'hello']) if __name__ == '__main__': q = Queue()

Re: Does anyone here use wxGlade on Linux?

2016-02-11 Thread Frank Miles
On Thu, 11 Feb 2016 14:29:04 +, cl wrote: > I am trying out wxGlade on Linux, version 0.7.1 of wxGlade on xubuntu > 15.10. > > I have already written something using wxPython directly so I have the > basics (of my Python skills and the environment) OK I think. > > I am having a lot of

Re: Which GUI?

2015-07-24 Thread Frank Miles
On Fri, 24 Jul 2015 19:31:36 +0100, Paulo da Silva wrote: [snip] Which technology is better? matplotlib? tkinter? wxwidgets? qt? Sadly - I don't think wxpython has been ported to python3 yet. -- https://mail.python.org/mailman/listinfo/python-list

[issue23382] Maybe can not shutdown ThreadPoolExecutor when call the method of shutdown

2015-02-27 Thread miles
miles added the comment: The attachment includes the patch file -- keywords: +patch nosy: +milesli Added file: http://bugs.python.org/file38274/thread.py.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23382

[issue23382] Maybe can not shutdown ThreadPoolExecutor when call the method of shutdown

2015-02-03 Thread miles
New submission from miles: Maybe can not shutdown ThreadPoolExecutor when call the method shutdown. Though the variable of _shutdown is set to true in the method of shutdown, it may also reads the variable of _shutdown from cpu cache in the method of _worker, and the worst case

[issue23382] Maybe can not shutdown ThreadPoolExecutor when call the method of shutdown

2015-02-03 Thread miles
miles added the comment: the attachment includes the new code -- Added file: http://bugs.python.org/file38002/thread.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23382

[issue23382] Maybe can not shutdown ThreadPoolExecutor when call the method of shutdown

2015-02-03 Thread miles
miles added the comment: The attachment includes the new code -- Added file: http://bugs.python.org/file37997/thread.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23382

Pythonic way to iterate through multidimensional space?

2014-08-05 Thread Frank Miles
I need to evaluate a complicated function over a multidimensional space as part of an optimization problem. This is a somewhat general problem in which the number of dimensions and the function being evaluated can vary from problem to problem. I've got a working version (with loads of

Re: Pythonic way to iterate through multidimensional space?

2014-08-05 Thread Frank Miles
On Tue, 05 Aug 2014 20:06:05 +, Frank Miles wrote: I need to evaluate a complicated function over a multidimensional space as part of an optimization problem. This is a somewhat general problem in which the number of dimensions and the function being evaluated can vary from problem

Re: wx (not responding)

2014-01-14 Thread Frank Miles
On Tue, 14 Jan 2014 07:26:10 -0800, ngangsia akumbo wrote: When i run this code on my pc it actually runs but signals that the app is not responding. [snip most of the code]- def main(): ex = wx.App() Example(None) ex.Mainloop() if __name__ == __main__: main() When

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-13 Thread Frank Miles
On Thu, 12 Dec 2013 16:18:22 -0500, Larry Martell wrote: On Thu, Dec 12, 2013 at 11:51 AM, bob gailer bgai...@gmail.com wrote: On 12/11/2013 9:07 PM, Larry Martell wrote: Nope. Long before that I was working on computers that didn't boot when you powered them up, You had to manually key in a

Re: Python Front-end to GCC

2013-10-22 Thread Frank Miles
On Tue, 22 Oct 2013 16:40:32 +, Steven D'Aprano wrote: On Tue, 22 Oct 2013 15:39:42 +, Grant Edwards wrote: No, I was thinking of an array. Arrays aren't automatically initialised in C. If they are static or global, then _yes_they_are_. They are zeroed. Not that I don't

Re: PDF generator decision

2013-05-14 Thread Frank Miles
On Tue, 14 May 2013 08:05:53 -0700, Christian Jurk wrote: Hi folks, This questions may be asked several times already, but the development of relevant software continues day-for-day. For some time now I've been using xhtml2pdf [1] to generate PDF documents from HTML templates (which are

Re: Urgent:Serial Port Read/Write

2013-05-09 Thread Frank Miles
On Thu, 09 May 2013 23:35:53 +0800, chandan kumar wrote: Hi all,I'm new to python and facing issue using serial in python.I'm facing the below error     ser.write(port,command)NameError: global name 'ser' is not defined Please find the attached script and let me know whats wrong in my script

Re: Reinforced Concrete: Mechanics and Design (5th Ed., James G. MacGregor James K. Wight)

2013-01-18 Thread Robert Miles
On 1/18/2013 7:32 PM, Roy Smith wrote: Can whoever manages the mailing list block this bozo? In article db2dnygmdpv4agtnnz2dnuvz_o-dn...@giganews.com, kalvinmanual1 kalvinmanu...@gmail.com wrote: I have solutions manuals to all problems and exercises in these textbooks. To get one in an

Re: Spam source (Re: Horror Horror Horror!!!!!)

2012-11-22 Thread Robert Miles
On Sunday, November 18, 2012 8:18:53 PM UTC-6, Mark Lawrence wrote: On 18/11/2012 19:31, Terry Reedy wrote: The question was raised as to how much spam comes from googlegroups. I don't know the answer but I take the greatest pleasure in hurtling onto the dread googlegroups and gmane to

Re: Unpaking Tuple

2012-11-18 Thread Robert Miles
On 10/9/2012 1:07 AM, Bob Martin wrote: in 682592 20121008 232126 Prasad, Ramit ramit.pra...@jpmorgan.com wrote: Thomas Bach wrote:=0D=0A Hi there,=0D=0A =0D=0A On Sat, Oct 06, 2012 at = 03:08:38PM +, Steven D'Aprano wrote:=0D=0A =0D=0A my_tuple =3D my_= tuple[:4]=0D=0A a,b,c,d =3D

Re: Spam source (Re: Horror Horror Horror!!!!!)

2012-11-18 Thread Robert Miles
On Sunday, November 18, 2012 1:35:00 PM UTC-6, Terry Reedy wrote: The question was raised as to how much spam comes from googlegroups. Not all, but more that half, I believe. This one does. From: MoneyMaker livewebcams...@gmail.com ... Message-ID:

Re: datetime issue

2012-10-31 Thread Robert Miles
On 10/31/2012 2:35 PM, ru...@yahoo.com wrote: On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16, ?? nikos.gr...@gmail.com wrote: Iam positng via google groups using chrome, thats all i know. Learn something else. Google Groups is seriously and permanently broken, and

Re: datetime issue

2012-10-31 Thread Robert Miles
On 10/31/2012 4:38 PM, Mark Lawrence wrote: On 31/10/2012 19:35, ru...@yahoo.com wrote: On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16, ?? nikos.gr...@gmail.com wrote:. Broken? Yes. But so is every piece of software in one way or another. Thunderbird is one of the

Re: Python garbage collector/memory manager behaving strangely

2012-10-31 Thread Robert Miles
On 9/16/2012 9:12 PM, Dave Angel wrote: On 09/16/2012 09:07 PM, Jadhav, Alok wrote: Hi Everyone, I have a simple program which reads a large file containing few million rows, parses each row (`numpy array`) and converts into an array of doubles (`python array`) and later writes into an `hdf5

Re: Obnoxious postings from Google Groups

2012-10-30 Thread Robert Miles
with multiple levels of quoting. The incompatibility tends to insert a blank line after every line. With multiple levels of quoting, this gives blank line groups that often roughly double in size for every level of quoting. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Obnoxious postings from Google Groups

2012-10-30 Thread Robert Miles
On 9/16/2012 10:44 AM, pandora.ko...@gmail.com wrote: Whaen i tried to post just now by hitting sumbit, google groups told me that the following addresssed has benn found in this thread! i guess is used them all to notify everything! cdf072b2-7359-4417-b1e4-d984e4317...@googlegroups.com

Re: Obnoxious postings from Google Groups

2012-10-30 Thread Robert Miles
On 9/16/2012 8:14 PM, alex23 wrote: On Sep 17, 10:55 am, Roy Smith r...@panix.com wrote: They didn't buy the service. They bought the data. Well, they really bought both, but the data is all they wanted. I thought they'd taken most of the historical data offline now too? Some of it, but

Re: Obnoxious postings from Google Groups

2012-09-20 Thread Robert Miles
the rest of us. Again, not something you have much control over, except to stop using Google Groups. Could this mean that Google wants all the spam posted through Google Groups to look obnoxious to the rest of Usenet that the spammers will go elsewhere? Robert Miles -- http://mail.python.org/mailman

Re: Dumping all the sql statements as backup

2012-08-30 Thread Robert Miles
On 7/25/2012 8:56 AM, andrea crotti wrote: I have some long running processes that do very long simulations which at the end need to write things on a database. At the moment sometimes there are network problems and we end up with half the data on the database. The half-data problem is

Re: OT: Text editors

2012-08-30 Thread Robert Miles
not sure whether I still could, though. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: catch UnicodeDecodeError

2012-08-29 Thread Robert Miles
On 7/26/2012 5:51 AM, Jaroslav Dobrek wrote: And the cool thing is: you can! :) In Python 2.6 and later, the new Py3 open() function is a bit more hidden, but it's still available: from io import open filename = somefile.txt try: with open(filename, encoding=utf-8) as

Re: the meaning of r?.......ï¾

2012-08-28 Thread Robert Miles
On 7/23/2012 1:10 PM, Dennis Lee Bieber wrote: On Mon, 23 Jul 2012 16:42:51 +0200, Henrik Faber hfa...@invalid.net declaimed the following in gmane.comp.python.general: If that was written by my coworkers, I'd strangle them. My first real assignment, 31 years ago, was porting an

Re: Encapsulation, inheritance and polymorphism

2012-08-18 Thread Robert Miles
On 7/23/2012 11:18 AM, Albert van der Horst wrote: In article 5006b48a$0$29978$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: SNIP. Even with a break, why bother continuing through the body of the function when you already have the result? When

Re: Python Interview Questions

2012-08-15 Thread Robert Miles
On 7/10/2012 1:08 PM, Demian Brecht wrote: I also judge candidates on their beards (http://www.wired.com/wiredenterprise/2012/06/beard-gallery/). If the beard's awesome enough, no questions needed. They're pro. You should hire me quickly, then, since I have a beard, already turning partly

Re: lambda in list comprehension acting funny

2012-08-15 Thread Robert Miles
has a version of Python available, in case you're interested. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Some posts do not show up in Google Groups

2012-06-08 Thread Robert Miles
are moving toward newsgroups where no one reports the spam. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Some posts do not show up in Google Groups

2012-06-08 Thread Robert Miles
to discard every post they get that contains any HTML. This may be because Google Groups often adds HTML even if you don't ask for it, and those servers want to avoid the poor signal to noise ratio from Google Groups. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Create directories and modify files with Python

2012-06-08 Thread Robert Miles
- as in 5 minutes after I tell it to post. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Half-baked idea: list comprehensions with while

2012-04-27 Thread Miles Rout
On 27/04/2012 5:57 a.m., Kiuhnm wrote: On 4/26/2012 19:48, Paul Rubin wrote: Roy Smithr...@panix.com writes: x = [a for a in iterable while a] from itertools import takewhile x = takewhile(bool, a) I see that as a 'temporary' solution, otherwise we wouldn't need 'if' inside of list

Re: Strange __import__() behavior

2012-04-26 Thread Frank Miles
On Wed, 25 Apr 2012 23:03:36 +0200, Kiuhnm wrote: On 4/25/2012 22:05, Frank Miles wrote: I have an exceedingly simple function that does a named import. It works perfectly for one file r- and fails for the second x. If I reverse the order of being called, it is still x that fails, and r

Strange __import__() behavior

2012-04-25 Thread Frank Miles
I have an exceedingly simple function that does a named import. It works perfectly for one file r- and fails for the second x. If I reverse the order of being called, it is still x that fails, and r still succeeds. os.access() always reports that the file is readable (i.e. true) If I simply

[issue13405] Add DTrace probes

2011-11-22 Thread Chris Miles
Changes by Chris Miles miles.ch...@gmail.com: -- nosy: -chrismiles ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13405 ___ ___ Python-bugs-list

Re: Complex sort on big files

2011-08-02 Thread Alistair Miles
/recipes/576755-sorting-big-files-the-python-26-way/ -- http://mail.python.org/mailman/listinfo/python-list -- -- Alistair Miles Head of Epidemiological Informatics Centre for Genomics and Global Health http://cggh.org The Wellcome Trust Centre for Human Genetics Roosevelt Drive Oxford OX3 7BN

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-17 Thread Darryl Miles
Darryl Miles darryl.mi...@darrylmiles.org added the comment: With regards to create test cases for certain situations, sure this would be possible but not with pure python since your APIs deny/inhibit the particular things required to force a situation for a test case. With regards

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-11 Thread Darryl Miles
Darryl Miles darryl.mi...@darrylmiles.org added the comment: I am unable to get make test to run from an unpatched version in SVN (details below of make output). Please find attached an updated patch for your consideration (and testing, as I can't test it due to 'make test' SIGSEGV on CentOS

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-11 Thread Darryl Miles
Darryl Miles darryl.mi...@darrylmiles.org added the comment: To explain why you need 2 modes, a client/server would expect to do the following pseudo actions for maximum efficiency: set_socket_timeout(600_SECONDS) # or useful default send_data_over_ssl(QUIT\r\n) shutdown

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-09 Thread Darryl Miles
Darryl Miles darryl.mi...@darrylmiles.org added the comment: In order to build Python with a specific version of OpenSSL followed the CYGWIN instructions and edited Modules/Setup to make it read (note - I added -L$(SSL) into the linker options too, since by default on CentOS 5.4 i386 OpenSSL

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-09 Thread Darryl Miles
Darryl Miles darryl.mi...@darrylmiles.org added the comment: I've updated my attachment to the bug, if you read the old one please re-read the updated version (since some points in there were not accurate). With regards to the OpenSSL error return -1/ERROR_SYSCALL with errno==0 being observed

[issue8108] test_ftplib fails with OpenSSL 0.9.8m

2010-04-09 Thread Darryl Miles
Changes by Darryl Miles darryl.mi...@darrylmiles.org: Removed file: http://bugs.python.org/file16838/python_ssl.c.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8108

Re: Timestamps for TCP packets?

2009-10-02 Thread Miles Kaufmann
don't know of any reason that using sockets and doing a packet capture would interfere with each other. What are you trying to accomplish with the packet sniffing, though? -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: weak reference to bound method

2009-10-02 Thread Miles Kaufmann
= self.im_self() if obj is None: return None return types.MethodType(self.im_func, obj, self.im_class) # could alternately act like a callableproxy -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Are min() and max() thread-safe?

2009-09-17 Thread Miles Kaufmann
On Sep 16, 2009, at 10:39 PM, Steven D'Aprano wrote: On Wed, 16 Sep 2009 22:08:40 -0700, Miles Kaufmann wrote: On Sep 16, 2009, at 9:33 PM, Steven D'Aprano wrote: I have two threads, one running min() and the other running max() over the same list. I'm getting some mysterious results which

Re: Are min() and max() thread-safe?

2009-09-16 Thread Miles Kaufmann
, but not necessarily to your application). But a threaded approach is somewhat silly, since the GIL ensures that they *won't* walk over the same list simultaneously (two separate lists, for that matter). -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: (A Possible Solution) Re: preferred way to set encoding for print

2009-09-16 Thread Miles Kaufmann
, encoding=sys.stdout.encoding, errors='xmlcharrefreplace') http://mail.python.org/pipermail/python-list/2009-August/725100.html -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Why indentation is use to denote block of code?

2009-09-14 Thread Miles Kaufmann
to your code, and can then use those comments to restore the correct indentation to a mangled version. (Most forums offer some sort of whitespace-preserving [code] tag, though; and pindent is relatively old, and apparently not well maintained (no support for with blocks)). -Miles -- http

Re: list as an instance attribute

2009-09-14 Thread Miles Kaufmann
; they couldn't be instantiated directly (from Python code), so you had to call the str() function to create an object of type string. I think there may have been some discussion of renaming the built-ins to match PEP 8 for Python 3, but if so I doubt it got very far. -Miles -- http://mail.python.org

[issue2320] Race condition in subprocess using stdin

2009-09-07 Thread Chris Miles
Changes by Chris Miles miles.ch...@gmail.com: -- nosy: +chrismiles ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2320 ___ ___ Python-bugs-list

[issue5468] urlencode does not handle bytes, and could easily handle alternate encodings

2009-08-31 Thread Miles Kaufmann
Changes by Miles Kaufmann mile...@umich.edu: Removed file: http://bugs.python.org/file14796/urllib_parse.py3k.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5468

Re: Why does this group have so much spam?

2009-08-30 Thread Miles Kaufmann
following it via the python-list@ mailing list. The list owners do a great job of keeping the level of spam at a minimum, though there are occasional false positives (like your post, apparently, since I'm only seeing the replies). -Miles -- http://mail.python.org/mailman/listinfo/python-list

[issue5468] urlencode does not handle bytes, and could easily handle alternate encodings

2009-08-28 Thread Miles Kaufmann
Miles Kaufmann mile...@umich.edu added the comment: I've attached a patch that provides similar functionality to Dan Mahn's urlencode(), as well as providing encoding and errors parameters to parse_qs and parse_qsl, updating the documentation to reflect the added parameters, and adding test

Re: Need help with Python scoping rules

2009-08-27 Thread Miles Kaufmann
and the class namespace, which would be a nightmare of special cases (adding/deleting class attributes? descriptors? __getattr__?) and require an implementation completely separate from that of normal nested scopes. -Miles P.S. Just for fun: import types def make_class(*bases): Decorator

Re: Need help with Python scoping rules

2009-08-27 Thread Miles Kaufmann
On Aug 27, 2009, at 4:49 PM, kj wrote: Miles Kaufmann mile...@umich.edu writes: Guido's design justifications: http://mail.python.org/pipermail/python-dev/2000-November/010598.html Ah! Clarity! Thanks! How did you find this? Did you know of this post already? Or is there some special

Re: Waiting for a subprocess to exit

2009-08-21 Thread Miles Kaufmann
; besides, when I'm putting together a command and its arguments, it's as convenient to build a list (['mycmd', 'myarg']) as it is a string (if not more so). -Miles [1]: http://apple.slashdot.org/article.pl?sid=01/11/04/0412209#comment_2518563 -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Reference question

2009-08-21 Thread Miles Kaufmann
. It sounds like you should either be storing that name as an attribute of the object, or using a dictionary ({'a': a, 'b': b, ...}). -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Skipping a superclass

2009-08-02 Thread Miles Kaufmann
? In a diamond-inheritance situation, you may end up skipping methods besides just B.method(). -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3 and stringio.seek

2009-07-29 Thread Miles Kaufmann
reading of the Python source (and svn history), since it doesn't seem to be documented, so take it with a grain of salt. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble with minidom

2009-07-22 Thread Miles Kaufmann
On Jul 21, 2009, at 8:08 PM, Ronn Ross wrote: Hello I'm trying to read an xml file using minidome. The xml looks like: rootNode project namemyProj/name path/here//path /project /rootNode My code looks like so: from xml.dom.minidom import parse dom = parse(myfile.xml) for

Re: Why not enforce four space indentations in version 3.x?

2009-07-16 Thread Miles Kaufmann
On Jul 15, 2009, at 4:26 PM, David Bolen wrote: Miles Kaufmann mile...@umich.edu writes: On Jul 14, 2009, at 5:06 PM, David Bolen wrote: Are you sure? It seems to restrict them in the same block, but not in the entire file. At least I was able to use both space and tab indented blocks

Re: missing 'xor' Boolean operator

2009-07-15 Thread Miles Kaufmann
the same obvious error ? Try again with: l = [('foo','bar'), ('foo', ''), ('', 'bar'), ('', '')] -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: missing 'xor' Boolean operator

2009-07-15 Thread Miles Kaufmann
? No -- but in the not(not... example it doesn't short-circuit. No; like 'A or B', 'not (not A and not B)' does in fact short-circuit if A is True. (The 'and' condition does not have to evaluate the right operand when 'not A' is False.) -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: python first assignment of a global variable

2009-07-15 Thread Miles Kaufmann
generates bytecode such that all references to that name within the function will be looked up in the local scope only, including those before the assignment statement. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not enforce four space indentations in version 3.x?

2009-07-15 Thread Miles Kaufmann
(without replacing them all), which previously would have been allowed, is now an error. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: missing 'xor' Boolean operator

2009-07-14 Thread Miles Kaufmann
and a) or (not a and b) def xor(*args): return reduce(xor2, args) You may also find this question interesting: http://stackoverflow.com/questions/432842/ -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching control-C

2009-07-09 Thread Miles Kaufmann
in goto fast_next_opcode are ticks. Please correct me if _I'm_ wrong! :) -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: function local namespace question

2009-07-08 Thread Miles Kaufmann
of to directly hook into function namespace access and manipulation. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing parameters for a C program in Linux.

2009-06-30 Thread Miles Kaufmann
On Jun 30, 2009, at 6:46 AM, venutaurus...@gmail.com wrote: I have to write an automted script which will test my c program. That program when run will ask for the commands. Keep in mind that, if your test script checks the program's output before giving it input, you can run into

Re: Regular Expression Non Capturing Grouping Does Not Work.

2009-06-27 Thread Miles Kaufmann
to work. ... Notice that you are calling .group() on the match object instead of .groups(). Without any arguments, .group() is equivalent to .group(0), which means return the entire matching string. http://docs.python.org/library/re.html#re.MatchObject.group -Miles -- http

Re: No trees in the stdlib?

2009-06-27 Thread Miles Kaufmann
and evaluate a dozen different ones. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: No trees in the stdlib?

2009-06-26 Thread Miles Kaufmann
structure in sorted order if it doesn't exist, else retrieve it. That's pretty much the bisect module in a nutshell. It manipulates a sorted list using binary search. With O(n) insertions and removals, though. A decent self-balancing binary tree will generally do those in O(log n). -Miles

Re: urllib2.urlopen issue

2009-06-24 Thread Miles Kaufmann
a similar exception (Name or service not known), the root problem may be a misconfiguration in your /etc/hosts or /etc/ resolv.conf files. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: [Mac] file copy

2009-06-23 Thread Miles Kaufmann
: on dirs ... ok (Important) Verifying: fifo ... ok Verifying: devices ... ok Verifying: combo-tests ... Sub-test: xattrs + rsrc forks ... ok Sub-test: lots of metadata ... ok -Miles -- http://mail.python.org/mailman/listinfo/python

Re: urllib2 content-type headers

2009-06-21 Thread Miles Kaufmann
are added (by AbstractHTTPHandler.do_request_) only if they are missing. -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: generator expression works in shell, NameError in script

2009-06-21 Thread Miles Kaufmann
# are not visible to enclosed functions class Foo(object): bar = ['a', 'b', 'c'] def _gen(_0): for b in _0: yield (bar.index(b), b) baaz = list(_gen(iter(bar)) -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: class or instance method

2009-06-21 Thread Miles Kaufmann
MethodType(self._func, cls if obj is None else obj, cls) -Miles -- http://mail.python.org/mailman/listinfo/python-list

[issue6234] cgi.FieldStorage is broken when given POST data

2009-06-15 Thread Miles Kaufmann
Changes by Miles Kaufmann mile...@umich.edu: -- nosy: +milesck ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6234 ___ ___ Python-bugs-list mailing

[issue5468] urlencode does not handle bytes, and could easily handle alternate encodings

2009-06-15 Thread Miles Kaufmann
Miles Kaufmann mile...@umich.edu added the comment: parse_qs and parse_qsl should also grow encoding and errors parameters to pass to the underlying unquote(). -- nosy: +milesck ___ Python tracker rep...@bugs.python.org http://bugs.python.org

Re: Function/method returning list of chars in string?

2009-06-09 Thread Miles Kaufmann
On Jun 9, 2009, at 6:05 AM, Diez B. Roggisch wrote: Also as list-comps are going away and are replaced by list(generator-expression) Where did you hear that? -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: random number including 1 - i.e. [0,1]

2009-06-09 Thread Miles Kaufmann
floating point number N such that a = N = b for a = b That's wrong. Where did you get it? http://docs.python.org/library/random.html -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Winter Madness - Passing Python objects as Strings

2009-06-06 Thread Miles Kaufmann
you the source. Sounds like di(), which can be written: import _ctypes di = _ctypes.PyObj_FromPtr def can(o): return str(id(o)) def uncan(s): return di(int(s)) http://www.friday.com/bbum/2007/08/24/python-di/ -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: How to check all elements of a list are same or different

2009-04-15 Thread Miles
from itertools import imap def all_same(iterable): it = iter(iterable) return all(imap(partial(eq, it.next()), it)) -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: video capture in Python ? (Tim Roberts)

2009-04-12 Thread Miles Lee
Hi, You could try the python wrapper for OpenCV, here is the link: http://code.google.com/p/ctypes-opencv/ Regards Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Unsupported operand types in if/else list comprehension

2009-04-10 Thread Miles
into the SQL query for you; it will look something like this (though the exact details will vary depending on what module you're using): cursor.execute('INSERT INTO my_table VALUES (?, ?, ?)', ['test',1,'two']) -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding a Badge to an Icon in Mac OS X

2009-04-10 Thread Miles
it is done! I believe those programs are able to do so because they are Finder plugins--it's not something that a separate program could do. This isn't really a Python question, though; you'd probably have better luck finding answers on a OS X-related list. -Miles -- http://mail.python.org/mailman

Re: Why does Python show the whole array?

2009-04-09 Thread Miles
should be illegal. ;) -Miles P.S. ... really, though. -- http://mail.python.org/mailman/listinfo/python-list

Re: more fun with iterators (mux, demux)

2009-04-08 Thread Miles
of the generator that needs it. However, for small n, the tee-based solution has the advantage of having most of the work done in C instead of in Python generator functions; in my limited benchmarking, the point where your version becomes faster is somewhere around n=65. -Miles -- http://mail.python.org

Re: is there a rwlock implementation in python library?

2009-04-08 Thread Miles
://code.activestate.com/recipes/465156/ -Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: more fun with iterators (mux, demux)

2009-04-06 Thread Miles
a tuple of N generators. from itertools import islice, tee def demux(iterable, n): return tuple(islice(it, i, None, n) for (i, it) in enumerate(tee(iterable, n))) -Miles -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >