Re: Python's handling of unicode surrogates

2007-04-19 Thread Rhamphoryncus
(Sorry for the dupe, Martin. Gmail made it look like your reply was in private.) On 4/19/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Thoughts, from all you readers out there? For/against? > > See PEP 261. This things have all been discussed at that time, > and an explicit decision again

Re: using tkinter to display html

2007-04-19 Thread Glenn Hutchings
On 20 Apr, 02:54, "Stephen M. Gava" <[EMAIL PROTECTED]> wrote: > yeah. i feel like i'm being forced to use wxwidgets/wxpython just because > i need pretty good html display though. You could always use a real web browser: import webbrowser webbrowser.open_new("index.html") Glenn -- htt

Re: Python's handling of unicode surrogates

2007-04-19 Thread Rhamphoryncus
On Apr 19, 11:02 pm, Neil Hodgson <[EMAIL PROTECTED]> wrote: > Adam Olsen: > > > To solve this I propose Python's unicode type using UTF-16 should have > > gaps in its index, allowing it to only expose complete unicode scalar > > values. Iteration would produce surrogate pairs rather than > > indi

Re: Can I place a question on the mailing list

2007-04-19 Thread rishi pathak
Any one can post if it's regarding python On 4/20/07, chachou martel juvet <[EMAIL PROTECTED]> wrote: Good Morning Dear Sir , I will like you allowing me to place question on the web. Kind Regards: Martel. -- *All new Yahoo! Mail - *

Can I place a question on the mailing list

2007-04-19 Thread chachou martel juvet
Good Morning Dear Sir , I will like you allowing me to place question on the web. Kind Regards: Martel. - All new Yahoo! Mail - - Get a sneak peak at messages with a handy reading pane.-- http://mail

Re: List of Objects

2007-04-19 Thread 7stud
On Apr 19, 9:18 pm, Paddy <[EMAIL PROTECTED]> wrote: > > # create a list of instances > gazelles= [ Gazelle() for x in range(5)] > Nice. I knew there had to be a way to use a list comprehension, but I couldn't figure it out. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's handling of unicode surrogates

2007-04-19 Thread Martin v. Löwis
> Thoughts, from all you readers out there? For/against? See PEP 261. This things have all been discussed at that time, and an explicit decision against what I think (*) your proposal is was taken. If you want to, you can try to revert that decision, but you would need to write a PEP. Regards,

Re: Better dict of dicts

2007-04-19 Thread Martin v. Löwis
> Now suppose there is little overlap between the keys for the outer > dictionary and the inner dictionaries...but still much overlap between > the various inner dictionaries. Then, there is no point in using an > intern function for the outer dictionary, but still a benefit for the > inner dictio

Re: HTTP getreply() never returns

2007-04-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 19, 2:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> Hi, >>> I have the following code which send/receive HTTP request/response: >>># where sampleUrl is '127.0.0.1' and >>># url is 'www.cnn.com' >>>h = httplib.HTTP(self.s

Re: Python's handling of unicode surrogates

2007-04-19 Thread Neil Hodgson
Adam Olsen: > To solve this I propose Python's unicode type using UTF-16 should have > gaps in its index, allowing it to only expose complete unicode scalar > values. Iteration would produce surrogate pairs rather than > individual surrogates, indexing to the first half of a surrogate pair > woul

Re: Python un-plugging the Interpreter

2007-04-19 Thread Steve Holden
Alex Martelli wrote: > Steve Holden <[EMAIL PROTECTED]> wrote: > >> A long time ago Greg Stein produced a patch that removed the need for >> the GIL, but nobody seemed to want to pay the penalty it extracted in >> speed reduction, so it languished unadopted. > > Perhaps the current wave of dual-c

Re: List of Objects

2007-04-19 Thread Steve Holden
Steven D'Aprano wrote: [...] > > Forth method: create identical gazelles, then modify them: > > list_of_beasties = [Gazelle(defaults) for i in xrange(1000)] > for i, beastie in enumerate(xrange(1000)): > list_of_beasties[i] = modify(beastie) > Nope, 'sorry, that's Python a's well. Forth u'se

Re: Calculating CIDR blocks

