Re: Adding modified methods from another class without subclassing

2011-08-24 Thread John O'Hagan
On Mon, 22 Aug 2011 20:38:30 +0200 Peter Otten <__pete...@web.de> wrote: > John O'Hagan wrote: > > > On Mon, 22 Aug 2011 11:32:18 +0200 > > Peter Otten <__pete...@web.de> wrote: > > > >> John O'Hagan wrote: > >> > >>

Re: Adding modified methods from another class without subclassing

2011-08-24 Thread John O'Hagan
On Tue, 23 Aug 2011 17:25:22 +1000 Steven D'Aprano wrote: > On Mon, 22 Aug 2011 11:08 pm John O'Hagan wrote: > > > On Mon, 22 Aug 2011 15:27:36 +1000 > > Steven D'Aprano wrote: > [...] > >> # Untested > >> class MySeq(object): &

Re: there is a problem, holp someone could help me,thanks

2011-08-24 Thread John Gordon
you explain how it works? > Thanks for you help. > Vince When a function calls itself, as fib() does, it's called recursion. http://en.wikipedia.org/wiki/Recursion_(computer_science) Basically the fib() method keeps calling itself with smaller and smaller arguments until it gets 1 or 0.

Re: Learning Python

2011-08-24 Thread John Gordon
; Could some one explain it for me? I can't understand how it works. Reposting the exact same question doesn't help us answer it. Perhaps you could explain why the previous responses weren't helpful. -- John Gordon A is for Amy, who fell down the stairs go

Re: is there any principle when writing python function

2011-08-24 Thread Red John
> "We must constantly strive to remove multiplicity from our systems; > lest it consumes us!" > > s/multiplicity/rantingrick/ and I'm in full agreement. QFT -- http://mail.python.org/mailman/listinfo/python-list

How cai i encode url

2011-08-25 Thread John Smithury
Hi pythons. following is my code # -*- coding: utf8 -*- import urllib2 import urllib url = "http://a.shanting.mobi/百家讲坛/大国医/list"; print url p1=u"百家讲坛".encode('utf8') p2=u"大国医".encode('utf8') encodeurl = "http://a.shanting.mobi/"+p1+"/"+p2+"/"+"list"; print encodeurl mp3file = urllib2.urlopen(en

Re: is there any principle when writing python function

2011-08-26 Thread John Gordon
I'm writing a module that needs to fetch user details from an LDAP server, it might be worthwhile to put all of the LDAP-specific code in its own method, even if it's only used once. That way the main module can just contain a line like this: user_info = get_ldap_results("cn=john gord

Re: Unit test failing please help

2011-08-26 Thread John Gordon
, value): > print("setting %s to %s" % (key, repr(value))) > if key in ([]): > self.legs.append(key) > super(Centipede, self).__setattr__(self, key,value) How will this if statement ever be true? You're checking if 'key&#x

Why do closures do this?

2011-08-27 Thread John O'Hagan
return n funcs.append(f) which seems obscure, and a side-effect. My question is, is this an inescapable consequence of using closures, or is it by design, and if so, what are some examples of where this would be the preferred behaviour? Regards, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do closures do this?

2011-08-27 Thread John O'Hagan
On Sun, 28 Aug 2011 00:19:07 -0400 Terry Reedy wrote: > On 8/27/2011 11:45 PM, John O'Hagan wrote: > > Somewhat apropos of the recent "function principle" thread, I was recently > > surprised by this: > > > > funcs=[] > > for n in r

Re: Why I need the parameter when the call doesn't use it?

2011-08-28 Thread John Gordon
wouldn't be able to access instance variable x and it wouldn't be able to call say_hello(). If you have a method that doesn't need to access other variables or methods within the class, you can declare it with the @staticmethod decorator. -- John Gordon A is for

Get reference to parent class from subclass?

