Re: begging for a tree implementation

2006-04-26 Thread Rene Pijlman
Micah: >I'd like a full-featured tree What features? -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: blob problems in pysqlite

2006-04-26 Thread aldonnelley
Excellent. Got that working. Now, how to get the pickled data out of the database? I'm trying to use cPickle.loads(data) (code attached), and I get a: "TypeError: loads() argument 1 must be string, not list" Is there a workaround for this? I've tried converting the List of files to a String befor

Re: begging for a tree implementation

2006-04-26 Thread Sybren Stuvel
Micah enlightened us with: > I'm looking for a simple abstract-data-type tree. I would have thought > there would be a built-in type, but I can't find one. I just need to > be able to start from a root node and attach children from there. I > could jury-rig one using a dict or some tuples, but I

Re: Xah's Edu Corner: Criticism vs Constructive Criticism

2006-04-26 Thread RobertSzefler
John Bokma wrote: > harassing Usenet. (Did I just wrote smart?!) Tell me about bad English :) -- http://mail.python.org/mailman/listinfo/python-list

Re: C API []-style access to instance objects

2006-04-26 Thread André Malo
* [EMAIL PROTECTED] wrote: > Hi, > > I am having trouble figuring out how to set up an object to be > scriptable through the C API. An example of what I am attempting to > do: > obj = foo.Foo() obj["key"] > Traceback (most recent call last): > File "", line 1, in ? > TypeError: unsu

Re: Query regarding support for IPv6 in python

2006-04-26 Thread Heiko Wundram
Am Mittwoch 26 April 2006 17:02 schrieb Pramod TK: > 1. Does python support IPv6? [128 bit IP addresses?] Yes. > 2. Does it support setting of QoS flags? Yes. That's a socket option which you can set just as you would set it using C (at least under Unix, under Windows: no idea). > 3. Does it s

Re: cgi subprocess, cannot get output

2006-04-26 Thread Jakub Piotr Nowak
Dnia 26.04.2006 James Stroud <[EMAIL PROTECTED]> napisa³/a: } Jakub Piotr Nowak wrote: }> Hello, }> }> In the following cgi program, I cannot get subprocess output. }> I print the header, flush stdout to prepare it to new content, }> but variable 'o' is always empty. }> }> Could somebody help me

Re: MinGW and Python

2006-04-26 Thread Martin v. Löwis
Ross Ridge wrote: > Nonetheless, Cygwin applications are not generally considered native > Win32 applications because of the dependency on CYGWIN1.DLL and the > related environment. While what you're saying a strictly true, the > term "native Win32" is used to make a distinction between a port of

Re: Editing a function in-memory and in-place