2007-04-19 Thread Pekka Järvinen
On 20 huhti, 04:32, Pekka Järvinen <[EMAIL PROTECTED]> wrote: > # I have list of free IP addresses. One IP per line. Now I'm trying to > # share them to CIDR blocks /24 - /32. For example: if 1.1.1.0 - > 1.1.1.255 > # is free, it returns list['1.1.1.0/24'] but let's say that 1.1.1.1 is > # used, th

Re: Do other Python GUI toolkits require this?

2007-04-19 Thread Nigel Rowe
On Thu, 19 Apr 2007 19:11, Antoon Pardon wrote in comp.lang.python: > On 2007-04-19, Michael Bentley <[EMAIL PROTECTED]> wrote: >> The learning curve is rather steep IMO, but worth it. > > Just a throw in remark, that you may ignore if you wish, but a steep > learning curve means that the subj

Re: Python Feature Request: Explicit variable declarations

2007-04-19 Thread Alex Martelli
Jorgen Grahn <[EMAIL PROTECTED]> wrote: > As a C and C++ programmer (not a C/C++ programmer), I have to say that Yeah, I wonder, what's C divided by C++ -- maybe about 0.731...? Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: Better dict of dicts

2007-04-19 Thread DillonCo
On Thursday 19 April 2007, Paddy wrote: > Martins earlier local_intern function would work for tuples as well as > strings. It certainly would. I had written that class, though, primarily to offer a performance improvement in the __eq__ and perhaps __hash__ methods. However, I ended up being r

Re: Python un-plugging the Interpreter

2007-04-19 Thread Alex Martelli
Steve Holden <[EMAIL PROTECTED]> wrote: > A long time ago Greg Stein produced a patch that removed the need for > the GIL, but nobody seemed to want to pay the penalty it extracted in > speed reduction, so it languished unadopted. Perhaps the current wave of dual-core and quad-core CPUs in cheap

Re: Python un-plugging the Interpreter

2007-04-19 Thread Alex Martelli
Michael Hoffman <[EMAIL PROTECTED]> wrote: > S.Mohideen wrote: > > > I was thinking about the feasbility of adjusting Python as a > > compiled language. > > In addition to the Python compilers listed by Steve, there is also > Pyrex, which translates a Python-like language to C, and allo

Re: What makes an iterator an iterator?

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 20:00:31 -0700, Alex Martelli wrote: > class sane(object): > def __init__(self, sentence='four scores and twenty years ago'): > def agenerator(): > for word in sentence.split(): yield word > self._thegen = agenerator() > def __iter__(self): r

Re: List of Objects

2007-04-19 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Howdy, a (possibly) quick question for anyone willing to listen. > I have a question regarding lists and Classes; I have a class called It looks you don't really want what you're saying: you appear to want a list of INSTANCES of one class, *NOT* a list of CLASSES. E.

Re: Compare regular expressions

2007-04-19 Thread Charles Sanders
Thomas Dybdahl Ahle wrote: > Hi, I'm writing a program with a large data stream to which modules can > connect using regular expressions. > > Now I'd like to not have to test all expressions every time I get a line, > as most of the time, one of them having a match means none of the others > ca

Re: comparison with None

2007-04-19 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > But if you wanted to do extra work unnecessarily, a less unnecessary > amount of extra work would be: > > if type(x) == type(None): ... Of course, like the original poster's proposal, this CAN be faked out (while the 'is' test cannot, one more weird r

Re: List of Objects

2007-04-19 Thread [EMAIL PROTECTED]
These methods work. I didn't think I could create a list of objects like that, however, I stand corrected. Thanks for your quick (and helpful) responses! On Apr 19, 11:22 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 19 Apr 2007 19:58:35 -0700, datamonkey.ryan wrote: > > Howdy, a (poss

Re: List of Objects

2007-04-19 Thread Mel Wilson
[EMAIL PROTECTED] wrote: > Howdy, a (possibly) quick question for anyone willing to listen. > I have a question regarding lists and Classes; I have a class called > "gazelle" with several attributes (color, position, etc.) and I need > to create a herd of them. I want to simulate motion of individu

Re: List of Objects

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 19:58:35 -0700, datamonkey.ryan wrote: > Howdy, a (possibly) quick question for anyone willing to listen. > I have a question regarding lists and Classes; I have a class called > "gazelle" with several attributes (color, position, etc.) and I need > to create a herd of them. I

Re: List of Objects