2011-08-29 Thread John O'Hagan
class P(): pass class C(P): pass Can I get P from C? IOW, can I get a reference to the object P from the object C? This should be obvious one way or the other, but I haven't been able to find the answer. Regards, John -- http://mail.python.org/mailman/listinfo/python-list

Access LDAP with Django

2011-08-30 Thread John Riselvato
Would Django be a good framework to use if i wanted to take directories of LDAP and make a list of users on a website? I have seen it done in php, but what about trying to manage this with django? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do class methods always need 'self' as the first parameter?

2011-08-31 Thread John Gordon
ge. How would a method access instance variables without 'self'? They probably could have made 'self' a magical attribute that just appears out of thin air instead of being passed as an argument, like 'this' in C++. But would that really provide any benefit? --

Re: try... except with unknown error types

2011-08-31 Thread John Nagle
27;s also possible to get UnicodeError from URL operations. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do class methods always need 'self' as the first parameter?

2011-09-01 Thread John Roth
compiler could determine whether a function was an instance or class method. If it then marked the code object appropriately you could get rid of all of the wrappers and the attendant run-time overhead. I've never published the analysis because that train has already left the shed. The earliest

Re: Why do class methods always need 'self' as the first parameter?

2011-09-02 Thread John Roth
On Sep 1, 8:26 am, Ian Kelly wrote: > On Thu, Sep 1, 2011 at 6:45 AM, John Roth wrote: > > I personally consider this to be a wart. Some time ago I did an > > implementation analysis. The gist is that, if self and cls were made > > special variables that returned the curre

Re: Why do class methods always need 'self' as the first parameter?

2011-09-02 Thread John Roth
On Sep 2, 2:30 pm, Ian Kelly wrote: > On Fri, Sep 2, 2011 at 11:51 AM, John Roth wrote: > >> I don't see how you could get rid of the wrappers.  Methods would > >> still need to be bound, somehow, so that code like this will work: > > >> methods

SSL module needs issuer information

2011-09-03 Thread John Nagle
With the latest flaps about phony cert issuers, it's worth having issuer info available. It was available in the old M2Crypto module, but not in the current Python SSL module. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: One line command line filter

2011-09-06 Thread John Wiegley
>>>>> Jon Redgrave writes: > It seems unreasonably hard to write simple one-line unix command line > filters in python: > eg: ls | python -c " print x.upper()" [...] > Is there a better solution - if not is this worth a PEP? Have you looked at PyP

Re: How to structure packages

2011-09-07 Thread John Gordon
In <2a4f542c-a8c1-46c7-9899-a3fad0940...@x11g2000yqc.googlegroups.com> bclark76 writes: > mypackage > __init__.py > myfunc.py > MyClass.py > from mypackage import MyClass Try this instead: from mypackage.MyClass import MyClass -- John Gordon

Re: 2to3 chokes on bad character

2011-02-24 Thread John Machin
On Feb 23, 7:47 pm, "Frank Millman" wrote: > Hi all > > I don't know if this counts as a bug in 2to3.py, but when I ran it on my > program directory it crashed, with a traceback but without any indication of > which file caused the problem. > [traceback snipped] > UnicodeDecodeError: 'utf8' codec

Re: pattern matching

2011-02-24 Thread John S
On Feb 23, 9:11 pm, monkeys paw wrote: > if I have a string such as '01/12/2011' and i want > to reformat it as '20110112', how do i pull out the components > of the string and reformat them into a DDMM format? > > I have: > > import re > > test = re.compile('\d\d\/') > f = open('test.html')  

Re: 2to3 chokes on bad character

2011-02-24 Thread John Machin
On Feb 25, 12:00 am, Peter Otten <__pete...@web.de> wrote: > John Machin wrote: > > Your Python 2.x code should be TESTED before you poke 2to3 at it. In > > this case just trying to run or import the offending code file would > > have given an informative syntax error

Re: py3k: converting int to bytes