2006-04-26 Thread Peter Otten
Ian Bicking wrote: > I got a puzzler for y'all. I want to allow the editing of functions > in-place. I won't go into the reason (it's for HTConsole -- > http://blog.ianbicking.org/introducing-htconsole.html), except that I > really want to edit it all in-process and in-memory. So I want the > i

Re: MinGW and Python

2006-04-26 Thread Martin v. Löwis
Ross Ridge wrote: > Martin v. Löwis wrote: >> http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx >> >> 'The msvcrt.dll is now a "known DLL," meaning that it is a system >> component owned and built by Windows. It is intended for future use only >> by system-level components.' > > Exactl

Re: Xah's Edu Corner: Criticism vs Constructive Criticism

2006-04-26 Thread Nigel Rowe
Ari Johnson wrote: > "Xah Lee" <[EMAIL PROTECTED]> writes: >> >>Xah >>[EMAIL PROTECTED] >> ? http://xahlee.org/ > > (This isn't constructive criticism, but just a question:) Are you the > sum of your web page? Yes he is, the total value is zero. -- Nigel Rowe A pox

Re: Editing a function in-memory and in-place

2006-04-26 Thread Terry Reedy
"Ian Bicking" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The func_code attributes of functions is writable, but I don't know how > to create the proper code object. Just compiling a new body isn't good > enough. Did you directly compile the body or compile a function and th

Re: not quite 1252

2006-04-26 Thread Martin v. Löwis
Anton Vredegoor wrote: >> Not sure I understand the question. If you process data in cp1252, >> then \x94 and \x94 are legal characters, and the Python codec should >> support them just fine. > > Tell that to the guys from open-office. Ok, I'll rephrase: Can you please explain your problem again,

Editing a function in-memory and in-place

2006-04-26 Thread Ian Bicking
I got a puzzler for y'all. I want to allow the editing of functions in-place. I won't go into the reason (it's for HTConsole -- http://blog.ianbicking.org/introducing-htconsole.html), except that I really want to edit it all in-process and in-memory. So I want the identity of the function to rem

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread gene tani
John Bokma wrote: > Roedy Green <[EMAIL PROTECTED]> wrote: > > I leave that up to Xah's ISP/USP and hosting provider to decide :-D > he's solidified position as top troll of 2003-2006 -- http://mail.python.org/mailman/listinfo/python-list

Re: begging for a tree implementation

2006-04-26 Thread Micah
Sybren Stuvel wrote: > Micah enlightened us with: > > I'm looking for a simple tree implementation: 0-n children, 1 root. > > All the nice methods would be appreciated (getLeaves, isLeaf, > > isRoot, depthfirst, breadthfirst,...) That's really all I need. I > > could code one up, but it would ta

Re: Xah's Edu Corner: Criticism vs Constructive Criticism

2006-04-26 Thread J�rgen Exner
Eli Gottlieb wrote: > Xah Lee wrote: >> Criticism versus Constructive Criticism >> >> Xah Lee, 2003-01 +---+ .:\:\:/:/:. | PLEASE DO NOT |:.:\:\:/:/:.: | FEED THE TROLLS | :=.' - - '.=: |

Re: print names of dictionaries

2006-04-26 Thread BartlebyScrivener
Thomas, Thanks. I read about tuple packing and unpacking. Now I get to see it in action. Plus, yours is one line shorter. If programming is anything like writing, shorter is almost always better. Thanks, rick -- http://mail.python.org/mailman/listinfo/python-list

Re: can this be done without eval/exec?

2006-04-26 Thread Schüle Daniel
>> are there other solutions to this problem >> without use of eval or exec? >> > > Using a factory function & closures instead of lambda: >>> def a(x): ... def b(): ... return x ... return b ... >>> lst=[] >>> for i in range(10): ... lst.append(a(i)) ... >>> lst[0]()

Re: [Reported] (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread John Bokma
Ken Tilton <[EMAIL PROTECTED]> wrote: > and if he were a troll, he would respond to each and every shusher to > increase the flames. There are several ways to troll. He writes up a rant, and let others do the flaming. He probably saves up his energy for the next rant. Like someone else wrote:

Twisted and Tkinter

2006-04-26 Thread Chris
Does anyone know how to use twisted and tkinter. I have a simple tcp server and I want to send messages to it once connected using a tkinter button? I have built the code as far as I can but don't know what to do from here. Any reference I try to put to sendmessage in chatfactory doesn't seem to wo

Re: print names of dictionaries

2006-04-26 Thread Thomas Nelson
I meant something like def printdict(dictionaries=[(apps,'apps'), (dirs,'dirs'), (sites,'sites')]): for dictionary,name in dictionaries: print name keys = dictionary.keys() keys.sort() for key in keys: print key, ":

Re: can this be done without eval/exec?

2006-04-26 Thread Chris Mellon
On 4/26/06, Schüle Daniel <[EMAIL PROTECTED]> wrote: > Hello group, > > >>> lst=[] > >>> for i in range(10): > ... lst.append(eval("lambda:%i" % i)) > ... > >>> lst[0]() > 0 > >>> lst[1]() > 1 > >>> lst[9]() > 9 > >>> > > >>> lst=[] > >>> for i in range(10): > ... exec "tmp = lambda

Re: Xah's Edu Corner: Criticism vs Constructive Criticism

2006-04-26 Thread John Bokma
Alex Buell <[EMAIL PROTECTED]> wrote: > GO AWAY. Instead of cross posting more garbage, do as follows: Email a complaint to the email addresses you can look up yourself and include the entire message of Xah: http://www.spamcop.net/sc?track=72.231.179.135 posting host http://www.spamc

Re: [Reported] (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Ken Tilton
John Bokma wrote: > Ken Tilton <[EMAIL PROTECTED]> wrote: > > [ reported ] > >>What might stop? > > > The excessive cross posting. > > >>I see one technical post every one or few weeks from >>Xah, followed by a dozen posts from self-appointed library-sushers >>such as Eli and library-shush

can this be done without eval/exec?

2006-04-26 Thread Schüle Daniel
Hello group, >>> lst=[] >>> for i in range(10): ... lst.append(eval("lambda:%i" % i)) ... >>> lst[0]() 0 >>> lst[1]() 1 >>> lst[9]() 9 >>> >>> lst=[] >>> for i in range(10): ... exec "tmp = lambda:%i" % i # assignment is not expression ... lst.append(tmp) ... >>> lst[0](

Help: How can I control a new IE window using PAMIE?

2006-04-26 Thread 尹祥龙
I am using PAMIE to test a web application. I want to control a new IE window opened by clicking a link. How to do? For example: HTML source:     go_to_b   Using PAMIE I can click the link named aIE. Now how can I control the window whose url is "b.html"? -- http://mail.python.org/mailman/listinfo

Re: [Reported] (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread James Stroud
Ken Tilton wrote: > What might stop? Nauseating misuse of English. Annoying cross-posts. Newsgroup clutter. Shusher-Shusher-Shushers like me. -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/m

Re: I have problems with creating the classic game Wumpus. the file: http://esnips.c

2006-04-26 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > i just mailed it to you. Thanks for looking at it. Returning. Comments added by me start #m. I tried to keep all your original lines commented out and added my fixes with #m on either side, but there were so many errors I had to give up. I tried to preserve the code o

list of functions question

2006-04-26 Thread val bykoski
Hi The List: I have a modeling app where i'm detecting events (in temporal dynamics) applying a set of (boolean) functions - kind of: event_list = "f1 f2 etc".split() # each fi detects a specific event i have defs for functions fi, or simple boolean expressions for each, so that evList is a

pygresql - bytea

2006-04-26 Thread Jan Danielsson
Hello all, I'm trying to use pygresql to insert binary data (type: bytea) into a column (using postgresql, obviously). To make a long story short: I can't get it to work. Not even by cutting and pasting the very few examples I have found on the 'net. Does _anyone_ have a working example

Re: Xah's Edu Corner: Criticism vs Constructive Criticism

2006-04-26 Thread Alex Buell
On 25 Apr 2006 12:21:43 -0700 "Xah Lee" <[EMAIL PROTECTED]> waved a wand and this message magically appeared: > Criticism versus Constructive Criticism GO AWAY. Noone wants to see this drivel. Put it on a website if you must. Otherwise shut the fuck up and leave us alone! -- http://www.munted

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread John Bokma
Roedy Green <[EMAIL PROTECTED]> wrote: > On 26 Apr 2006 12:29:33 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote, > quoted or indirectly quoted someone who said : > >>This is a public notice that what you are trying to do is getting close >>to harrassment from the law's perspective. > > and what you

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread John Bokma
"Xah Lee" <[EMAIL PROTECTED]> wrote: > Dear John Bokma, > > This is a public notice that what you are trying to do is getting > close to harrassment from the law's perspective. Which law? You have been harrassing severl groups for too long with your drivel and extremely badly written rants. I

Re: Building a Dynamic Library (libpython.so) for Python 2.4.3 Final

2006-04-26 Thread Bo Gus
In article <[EMAIL PROTECTED]>, Andrew MacIntyre <[EMAIL PROTECTED]> wrote: > Dean wrote: > > I've been trying to make python a dynamic library. I downloaded Python > > 2.4.3 Final from the Python web site and I cannot get it to create the > > library. > > > > I've tried using the directive: >

Re: [Reported] (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread John Bokma
Ken Tilton <[EMAIL PROTECTED]> wrote: [ reported ] > What might stop? The excessive cross posting. > I see one technical post every one or few weeks from > Xah, followed by a dozen posts from self-appointed library-sushers > such as Eli and library-shusher-shushers such as you and me, none of >

Re: begging for a tree implementation

2006-04-26 Thread Sybren Stuvel
Micah enlightened us with: > I'm looking for a simple tree implementation: 0-n children, 1 root. > All the nice methods would be appreciated (getLeaves, isLeaf, > isRoot, depthfirst, breadthfirst,...) That's really all I need. I > could code one up, but it would take time to debug, and i'm really

Re: Python UPnP on Linux?

2006-04-26 Thread Sybren Stuvel
Paul Sijben enlightened us with: > You are right of course but I was hoping to avoid that. Twisted is > very large and has all kinds of internal dependencies. Yeah, but I wouldn't know any other way, sorry... :-/ Sybren -- The problem with the world is stupidity. Not saying there should be a cap

Re: MinGW and Python

2006-04-26 Thread Philippe Martin
This might relevant. http://www.aceshardware.com/read.jsp?id=153 Philippe Robert Kern wrote: > Martin v. Löwis wrote: >> Srijit Kumar Bhadra wrote: >> >>>Is there any specific reason for not using MinGW to build the official >>>distribution of Python for Win32? >> >> What could be the reaso

Re: do while loop

2006-04-26 Thread bearophileHUGS
Rick Zantow>In any case, what would you want to do that you can't do (in some way) now?< You can do all things already, that's not the point, I presume. Some things added in the last years were already possibile in different ways. Rick Zantow>If you have a compelling use case,< I agree that suc

Re: not quite 1252

2006-04-26 Thread Serge Orlov
Anton Vredegoor wrote: > I'm trying to import text from an open office document (save as .sxw and > read the data from content.xml inside the sxw-archive using > elementtree and such tools). > > The encoding that gives me the least problems seems to be cp1252, > however it's not completely perfe

C API []-style access to instance objects

2006-04-26 Thread [EMAIL PROTECTED]
Hi, I am having trouble figuring out how to set up an object to be scriptable through the C API. An example of what I am attempting to do: >>> obj = foo.Foo() >>> obj["key"] Traceback (most recent call last): File "", line 1, in ? TypeError: unsubscriptable object >>> I've tried defining __ge

begging for a tree implementation

2006-04-26 Thread Micah
I'm looking for a simple tree implementation: 0-n children, 1 root. All the nice methods would be appreciated (getLeaves, isLeaf, isRoot, depthfirst, breadthfirst,...) That's really all I need. I could code one up, but it would take time to debug, and i'm really short on time right now. Thanks!

Re: print names of dictionaries

2006-04-26 Thread Scott David Daniels
BartlebyScrivener wrote: > This works for now. I just added their names as values: > > def printdict(dictionaries=[apps, dirs, sites]): >for dictionary in dictionaries: > print dictionary["name"] > keys = dictionary.keys() > keys.sort() >

Re: print names of dictionaries

2006-04-26 Thread BartlebyScrivener
>> Of course, the easiest way is just to use a tuple (dict,string). I don't mean to be obtuse, but I'm not getting this one either. Is it easier than what I did? Thx, rick -- http://mail.python.org/mailman/listinfo/python-list

Re: print names of dictionaries

2006-04-26 Thread Thomas Nelson
Here's an OO way that may do what you want: >>> class MyD(dict): ... def __init__(self,dic,rep): ... dict.__init__(self,dic) ... self.rep = rep ... def __repr__(self): ... return self.rep ... >>> apps = MyD({'alpha':1,'beta':2},'apps') >>> apps apps >>> a

Re: print names of dictionaries

2006-04-26 Thread BartlebyScrivener
Yikes, I'll have to come back to the OO way in a month or two ;) This works for now. I just added their names as values: def printdict(dictionaries=[apps, dirs, sites]): for dictionary in dictionaries: print dictionary["name"] keys = dictionary.keys()

Re: MinGW and Python

2006-04-26 Thread Ross Ridge
Ross Ridge wrote: > Not exactly. They're both GCC, but the MinGW compiler that you can > download from MinGW WWW site is a native Win32 appliction, while the > "MinGW" compiler included with Cygwin and invoked by "-mno-cygwin" is a > Cygwin application. Martin v. Löwis wrote: > Any Cygwin applica

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Roedy Green
On 26 Apr 2006 12:29:33 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote, quoted or indirectly quoted someone who said : >This is a public notice that what you are trying to do is getting close >to harrassment from the law's perspective. and what you do Xah, is very close to spam, another form of haras

Re: do while loop

2006-04-26 Thread Thomas Nelson
My usual way of emulating do-while is: started = False while (someBoolean or not started): started = True #whatever else This simply assures "whatever else" happens at least once. Is this Pythonic? THN -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on Nintendo DS

2006-04-26 Thread Richard Tew
You can find the new port of Python 2.4.3 (Stackless) here: http://www.disinterest.org/NDS/Python24.html Even if you do not have a Nintendo DS with the appropriate homebrewing device to make the rom available to it, you should still be able to run it within an emulator like Dualis (which is where

Re: do while loop

2006-04-26 Thread Dave Hansen
On Wed, 26 Apr 2006 22:41:04 +0200 in comp.lang.python, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >In <[EMAIL PROTECTED]>, ? wrote: > >> suggest add do while loop in later version > >Please also suggest a clean syntax for this. :-) > while 1: do_loop_stuff() if time_to_leave():

Re: MinGW and Python

2006-04-26 Thread Ross Ridge
Ross Ridge wrote: > MSVCRT.DLL has been a standard system compent of Windows since at least > Windows 98. Many other system components depend on it. Essentially, > MSVCRT.DLL is an "undocumented" part of the Windows API. It's not > exactly "endorsed", Microsoft would rather you use it's current

Re: print names of dictionaries

2006-04-26 Thread BartlebyScrivener
Wow, That's food for thought. Thanks. I see what they mean about change of approach. I'll just stick a key in each dictionary called, er, name with its name value. Thank you! rick -- http://mail.python.org/mailman/listinfo/python-list

Re: do while loop

2006-04-26 Thread Rick Zantow
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In <[EMAIL PROTECTED]>, 雷 wrote: > >> suggest add do while loop in later version > > Please also suggest a clean syntax for this. :-) > Since Python already has a while : loop, I'm supposing you mean somethin

Re: A defense for bracket-less code

2006-04-26 Thread Carl Banks
Edward Elliott wrote: > Stelios Xanthakis wrote: > > Also, I think that perl does that because otherwise code like > > > > if ($x) $y++ if $z; else $z--; > > > > would be even more confusing :) > > With or without braces, that's not legal code. A one-line if can't be > followed by an else. Thus p

Re: print names of dictionaries

2006-04-26 Thread Thomas Nelson
Here's an OO way that may do what you want: >>> class MyD(dict): ... def __init__(self,dic,rep): ... dict.__init__(self,dic) ... self.rep = rep ... def __repr__(self): ... return self.rep ... >>> apps = MyD({'alpha':1,'beta':2},'apps') >>> apps apps >>> a

Re: print names of dictionaries

2006-04-26 Thread jay graves
BartlebyScrivener wrote: > Still new. Learning attributes and functions and so on. > Sorry if this is obvious, but if I'm defining a function for some > dictionaries, how can I print just the names of the dictionaries? Short answer: You can't. http://pyfaq.infogami.com/how-can-my-code-discover-t

Re: wxpython warnings

2006-04-26 Thread Philippe Martin
Hi, This is an answer I got from the wxPython NG: """ If it is a wxLog message (I think it is) then you can temporarily disable log messages by creating an instance of wx.LogNull.  Or you can do something like set the log target to some other object than the default wx.LogGui, or set the log l

Re: not quite 1252

2006-04-26 Thread Anton Vredegoor
Martin v. Löwis wrote: > Not sure I understand the question. If you process data in cp1252, > then \x94 and \x94 are legal characters, and the Python codec should > support them just fine. Tell that to the guys from open-office. Anton -- http://mail.python.org/mailman/listinfo/python-list

print names of dictionaries

2006-04-26 Thread BartlebyScrivener
Still new. Learning attributes and functions and so on. Sorry if this is obvious, but if I'm defining a function for some dictionaries, how can I print just the names of the dictionaries? E.g. assuming apps, dirs, sites are dictionaries defined in the module, how can I print just their names befo

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-26 Thread John J. Lee
Edward Elliott <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > can anybody explain, in the first case why i need to do two attempts. > > I would guess it's because redhat requires your browser to submit a session > cookie with the login form. In the urllib2 example, the first request

Re: how to browse using urllib2 and cookeilib the correct way

2006-04-26 Thread John J. Lee
[EMAIL PROTECTED] writes: [...] > 1) >>>import urllib2,urllib,cookielib > 2) >>>cj = cookielib.CookieJar() > 3) >>>opener = urllib2.build_opener( urllib2.HTTPCookieProcessor(cj)) > 4) >>>data = urllib.urlencode ( { "username" : "user" , >"password" :"" } ) > 5) >>>fp = opener.open( > "h

Re: Plotting package?

2006-04-26 Thread James Graham
Andrew Koenig wrote: > This may be a foolish question, but what's the most straightforward way to > plot a bunch of data in Python? > > That is, I want to write a program that does some number crunching, and then > I want to change some parameters and watch how the changes affect the > results.

Re: do while loop

2006-04-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, 雷 wrote: > suggest add do while loop in later version Please also suggest a clean syntax for this. :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Greg Menke
Mark Thomas writes: > Xah Lee wrote: > > Dear John Bokma, > > This is a public notice that what you are trying to do is getting close > > to harrassment from the law's perspective. > > Thanks. > >Xah > >[EMAIL PROTECTED] > > ∑ http://xahlee.org/ > > John Bokma wrote: > >> Eli Gottlieb <

Re: modifying iterator value.

2006-04-26 Thread Thomas Nelson
There is also this way: for index in range(len(someList)): someList[index] = 1 This is not as pretty or concise as enumerate(), but if you've never seen that function before this may be more clear. I assume you're familiar with the way range and len work. THN -- http://mail.python.org/mai

Re: [Reported] (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Ken Tilton
John Bokma wrote: > Eli Gottlieb <[EMAIL PROTECTED]> wrote: > > >>Oh, God, not another one. > > > Instead of cross posting more garbage, do as follows: > > Email a complaint to the email addresses you can look up yourself and > include the entire message of Xah: > > http://www.spamcop.net/

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Mark Thomas
Xah Lee wrote: > Dear John Bokma, > > This is a public notice that what you are trying to do is getting close > to harrassment from the law's perspective. > > Thanks. > >Xah >[EMAIL PROTECTED] > ∑ http://xahlee.org/ > > > John Bokma wrote: >> Eli Gottlieb <[EMAIL PROTECTED]> wrote: >>

Re: modifying iterator value.

2006-04-26 Thread Leif K-Brooks
chun ping wang wrote: > i want to modify an iterator value. > > for x in someList >x = 1 for index, value in enumerate(someList): someList[index] = 1 -- http://mail.python.org/mailman/listinfo/python-list

Re: I have problems with creating the classic game Wumpus. the file: http://esnips.c

2006-04-26 Thread conny . ledin
the thing is that im too much of a beginner to oint exactly to whats my problem is... =( I need help by someone looking at the program and presenting the solution... Im lousy, i should have choosen an easier assignment. -- http://mail.python.org/mailman/listinfo/python-list

modifying iterator value.

2006-04-26 Thread chun ping wang
Hi, I have something simple i want to do. i want to modify an iterator value. for x in someList x = 1 is it possible to do that..if not how do i modify a list using iteration. _ Express yourself instantly with MSN Messenger! Do

Re: win32com short path name on 2k

2006-04-26 Thread bytecolor
Thanks Russell, those funcs sound familiar. I've probably used them or, more than likely, read about them in the past. -- bytecolor -- http://mail.python.org/mailman/listinfo/python-list

Re: A defense for bracket-less code

2006-04-26 Thread Edward Elliott
Stelios Xanthakis wrote: > Also, I think that perl does that because otherwise code like > > if ($x) $y++ if $z; else $z--; > > would be even more confusing :) With or without braces, that's not legal code. A one-line if can't be followed by an else. The closest you can do is this: $y++ if $z

Re: (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread Xah Lee
Dear John Bokma, This is a public notice that what you are trying to do is getting close to harrassment from the law's perspective. Thanks. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ John Bokma wrote: > Eli Gottlieb <[EMAIL PROTECTED]> wrote: > > > Oh, God, not another one. > > Instead

Re: Events in Python?

2006-04-26 Thread Philippe Martin
Besides the other anwsers, you might want to check the signal module. Regards, Philippe [EMAIL PROTECTED] wrote: > Here is another non-pythonic question from the Java Developer. (I beg > for forgiveness...) > > Does Python have a mechanism for events/event-driven programming? > > I'm not ne

Re: A defense for bracket-less code

2006-04-26 Thread Stelios Xanthakis
Edward Elliott wrote: > Dave Hansen wrote: > >>Not really. It was mostly a lead-in to that last sentence. Problems >>like this couldn't happen in Python. So it's an opportunity to get a >>giggle at the expense of programmers using a language that gives you >>enough rope to shoot yourself in th

Re: Events in Python?

2006-04-26 Thread redefined . horizons
Thank you for all of the responses. I will check out the Traits link. It looked very interesting. It seems like Python doesn't have a "standard" implementation of an event or messaging system. That is really what I was curious about. I wanted to check before I implemented something of my own. Tha

Re: win32com short path name on 2k

2006-04-26 Thread Russell Warren
I've been driven crazy by this type of thing in the past. In my case it was with the same application (not two like you), but on different machines, with all supposedly having the same OS load. In some cases I would get short path names and in others I would get long path names. I could never fig

Re: The whitespaceless frontend

2006-04-26 Thread Chris Mellon
On 4/26/06, Edward Elliott <[EMAIL PROTECTED]> wrote: > Sion Arrowsmith wrote: > > Absolutely. I've written quite a lot of code (which I wasn't expecting > > anyone else to maintain) using 'I' for the same reasons. Plus, it's > > even shorter in terms of characters (if not keystrokes), stands out >

Re: win32com short path name on 2k

2006-04-26 Thread bytecolor
I have no idea how Featurecam registers the type library. I did figure out that I can get the full name 'C:\Program Files\Featurecam' from within Featurecam using VBA and the same property I used in Pyhton -> fc.InstallPath. Why would VBA and Python return two different strings? This is really dri

Re: Pyrex installation on windows XP: step-by-step guide

2006-04-26 Thread sturlamolden
Julien Fiore wrote: > > # step A.3 # > Install Mingw, the gcc compiler for Windows, available at > http://www.mingw.org/download.shtml. (we downloaded the file > MinGW-5.0.2.exe and installed only the "base tool" (this includes > mingw-runtime 3.9, w32api-3.6, binutils 2.15.91 and gcc-core 3.4.2).

Re: A defense for bracket-less code

2006-04-26 Thread Edward Elliott
Dave Hansen wrote: > Not really. It was mostly a lead-in to that last sentence. Problems > like this couldn't happen in Python. So it's an opportunity to get a > giggle at the expense of programmers using a language that gives you > enough rope to shoot yourself in the foot... Which can be enti

Speed of shutil.copy vs os.system("copy src dest") in win32

2006-04-26 Thread Russell Warren
I just did a comparison of the copying speed of shutil.copy against the speed of a direct windows copy using os.system. I copied a file that was 1083 KB. I'm very interested to see that the shutil.copy copyfileobj implementation of hacking through the file and writing a new one is significantly f

Re: Python UPnP on Linux?

2006-04-26 Thread Paul Sijben
You are right of course but I was hoping to avoid that. Twisted is very large and has all kinds of internal dependencies. Sybren Stuvel wrote: > Paul Sijben enlightened us with: >> Googling on this I have found win32 implementations and Twisted >> implementations yet I am looking for a way to do i

Re: The whitespaceless frontend

2006-04-26 Thread Edward Elliott
Sion Arrowsmith wrote: > Absolutely. I've written quite a lot of code (which I wasn't expecting > anyone else to maintain) using 'I' for the same reasons. Plus, it's > even shorter in terms of characters (if not keystrokes), stands out > reasonably well, and for how I read it makes for better Engli

Re: Counting elements in a list wildcard

2006-04-26 Thread Edward Elliott
Iain King wrote: > steven = re.compile("Ste(v|ph|f|ff)(e|a)n") Also you can expand the RE a bit to improve readability: re.compile("Stev|Steph|Stef|Steff)(en|an)") -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting elements in a list wildcard

2006-04-26 Thread Edward Elliott
Iain King wrote: > steven = re.compile("Ste(v|ph|f|ff)(e|a)n") > steven = ["Steven", "Stephen", "Stefen", "Steffen", "Stevan", > "Stephan", "Stefan", "Steffan"] > > I know which I'd rather type. 'Course, if you can use a ready-built > list of names... Oh I agree, I'd rather *type* the former, bu

Re: Packing a list of lists with struct.pack()

2006-04-26 Thread Panos Laganakos
Fredrik, thanks alot. Your preposition worked like a charm, plus I got to learn how to reverse an inner for loop using list comprehensions :) What I don't understand is what are you doing with *(...), this is supposed to pack its contents as a list? -- http://mail.python.org/mailman/listinfo/py

Re: Nested Lists Assignment Problem

2006-04-26 Thread Gary Herron
Licheng Fang wrote: >Dennis Lee Bieber wrote: > > >>On 26 Apr 2006 01:13:20 -0700, "Licheng Fang" <[EMAIL PROTECTED]> >>declaimed the following in comp.lang.python: >> >> >> >> >>>Could anybody please explain to me why three values were change? I'm >>>bewildered. Thanks! >>> >>> >>http

Re: Query regarding support for IPv6 in python

2006-04-26 Thread Martin v. Löwis
Pramod TK wrote: > Is this new function getaddrinfo() of IPv6 is supported in Win32 Extensions > for python. Yes, since Python 2.4 (actually, not in the Win32 extensions, but in the standard Python socket module for Win32). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

[Reported] (was Re: Xah's Edu Corner: Criticism vs Constructive Criticism)

2006-04-26 Thread John Bokma
Eli Gottlieb <[EMAIL PROTECTED]> wrote: > Oh, God, not another one. Instead of cross posting more garbage, do as follows: Email a complaint to the email addresses you can look up yourself and include the entire message of Xah: http://www.spamcop.net/sc?track=72.231.179.135 posting hos

Re: not quite 1252

2006-04-26 Thread Martin v. Löwis
Anton Vredegoor wrote: > The encoding that gives me the least problems seems to be cp1252, > however it's not completely perfect because there are still characters > in it like \93 or \94. Has anyone handled this before? I'd rather not > reinvent the wheel and start translating strings 'by hand'.

Re: Can one query full name (or version) of selected packages at pypi?

2006-04-26 Thread Martin v. Löwis
Caleb Hattingh wrote: > How up-to-date does Debian keep its package list for python addons, > or are you running Unstable? I'm running unstable indeed. > My big problem, being in South Africa, is that I have to get any > distros on cover CDs or order from distro-resellers, and they never > have T

Re: Events in Python?

2006-04-26 Thread nikie
[EMAIL PROTECTED] wrote: > Here is another non-pythonic question from the Java Developer. (I beg > for forgiveness...) > > Does Python have a mechanism for events/event-driven programming? > > I'm not necessarily talking about just GUIs either, I'm interested in > using events for other parts of a

Re: MinGW and Python

2006-04-26 Thread Martin v. Löwis
Ross Ridge wrote: > Not exactly. They're both GCC, but the MinGW compiler that you can > download from MinGW WWW site is a native Win32 appliction, while the > "MinGW" compiler included with Cygwin and invoked by "-mno-cygwin" is a > Cygwin application. Any Cygwin application is a native Win32 ap

Re: Events in Python?

2006-04-26 Thread John Hunter
> "redefined" == redefined horizons <[EMAIL PROTECTED]> writes: redefined> Here is another non-pythonic question from the Java redefined> Developer. (I beg for forgiveness...) redefined> Does Python have a mechanism for events/event-driven redefined> programming? The enthough

CoderWiki.com - A free online reference manual

2006-04-26 Thread da404LewZer
Anyone interested in helping me build the ultimate programming manual? http://www.coderwiki.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: MinGW and Python

2006-04-26 Thread Martin v. Löwis
Ross Ridge wrote: > MSVCRT.DLL has been a standard system compent of Windows since at least > Windows 98. Many other system components depend on it. Essentially, > MSVCRT.DLL is an "undocumented" part of the Windows API. It's not > exactly "endorsed", Microsoft would rather you use it's current

Re: MinGW and Python

2006-04-26 Thread Martin v. Löwis
Edward Elliott wrote: >> Well, there is no native C library on Microsoft Windows: the system >> simply doesn't include an official C library (I know there is crtdll.dll >> and msvcrt.dll, but these aren't "endorsed" system C libraries). > > don't know what you mean by "endorsed". does it lack fea

  1   2   >