2007-04-19 Thread DillonCo
On Thursday 19 April 2007, [EMAIL PROTECTED] wrote: > Howdy, a (possibly) quick question for anyone willing to listen. > I have a question regarding lists and Classes; I have a class called > "gazelle" with several attributes (color, position, etc.) and I need > to create a herd of them. I want to

Re: List of Objects

2007-04-19 Thread Paddy
On Apr 20, 3:58 am, [EMAIL PROTECTED] wrote: > Howdy, a (possibly) quick question for anyone willing to listen. > I have a question regarding lists and Classes; I have a class called > "gazelle" with several attributes (color, position, etc.) and I need > to create a herd of them. I want to simulat

Re: List of Objects

2007-04-19 Thread 7stud
[EMAIL PROTECTED] wrote: > > However, Python doesn't support pointers As I understand it, every name in Python is a pointer. class Gazelle(object): def __init__(self): self.x = 0 g_list =[] for x in range(10): g_list.append(Gazelle()) for g in g_list: g.x = 10 print g_list[

Re: Better dict of dicts

2007-04-19 Thread Paddy
On Apr 20, 1:38 am, DillonCo <[EMAIL PROTECTED]> wrote: > On Thursday 19 April 2007, Bill Jackson wrote: > > > Martin v. Löwis wrote the following on 04/19/2007 02:43 PM: > > > Bill Jackson schrieb: > > >> I have a dictionary of dictionaries where the keys are typically very > > >> long tuples and

Re: comparison with None

2007-04-19 Thread Alex Martelli
Alan Isaac <[EMAIL PROTECTED]> wrote: > currently documented behavior: > "objects of different types always compare unequal". Where is that documented? URL please? >>> 1.0 == 1 True >>> type(1.0), type(1) (, ) here, just as an example, are two objects of different types that compare equal; the

Re: What makes an iterator an iterator?

2007-04-19 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > Calling a generator, such as this next method, returns an iterator > > object; calling it repeatedly returns many such iterator objects, and > > never raises StopIteration, thus obviously producing an unending loop. > > Thank you for that answer Alex

Re: What makes an iterator an iterator?

2007-04-19 Thread Alex Martelli
7stud <[EMAIL PROTECTED]> wrote: ... > > repeatedly calls[type(_t).next(t)] > > As far as I can tell, if the call was actually _t.next(), the code I > asked about would work. However, the name look up for 'next' when you All of your following lamentations are predicated on this assumptio

List of Objects

2007-04-19 Thread datamonkey . ryan
Howdy, a (possibly) quick question for anyone willing to listen. I have a question regarding lists and Classes; I have a class called "gazelle" with several attributes (color, position, etc.) and I need to create a herd of them. I want to simulate motion of individual gazelles, but I don't want to

Re: How To Find Currently Selected Tile.Notebook Tab?

2007-04-19 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > How can I determine what tab is currently selected in a Tile.Notebook > widget? > > The best suggestion I've been able to find via Google is > "mynotebook.index('current')", but that gets an exception from Tcl. > > Any ideas? > > -- Brian > How about mynotebook.index

Re: matplotlib basic question

2007-04-19 Thread Rob Clewley
On 19 Apr 2007 16:13:43 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > So, first off, what's up with the [ > at 0x017C38C8>] line that shows up after my plot command? And second, > > when I call show(), a new figure pops up with my sin wave -- seems all > > right, yes? But I'm not given

Re: class __getitem__ when item is not a sequence ???

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 16:47:55 -0700, cfriedalek wrote: > Sorry for the vague subject. Not sure what the right terminology is. > > How can I use an instance's data by reference to the instance name, > not the instance attribute? OK the question is probably really poor > but hopefully an example wil

How To Find Currently Selected Tile.Notebook Tab?

2007-04-19 Thread [EMAIL PROTECTED]
How can I determine what tab is currently selected in a Tile.Notebook widget? The best suggestion I've been able to find via Google is "mynotebook.index('current')", but that gets an exception from Tcl. Any ideas? -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython and how to return text entry to main program?

2007-04-19 Thread Steve Holden
7stud wrote: > On Apr 19, 1:38 pm, Tyler <[EMAIL PROTECTED]> wrote: [after quoting umpteen lines of code] > > You can do this: > > --- > class MyFrame(wx.Frame): > > .. > .. > .. > def OnSubmit(self, event): > globals()["userInput"] = self.txtCtrlName.GetValue() > self.Clos