2011-02-24 Thread John Machin
On Feb 25, 4:39 am, Terry Reedy wrote: > Note: an as yet undocumented feature of bytes (at least in Py3) is that > bytes(count) == bytes()*count == b'\x00'*count. Python 3.1.3 docs for bytes() say same constructor args as for bytearray(); this says about the source parameter: """If it is an integ

Did MySQL support ever make it to Python 3.x?

2011-03-01 Thread John Nagle
t's not being used heavily yet, and users are reporting bugs like "broken pipe" errors. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: getting text out of an xml string

2011-03-04 Thread John Machin
On Mar 5, 6:53 am, JT wrote: > Yo, > >  So I have almost convinced a small program to do what I want it to > do.  One thing remains (at least, one thing I know of at the moment): > I am converting xml to some other format, and there are strings in the > xml like this. > > The python: > > elif v ==

Re: What do I need to know in order to write a web application in python?

2011-03-04 Thread John Gordon
ou meant by "real-time". -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- http://mail.python.org/mailman/listinfo/python-list

Re: What do I need to know in order to write a web application in python?

2011-03-04 Thread John Gordon
ent environments do I need to use? You might try learning Tkinter; it is python's standard GUI interface package. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears --

Re: getting text out of an xml string

2011-03-05 Thread John Machin
On Mar 5, 8:57 am, JT wrote: > On Mar 4, 9:30 pm, John Machin wrote: > > > Your data has been FUABARred (the first A being for Almost) -- the > > "\u3c00" and "\u3e00" were once "<" and ">" respectively. You will > > Hi John

Re: how to read the last line of a huge file???

2011-03-05 Thread John Nagle
or CR, both of which are the same in ASCII and UTF-8. Copy the bytes forward from that point into an array of bytes, then apply the appropriate codec. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Extending dict (dict's) to allow for multidimensional dictionary

2011-03-05 Thread John Nagle
yway? You can use a tuple as a subscript: d[1,'abc',40] = 'dummy' Also, at some point, it's time to use a database. If you find yourself writing those "dictionaries" to files, or trying to look up everything with "abc" in the second subscript,

Re: having both dynamic and static variables

2011-03-05 Thread John Nagle
ng, hoisting out of loops, compile time arithmetic, unboxing, etc. Ordinarily, Python compilers have to assume that any variable can be changed at any time from another thread, requiring worst-case code for everything. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: having both dynamic and static variables

2011-03-05 Thread John Nagle
ither inefficient, with a lookup for every use (CPython) or really, really complicated, involving just-in-time compilers, invalidation, recompilation, and a backup interpreter for when things get ugly (PyPy). John Nagle -- http://mail.python.org/mailman/listinfo/p

Re: What do I need to know in order to write a web application in python?

2011-03-06 Thread John Pinner
o edit the code it produces - if you need to extend ui designs, you do this by sub- classing. > On a side note, you should check out pygui[0]- very, very nice GUI toolkit. Yay, looks good. Thanks, Greg. John -- -- http://mail.python.org/mailman/listinfo/python-list

Re: ImSim: Image Similarity

2011-03-06 Thread John Bokma
either its title Title: TinEye, author: http://ideeinc.com/ Search: http://www.tineye.com/ Example: http://www.tineye.com/search/2b3305135fa4c59311ed58b41da5d07f213e4d47/ Notice how it finds modified images. -- John Bokma j3b Blo

Re: ImSim: Image Similarity

2011-03-06 Thread John Bokma
n00m writes: > On Mar 6, 10:17 pm, n00m wrote: >> On Mar 6, 8:55 pm, John Bokma wrote: >> >> >> >> > n00m writes: >> > >http://www.nga.gov/search/index.shtm >> > >http://deyoung.famsf.org/search-collections >> > &g

Re: ImSim: Image Similarity

2011-03-06 Thread John Bokma
#x27;s Usenet, something I've been using for, oh, just over 20 years now, and even then it was not new. You know, before the web thing you're talking about... -- John Bokma j3b Blog: http://johnbokma.com/Facebook: http

Re: multiprocessing module in async db query

2011-03-08 Thread John Nagle
t;Streaming" out to a network connection while still reading from the database is undesirable. If you're doing really big SELECTs, consider using LIMIT and OFFSET in SQL to break them up into smaller bites. Especially if the user is paging through the results.

Re: I found some very odd behaviour in Python's very basic types

2011-03-10 Thread John Roth
the way that Python works. Literals are handled during compilation; the built-in types are run-time objects. Python is not a language where a script can change compile-time behavior. Doing that would make it a very different language, and would put it into a very different niche in the language ecology

Re: Passing Functions

2011-03-11 Thread John Nagle
variables. You need class Node: def __init__(self) : self.distFromSource = infinity self.previous = invalid_node self.visited = False John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Compile time evaluation of dictionaries

2011-03-11 Thread John Nagle
CPython barely evaluates anything at compile time. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a very simple revision system for photos in python

2011-03-11 Thread John Nagle
e owner of those files. You need to say what goes into a build of a game, or a revision of a manufactured product. You also need really good tools to show the differences between revisions. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: attach to process by pid?

2011-03-11 Thread John Nagle
ays to do that, both on the same machine and across a network. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Get Path of current Script

2011-03-14 Thread John Gordon
and record their answer -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2exe problem with pyqt+matplotlib

2011-03-15 Thread John Posner
r > > Obviously Tkinter is not imported since I'm using pyqt, so can anyone > point me out what I'm doing wrong? > Thanks in advance! PyQt doesn't use Tkinter, but matplotlib does! -John -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory Usage of Strings

2011-03-16 Thread John Gordon
4 1250 1125 1-1 1 5 1000 1000 grand total chars 23024400 The two loops do not produce the same numbers of characters, so I'm not surprised they do not consume the same amount of

Re: Coding and Decoding in Python

2011-03-17 Thread John Gordon
different, but surely that won't always be the case with real data. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"

Re: Coding and Decoding in Python

2011-03-17 Thread John Gordon
rt is for making the > program understandable and printing understandable error messages. I see. You're storing integer equivalents for the labels themselves, not the actual data associated with the labels. Then Mel's solution is a good one -- construct a second dict which has the k

Re: value of pi and 22/7

2011-03-18 Thread John Gordon
In <8uh0rcfe1...@mid.individual.net> Neil Cerutti writes: > RIIght. What's a cubit? How long can you tread water? -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assa

Re: send function keys to a legacy DOS program

2011-03-19 Thread John Nagle
software emulator for an x86 machine running DOS. So you can go into the emulator and connect to the "keyboard" or "screen" from another program. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: reimport module every n seconds

2011-03-20 Thread John Nagle
"re.compile", not when .pyc files are generated. You can call "re.compile" on strings read from an external source without loading a new module. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Problem with re module

2011-03-22 Thread John Harrington
, how can I write a regex that matches what I wish to match, as described above? Many thanks, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with re module

2011-03-22 Thread John Bokma
John Harrington writes: > I'm trying to use the following substitution, > > lineList[i]=re.sub(r'(\\begin{document})([^$])',r'\1\n\n > \2',lineList[i]) > > I intend this to match any string "\begin{document}" that doesn't end >

Re: Problem with re module

2011-03-22 Thread John Harrington
On Mar 22, 11:16 am, John Bokma wrote: > John Harrington writes: > > I'm trying to use the following substitution, > > >      lineList[i]=re.sub(r'(\\begin{document})([^$])',r'\1\n\n > > \2',lineList[i]) > > > I intend this to match an

Re: Problem with re module

2011-03-22 Thread John Harrington
On Mar 22, 12:07 pm, Benjamin Kaplan wrote: > On Tue, Mar 22, 2011 at 2:40 PM, John Harrington > > > > wrote: > > On Mar 22, 11:16 am, John Bokma wrote: > >> John Harrington writes: > >> > I'm trying to use the following substitution, >

Re: having both dynamic and static variables

2011-03-22 Thread John Ladasky
On Mar 5, 9:44 pm, John Nagle wrote: >     All functions in Python can be replaced dynamically. While they're > running. From another thread.  Really. Indeed, and I find this feature VERY useful when coding. Two places I've used it are: 1) in GUI coding (say, when I have a

Re: side by side python

2011-03-23 Thread John Roth
an use Python2 for scripts that require 2.7, and Python3 for scripts that require 3.2, and they'll eventually be portable to other systems. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 - not returning page expected after post

2011-03-23 Thread John Nagle
On 3/23/2011 5:14 AM, David Feyo wrote: I'm trying to automate reverse-ip lookups on domaintools.com. Sign up for their API. They charge the same as for web lookups. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Free Software University - Python Certificate

2011-03-23 Thread Red John
> To me all this does not look professional for somebody who want to > attract students / instructors I'm a big fan of the Menu containing a (useless) link to First Menu Item -- http://mail.python.org/mailman/listinfo/python-list

Re: "in house" pypi?

2011-03-24 Thread John Nagle
roval process, and can be downloaded and installed in a standard way. "easy_install" generally isn't easy. It has some built-in assumptions about where things are stored, assumptions which often don't hold true. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing to a file

2011-03-25 Thread John Gordon
much better. (However, I'm not sure it will do what you were expecting with the tilde in the file path.) -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gor

Re: Dump interpreter history?

2011-03-25 Thread John Gordon
e a file named "typescript" containing all of the input and output which occurred. -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- http://mail.python.org/mailman/listinfo/python-list

Why aren't copy and deepcopy in __builtins__?

2011-03-27 Thread John Ladasky
Simple question. I use these functions much more frequently than many others which are included in __builtins__. I don't know if my programming needs are atypical, but my experience has led me to wonder why I have to import these functions. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why aren't copy and deepcopy in __builtins__?

2011-03-28 Thread John Ladasky
On Mar 28, 2:25 am, Andrea Crotti wrote: > John Ladasky writes: > I almost never use them either, maybe also in many cases you could avoid > using them... > When for example you use them? To take one example: neural network programming. I construct a network object (which is q

Python problem

2011-03-28 Thread John Parker
Hi All, I'm trying to figure out a problem in which I have a file named scores.txt that contains the following information. Jane Doe,87,92,97,33 John Doe,78,91,84,25 Bill Gates,91,88,89,56 Bruce Perens,88,92,84,99 I'm wanting to read the file and create two lists: names and score

Re: Python problem

2011-03-28 Thread John Parker
Ethan, Thanks for pointing that out. I commented that code out and then ran it. It created the list of names. Now, I just need to figure out how to get the scores into the list called scores. It would appear that this is done with a nested for loop. Thanks, John On 3/28/11 12:02 PM

Re: Python problem

2011-03-28 Thread John Parker
Dear all, This is the solution that I came up with to deal with handling the file of scores. Thank you all for your feedback! John # define calc average function def calcAve(mylist): total = 0 count = 0 for i in range (0, len(mylist)): # count scores for even number items in

Re: Non-deterministic output

2011-03-29 Thread John Nagle
u're using. If you're stil stuck, give us the list of non-Python modules you're importing, directly or indirectly. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Get USB ID of a serial port through pyserial?

2011-03-30 Thread John Nagle
#x27;s out there. Is there a way to get that info portably? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: running Python2 Python3 parallel concurrent

2011-03-31 Thread John Roth
stems. PEP 397 is a first cut at doing the same thing for Windows. Regards, John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: call php function from python

2011-03-31 Thread John Bokma
tall, use the post method with the right data and the right URL. -- John Bokma j3b Blog: http://johnbokma.com/Facebook: http://www.facebook.com/j.j.j.bokma Freelance Perl & Python Development: http://castleamber.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread John Bokma
Chris Angelico writes: > On Fri, Apr 1, 2011 at 8:57 AM, geremy condra wrote: >> I know it's tongue-in-cheek, but please, please, please don't do this. > > It would be more secure to base64 it and then rot13 the output. Rot-13 twice, to make it even more se

Re: ValueError: need more than 2 values to unpack

2011-04-01 Thread John Nagle
t) = errorentry # try to unpack except ValueError as message : # unpack failed raise(ValueError("%s: bogus entry in 'errors': %s" % (message, repr(errorentry ... John Nagl

Re: Python CPU

2011-04-01 Thread John Nagle
xternal devices in Python is useful.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido rethinking removal of cmp from sort method

2011-04-01 Thread John Bokma
gt; 3. But if you had any idea what you were talking about, you already knew that. -- John Bokma j3b Blog: http://johnbokma.com/Facebook: http://www.facebook.com/j.j.j.bokma Freelance Perl & Python Development: http:/

Re: Extracting "true" words

2011-04-01 Thread John Nagle
(See "http://www.dokidoki6.com/00_index1.html";. Caution, excessively cute.) Each ideograph is a "word", of course. Parse this into words: ★12/25/2009★ 6%DOKIDOKI VISUAL FILE vol.4を公開しました。 アルバムの上部で再生操作、下部でサムネイルがご覧いただけます。 John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: a basic bytecode to machine code compiler

2011-04-02 Thread John Nagle
onfiguration. Now freeze the code." At that moment, all the global analysis and compiling takes place. This allows getting rid of the GIL and getting real performance out of multithread CPUs. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-03 Thread John Nagle
th the hardware tagging helping with dispatch. But it probably wouldn't help all that much. It didn't in the LISP machines. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-03 Thread John Nagle
PU with a separate return point stack with a depth of 20. Big mistake. (All of this is irrelevant to Python, though. Most of Python's speed problems come from spending too much time looking up attributes and functions in dictionaries.) John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Python CPU

2011-04-04 Thread John Nagle
On 4/4/2011 12:47 AM, Gregory Ewing wrote: John Nagle wrote: A tagged machine might make Python faster. You could have unboxed ints and floats, yet still allow values of other types, with the hardware tagging helping with dispatch. But it probably wouldn't help all that much. It didn

Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread John Ladasky
Hi folks, I'm developing some custom neural network code. I'm using Python 2.6, Numpy 1.5, and Ubuntu Linux 10.10. I have an AMD 1090T six-core CPU, and I want to take full advantage of it. I love to hear my CPU fan running, and watch my results come back faster. When I'm training a neural net

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-05 Thread John Ladasky
Hi Philip, Thanks for the reply. On Apr 4, 4:34 pm, Philip Semanchuk wrote: > So if you're going to use multiprocessing, you're going to use pickle, and you > need pickleable objects. OK, that's good to know. > > Pickling is still a pretty > > vague progress to me, but I can see that you have

Re: is python 3 better than python 2?

2011-04-05 Thread John Nagle
e out of the hundred-odd Unicode character sets is going to be foreign,) and generally internationalized data processing. Well, actually Unicode support went in back around Python 2.4. In 3.x, ASCII strings went away, but that was more of a removal. John

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-06 Thread John Ladasky
Hello again, Philip, I really appreciate you sticking with me. Hopefully this will help someone else, too. I've done some more reading, and will offer some minimal code below. I've known about this page for a while, and it describes some of the unconventional things one needs to consider when s

Hack SkyPe Account 2.1

2011-04-07 Thread John Carenal
Hi EveryBody This Program To Hack Sky Pe Account Just Paste A Email For Sky Pe And Click (Get Pass) Yeah Its True Try It Its Free From Here http://www.4shared.com/file/wFtoiI7z/Promar_Hack_Skype_21.html Download Now -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread John Ladasky
Following up to my own post... On Apr 6, 11:40 pm, John Ladasky wrote: > What's up with that? Apparently, "what's up" is that I will need to implement a third method in my ndarray subclass -- namely, __reduce__. http://www.mail-archive.com/numpy-discussion@scipy.org/ms

feedparser vs. network errors - something remembers that net was down.

2011-04-07 Thread John Nagle
IOError("of network or news source failure") is raised. Looking in feedeparser.py, "parse" calls "_open_resource", which, after much fooling around, builds a urllib2 request, builds an "opener" via urllib2, and calls its "open" method. So I'm not see

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread John Ladasky
On Apr 7, 10:44 am, Robert Kern wrote: > On 4/7/11 1:40 AM, John Ladasky wrote: > > > On Apr 5, 10:43 am, Philip Semanchuk  wrote: > >> And as Robert Kern pointed out, numpy arrays are also pickle-able. > > > OK, but SUBCLASSES of numpy.ndarray are not, in my hands,

Copy-on-write when forking a python process

2011-04-08 Thread John Connor
Hi all, Long time reader, first time poster. I am wondering if anything can be done about the COW (copy-on-write) problem when forking a python process. I have found several discussions of this problem, but I have seen no proposed solutions or workarounds. My understanding of the problem is that

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-09 Thread John Ladasky
On Apr 7, 6:10 pm, sturlamolden wrote: > On 8 apr, 02:38, sturlamolden wrote: > > > I should probably fix it for 64-bit now. Just recompiliong with 64-bit > > integers will not work, because I intentionally hardcoded the higher > > 32 bits to 0. > > That was easy, 64-bit support for Windows is do

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-09 Thread John Ladasky
On Apr 9, 10:15 am, sturlamolden wrote: > On 9 apr, 09:36, John Ladasky wrote: > > > Thanks for finding my discussion!  Yes, it's about passing numpy > > arrays to multiple processors.  I'll accomplish that any way that I > > can. > > My preferred ways

Re: Retrieving Python Keywords

2011-04-09 Thread John Connor
Actually this is all it takes: import keywords print keywords.kwlist --jac On Sat, Apr 9, 2011 at 8:57 PM, Chris Angelico wrote: > On Sun, Apr 10, 2011 at 11:28 AM, candide wrote: >> Python is very good at introspection, so I was wondering if Python (2.7) >> provides any feature to retrieve the

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-10 Thread John Nagle
ork" (if you're on a *nix machine). See http://pythonwise.blogspot.com/2009/04/pmap.html for example ;) Unless you have a performance problem, don't bother with shared memory. If you have a performance problem, Python is probably the wrong tool for the job anyway.

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-11 Thread John Nagle
On 4/10/2011 3:29 PM, sturlamolden wrote: On 10 apr, 18:27, John Nagle wrote: Unless you have a performance problem, don't bother with shared memory. If you have a performance problem, Python is probably the wrong tool for the job anyway. Then why does Python h

Re: Do UART require data structure/format for serial communication?

2011-04-11 Thread John Nagle
either end restarting, and the other end failing to respond. All those things happen frequently with serial ports. What do you want to do? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Dump interpreter history?

2011-04-11 Thread John Gordon
ne argument which is the name of the file to be written." -- John Gordon A is for Amy, who fell down the stairs gor...@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies" -- http://mail.python.org/mailman/listinfo/python-list

Re: Feature suggestion -- return if true

2011-04-12 Thread John Roth
uldn't want a returnif in a loop. Following on with this idea, loop control would be more of a breakif or continueif statement. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Postmortem on Unladen Swallow

2011-04-13 Thread John Nagle
There's a postmortem on the failure of Unladen Swallow by one of the developers at: http://qinsb.blogspot.com/2011/03/unladen-swallow-retrospective.html John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Egos, heartlessness, and limitations

2011-04-13 Thread John Ladasky
I may regret wading into a flame-war, but... I got started with Python in 2002. I took one look at TKinter, said "yuck!", and went searching for something else. Now, wxPython is a bit clunky for a Python programmer because of its strong ties to C++ -- but that's what I chose, and it has served m

<    2   3   4   5   6   7   8   9   10   11   >