Re: What makes an iterator an iterator?

2007-04-19 Thread Steve Holden
7stud wrote: > On Apr 19, 5:37 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> It's nothing to do with the name lookup. Alex mentioned that to remind >> us that the magic "double-under" names are looked up on the type rather >> than the instance... > > P.next() > > vs. > > type(P).next() > > Whe

Re: wxPython and how to return text entry to main program?

2007-04-19 Thread Tyler
Thanks everyone for your help! Cheers, t. -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonD 2.4.2 for older Windows / DOS / DJGPP

2007-04-19 Thread Steve Holden
caddit wrote: > Steve Holden wrote: > >> caddit wrote: >>> Hello. >>> >>> There has been some confusion as to the current version of the python >>> programming language available for DOS. >>> >>> This is partially due to incorrect information kept on python.org, that >>> says "python2.2.1 availabl

Re: using tkinter to display html

2007-04-19 Thread Stephen M. Gava
On Thu, 19 Apr 2007 06:09:33 -0700, kyosohma wrote: > On Apr 19, 6:29 am, "Stephen M. Gava" <[EMAIL PROTECTED]> > wrote: >> Hi all, >> >> I prefer using tkinter to wxpython (so sue me :) and i need to display >> a lot of html in a particular app. does anyone know if one of the >> existing add on t

Re: PythonD 2.4.2 for older Windows / DOS / DJGPP

2007-04-19 Thread caddit
Steve Holden wrote: > caddit wrote: >> Hello. >> >> There has been some confusion as to the current version of the python >> programming language available for DOS. >> >> This is partially due to incorrect information kept on python.org, that >> says "python2.2.1 available for DOS". The actual v

Calculating CIDR blocks

2007-04-19 Thread Pekka Järvinen
# I have list of free IP addresses. One IP per line. Now I'm trying to # share them to CIDR blocks /24 - /32. For example: if 1.1.1.0 - 1.1.1.255 # is free, it returns list['1.1.1.0/24'] but let's say that 1.1.1.1 is # used, then function should return list['1.1.1.128/25', # '1.1.1.127/26', '1.1.1.

Re: wxPython and how to return text entry to main program?

2007-04-19 Thread 7stud
On Apr 19, 1:38 pm, Tyler <[EMAIL PROTECTED]> wrote: > Hello All: > > I am currently working on a project to create an FEM model for school. > I was thinking about using wxPython to gather the 12 input variables > from the user, then, after pressing the "Run" button, the GUI would > close, and the

Re: Better dict of dicts

2007-04-19 Thread DillonCo
On Thursday 19 April 2007, Bill Jackson wrote: > Martin v. Löwis wrote the following on 04/19/2007 02:43 PM: > > Bill Jackson schrieb: > >> I have a dictionary of dictionaries where the keys are typically very > >> long tuples and repeated in each inner dictionary. > > > > What I don't understand h

Re: PY shutil on win xp home version

2007-04-19 Thread jim-on-linux
On Wednesday 18 April 2007 17:02, Tim Golden wrote: > jim-on-linux wrote: > > python help, > > > > A client is using win xp home. > > > > my program contains; > >shutil.copyfile(n, 'prn') > > > > This runs fine on win xp pro but they are > > getting the following traceback. > > > > File "LOP

class __getitem__ when item is not a sequence ???

2007-04-19 Thread cfriedalek
Sorry for the vague subject. Not sure what the right terminology is. How can I use an instance's data by reference to the instance name, not the instance attribute? OK the question is probably really poor but hopefully an example will make it clear. > x=1 > type(x) > x.__add__(1) 2 > print x 1 >

Re: Nested dictionaries trouble

2007-04-19 Thread IamIan
Thank you again for the great suggestions. I have one final question about creating a httpMonths dictionary like {'Jan':'01' , 'Feb':'02' , etc} with a minimal amount of typing. My code follows (using Python 2.3.4): import calendar # Create years list, formatting as strings years = map(str, xrang

Python's handling of unicode surrogates

2007-04-19 Thread Adam Olsen
As was seen in another thread[1], there's a great deal of confusion with regard to surrogates. Most programmers assume Python's unicode type exposes only complete characters. Even CPython's own functions do this on occasion. This leads to different behaviour across platforms and makes it unneces

python-list@python.org

2007-04-19 Thread attn . steven . kuo
On Apr 19, 3:37 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > Anton Vredegoor wrote: > > Maybe this one is better? > > No, this one keeps generating output. > > But this one stops at least: > > from collections import deque > from itertools import chain, repeat > > def xsplitter(seq, pred): >

Re: comparison with None

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 17:00:29 +, Alan Isaac wrote: > > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> You shouldn't expect comparisons between types to >> sort the same from one version of Python to another, although they may, >> and in the future (Python 3)

Re: matplotlib basic question

2007-04-19 Thread cfriedalek
> So, first off, what's up with the [ at 0x017C38C8>] line that shows up after my plot command? And second, > when I call show(), a new figure pops up with my sin wave -- seems all > right, yes? But I'm not given another >>> prompt in IDLE until or > unless I close the figure that popped up with

Re: Better dict of dicts

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 17:40:27 -0400, John Bauman wrote: > Adam Atlas wrote: >> On Apr 19, 5:24 pm, Bill Jackson <[EMAIL PROTECTED]> wrote: >>> I have a dictionary of dictionaries where the keys are typically very >>> long tuples and repeated in each inner dictionary. The dictionary >>> representat

Re: Better dict of dicts

2007-04-19 Thread Bill Jackson
Martin v. Löwis wrote the following on 04/19/2007 02:43 PM: > Bill Jackson schrieb: >> I have a dictionary of dictionaries where the keys are typically very >> long tuples and repeated in each inner dictionary. > > What I don't understand here: you say the keys are tuples, yet later, > you show t

Re: Significance of "start" parameter to string method "endswith"

2007-04-19 Thread Steven D'Aprano
On Thu, 19 Apr 2007 13:57:16 -0700, Boris Dusek wrote: >> > what is the use-case of parameter "start" in string's "endswith" >> > method? > >> def foo(function,instance,param): >> if function(instance,param,2,4): >> return True >> else: return False >> >> The function must work wh

Re: wxPython and how to return text entry to main program?

2007-04-19 Thread Tyler
Hi Mike: I actually just picked up the wxPython in Action book the other day and my main class is a hack of his "realworld_print.py" program, with some added bells and whistles. I will try to post on the wxPython mailing list and let them have a go at it. Cheers, tyler -- http://mail.python.o

Re: wxPython and how to return text entry to main program?

2007-04-19 Thread Steve Holden
Tyler wrote: > Hello All: > > I am currently working on a project to create an FEM model for school. > I was thinking about using wxPython to gather the 12 input variables > from the user, then, after pressing the "Run" button, the GUI would > close, and the 12 input variables would then be availa

Re: HTTP getreply() never returns

2007-04-19 Thread Marko . Cain . 23
On Apr 19, 2:39 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > > I have the following code which send/receive HTTP request/response: > > ># where sampleUrl is '127.0.0.1' and > ># url is 'www.cnn.com' > > >h = httplib.HTTP(self.sampleUrl, 8080) > >

python-list@python.org

2007-04-19 Thread Anton Vredegoor
Anton Vredegoor wrote: > Maybe this one is better? No, this one keeps generating output. But this one stops at least: from collections import deque from itertools import chain, repeat def xsplitter(seq, pred): Q = deque(),deque() sentinel = object() it = chain(seq,repeat(sentine

Re: Python un-plugging the Interpreter

2007-04-19 Thread Steve Holden
Jorgen Grahn wrote: > On Thu, 19 Apr 2007 10:56:25 -0600, S.Mohideen <[EMAIL PROTECTED]> wrote: [...] > >> 4) Acheive true parallelism and performance by getting rid of the >> middle-man Interpreter and GIL. > > Is the GIL really an artifact of the interpreter? > In so far as only the CPython

Re: Python Feature Request: Explicit variable declarations

2007-04-19 Thread Kumar McMillan
On 4/14/07, James Stroud <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > But, if you have masochistic tendencies and want a lot of overhead in > your programming, you can always bind yourself mercilessly to classes: > > > class C(object): >declared = ['bob', 'carol', 'ted', 'alice'] >

Re: Python un-plugging the Interpreter

2007-04-19 Thread Daniel Nogradi
> Hi All, > I was thinking about the feasbility of adjusting Python as a > compiled language. Being said that I feel these are the following advantages > of doing so -- > 1) Using the powerful easy-to -use feature of Python programming language > constructs. > 2) Making the program to ru

Re: What makes an iterator an iterator?

2007-04-19 Thread 7stud
On Apr 19, 3:12 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Apr 19, 5:37 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > It's nothing to do with the name lookup. Alex mentioned that to remind > > us that the magic "double-under" names are looked up on the type rather > > than the instance... >

Re: Significance of "start" parameter to string method "endswith"

2007-04-19 Thread John Machin
On Apr 20, 6:08 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Boris Dušek wrote: > > Hello, > > > what is the use-case of parameter "start" in string's "endswith" > > method? Consider the following minimal example: > > > a = "testing" > > suffix="ing" > > a.endswith(suffix, 2) > > > Significance of

Re: Python un-plugging the Interpreter

2007-04-19 Thread John Nagle
DillonCo wrote: > On Thursday 19 April 2007, S.Mohideen wrote: > >> 2) Making the program to run at par with the compiled version of C/C++ >>program- this is the main benefit which can be derived out of this. > > > Python is a rather slow language because of how it works. Even if you got > rid

python-list@python.org

2007-04-19 Thread Anton Vredegoor
[EMAIL PROTECTED] wrote: > Um, no. That one stops prematurely if > your input sequence is: > > L = 1, 2, 3, 'a', 'a' Ah, thanks! > You get points for persistence, however. :) Maybe this one is better? from collections import deque from itertools import chain, repeat def xsplitter(seq, pred

Re: Better dict of dicts

2007-04-19 Thread Larry Bates
John Bauman wrote: > Adam Atlas wrote: >> On Apr 19, 5:24 pm, Bill Jackson <[EMAIL PROTECTED]> wrote: >>> I have a dictionary of dictionaries where the keys are typically very >>> long tuples and repeated in each inner dictionary. The dictionary >>> representation is nice because it handles sparse

Re: Better dict of dicts

2007-04-19 Thread DillonCo
On Thursday 19 April 2007, Bill Jackson wrote: > I have a dictionary of dictionaries where the keys are typically very > long tuples and repeated in each inner dictionary. The dictionary > representation is nice because it handles sparseness well...and it is > nice to be able to look up values bas

Re: Python un-plugging the Interpreter

2007-04-19 Thread DillonCo
On Thursday 19 April 2007, S.Mohideen wrote: > 2) Making the program to run at par with the compiled version of C/C++ > program- this is the main benefit which can be derived out of this. Python is a rather slow language because of how it works. Even if you got rid of the VM (as noted by others

Re: Better dict of dicts

2007-04-19 Thread Martin v. Löwis
Bill Jackson schrieb: > I have a dictionary of dictionaries where the keys are typically very > long tuples and repeated in each inner dictionary. What I don't understand here: you say the keys are tuples, yet later, you show that the keys are strings. Which one is it? > The dictionary > represe

Re: wxPython and how to return text entry to main program?

2007-04-19 Thread kyosohma
On Apr 19, 2:38 pm, Tyler <[EMAIL PROTECTED]> wrote: > Hello All: > > I am currently working on a project to create an FEM model for school. > I was thinking about using wxPython to gather the 12 input variables > from the user, then, after pressing the "Run" button, the GUI would > close, and the

Re: Better dict of dicts

2007-04-19 Thread John Bauman
Adam Atlas wrote: > On Apr 19, 5:24 pm, Bill Jackson <[EMAIL PROTECTED]> wrote: >> I have a dictionary of dictionaries where the keys are typically very >> long tuples and repeated in each inner dictionary. The dictionary >> representation is nice because it handles sparseness well...and it is >>

Re: Python Threads -

2007-04-19 Thread Daniel Nogradi
> Can you please suggest a technique in Python where we can spawn few number > of worker threads and later map them to a function/s to execute individual > Jobs. Have a look at the threading module: http://docs.python.org/lib/module-threading.html HTH, Daniel -- http://mail.python.org/mailman/li

Re: Better dict of dicts

2007-04-19 Thread Adam Atlas
On Apr 19, 5:24 pm, Bill Jackson <[EMAIL PROTECTED]> wrote: > I have a dictionary of dictionaries where the keys are typically very > long tuples and repeated in each inner dictionary. The dictionary > representation is nice because it handles sparseness well...and it is > nice to be able to look

Re: Spawn/Exec with asterisk in argument

2007-04-19 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Thanks for the reply Michael. No problem. > I used ls as a simple example, but I'm > using this with scp to transfer files and need shell expansion. It > makes sense since the shell isn't spawning the process, but it's been > a while since I've worked with ipc. I usu

Better dict of dicts

2007-04-19 Thread Bill Jackson
I have a dictionary of dictionaries where the keys are typically very long tuples and repeated in each inner dictionary. The dictionary representation is nice because it handles sparseness well...and it is nice to be able to look up values based on a string rather than a number. However, sinc

Re: Significance of "start" parameter to string method "endswith"

2007-04-19 Thread John Machin
On Apr 20, 6:36 am, subscriber123 <[EMAIL PROTECTED]> wrote: > On Apr 19, 3:58 pm, Boris Dušek <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hello, > > > what is the use-case of parameter "start" in string's "endswith" > > method? Consider the following minimal example: > > > a = "testing" > > suffi

Re: Screen Control in WinXP and Linux

2007-04-19 Thread peter
Thanks for these replies. Clearly what I'm looking for does not exist - yet! I've started by looking at Frederik Lundh's Console module. It looks promising, although on basis of ten minutes experience I can't yet figure out how to use it properly. Perhaps I should study Frederik's examples

Deallocation of a pointer not malloced, any tips?

2007-04-19 Thread Kumar McMillan
I get this warning from my test suite when I introduced a segment of code: python(18603,0xa000d000) malloc: *** Deallocation of a pointer not malloced: 0x310caa3; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to

Re: comparison with None

2007-04-19 Thread DillonCo
On Thursday 19 April 2007, Steven Howe wrote: > > ((int(3) > int(4)) == True) == True > > > > Explicit is better than sensible, yes? > > > > *wink* > > Your example, even with the *wink*, is stupid. The language requires 3 > to be an integer, 4 to be an integer. Incidentally, the language also req

Re: What makes an iterator an iterator?

2007-04-19 Thread 7stud
On Apr 19, 5:37 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > It's nothing to do with the name lookup. Alex mentioned that to remind > us that the magic "double-under" names are looked up on the type rather > than the instance... P.next() vs. type(P).next() Where is the "double-under" name?

Re: Python un-plugging the Interpreter

2007-04-19 Thread Jorgen Grahn
On Thu, 19 Apr 2007 10:56:25 -0600, S.Mohideen <[EMAIL PROTECTED]> wrote: > Hi All, > I was thinking about the feasbility of adjusting Python as a > compiled language. Being said that I feel these are the following advantages > of doing so -- > 1) Using the powerful easy-to -use feature

How to upgrade python from 2.3 to 2.4

2007-04-19 Thread [EMAIL PROTECTED]
Hi, Red hat 4 comes with python 2.3, and I am trying to upgrade to python 2.4. So I download and compile the source of python2.4. But as I run it I get the following error, can you please tell me how to fix it? # /root/src/Python-2.4.4/python ./nov/scripts/stressTestServlet.py ./ nov/scripts/str

Python training in Colorado, June 2007

2007-04-19 Thread Mark Lutz
Python author and trainer Mark Lutz will be teaching another 3-day Python class at a conference center in Longmont, Colorado, on June 11-13, 2007. This is a public training session open to individual enrollments, and covers the same topics as the 3-day onsite sessions that Mark teaches, with hands

matplotlib basic question

2007-04-19 Thread orangeDinosaur
Hi, I am exploring the possibility of using python as a replacement of MATLAB when I leave school. So, I've been playing with matplotlib and have run into some weird behavior after recently installing python 2.5.1 and matplotlib 0.90 on my Windows XP machine. Here's an example of what I see: >>>

Re: Significance of "start" parameter to string method "endswith"

2007-04-19 Thread Boris Dušek
On Apr 19, 10:36 pm, subscriber123 <[EMAIL PROTECTED]> wrote: > On Apr 19, 3:58 pm, Boris Dušek <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > what is the use-case of parameter "start" in string's "endswith" > > method? > def foo(function,instance,param): > if function(instance,param,2,4):

Re: NFS Help

2007-04-19 Thread half . italian
On Apr 19, 11:32 am, Clement <[EMAIL PROTECTED]> wrote: > how to get the file from NFS share in python.. You need to be more specific. If you just want to copy a file try shutil http://docs.python.org/lib/module-shutil.html ~Sean -- http://mail.python.org/mailman/listinfo/python-list

Re: Making a tree out of a 2 column list

2007-04-19 Thread Jorgen Grahn
On Sat, 14 Apr 2007 11:37:11 -0300, Sebastian Bassi <[EMAIL PROTECTED]> wrote: > I have a two column list like: > > 2,131 > 6,335 > 7,6 > 8,9 > 10,131 > 131,99 > 5,10 > > And I want to store it in a tree-like structure. CS side note: your "columns" describe a graph; http://en.wikipedia.org/wiki/Gr

PYQT 3 communication with 2 windows

2007-04-19 Thread Marcpp
Hi, I'm introducing to program in python + pyqt. I have a main window that call a second window (to introduce a info with textedit) when press the second window button I need to return to the main window the info introduced in the second window. I've seek in the pyqt doc examples but i don't find i

Re: Significance of "start" parameter to string method "endswith"

2007-04-19 Thread subscriber123
On Apr 19, 3:58 pm, Boris Dušek <[EMAIL PROTECTED]> wrote: > Hello, > > what is the use-case of parameter "start" in string's "endswith" > method? Consider the following minimal example: > > a = "testing" > suffix="ing" > a.endswith(suffix, 2) > > Significance of "end" is obvious. But not so for "s

Re: Python un-plugging the Interpreter

2007-04-19 Thread Steven Bethard
S.Mohideen wrote: > I was thinking about the feasbility of adjusting Python as a > compiled language. Python is a compiled language. It's compiled from source code to byte code. That's what the .pyc files are. STeVe -- http://mail.python.org/mailman/listinfo/python-list

Re: What makes an iterator an iterator?

2007-04-19 Thread Terry Reedy
"7stud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Apr 18, 8:38 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: | > | > One very good way to get an iterator from an iterable is for .__iter__ to | > be a generator function. | | Ahhh. That eliminates having to deal with next().

Re: Do other Python GUI toolkits require this?

2007-04-19 Thread [EMAIL PROTECTED]
On Apr 19, 6:54 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > I don't know how you come to the conclusion that it is a mathematical > absurdity but consider this: If you find that common usage propagates > something that is incorrect, should we just shrug it off or should we > attemp a correction?

Re: Significance of "start" parameter to string method "endswith"

2007-04-19 Thread Larry Bates
Boris Dušek wrote: > Hello, > > what is the use-case of parameter "start" in string's "endswith" > method? Consider the following minimal example: > > a = "testing" > suffix="ing" > a.endswith(suffix, 2) > > Significance of "end" is obvious. But not so for "start". > > Let's assume the "end" pa

Significance of "start" parameter to string method "endswith"

2007-04-19 Thread Boris Dušek
Hello, what is the use-case of parameter "start" in string's "endswith" method? Consider the following minimal example: a = "testing" suffix="ing" a.endswith(suffix, 2) Significance of "end" is obvious. But not so for "start". Let's assume the "end" parameter is not used - then the function sho

Re: HTTP getreply() never returns

2007-04-19 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, > > I have the following code which send/receive HTTP request/response: > ># where sampleUrl is '127.0.0.1' and ># url is 'www.cnn.com' > >h = httplib.HTTP(self.sampleUrl, 8080) > h.putrequest('GET', '/sample?url=' + self.url) > h.endhea

wxPython and how to return text entry to main program?

2007-04-19 Thread Tyler
Hello All: I am currently working on a project to create an FEM model for school. I was thinking about using wxPython to gather the 12 input variables from the user, then, after pressing the "Run" button, the GUI would close, and the 12 input variables would then be available for the rest of the p

Re: Creating search engine in Python Good or Bad [in performance]

2007-04-19 Thread azrael
That's right. It all depends on your design. When you do a select you could brute force it to to return the data, but the speed comes from elegant designing and programing skills. Using C++ or even Better C would probably boost your database model. Try to sort the data in the database so you can ef

Re: Spawn/Exec with asterisk in argument

2007-04-19 Thread jeremyfee
On Apr 18, 7:24 pm, Michael Hoffman <[EMAIL PROTECTED]> wrote: > If you want to process asterisk the way the shell does, you can pass > things through the shell. os.system is one way of doing that. Probably > better is: > > subprocess.check_call("ls -l *", shell=True) Thanks for the reply Michael

  1   2   >