Re: python and ajax

2005-08-30 Thread Stephan Diehl
On Mon, 29 Aug 2005 12:04:46 -0700, Steve Young wrote: > Hi, I was wondering if anybody knew of any good > tutorial/example of AJAX/xmlhttprequest in python. > Thanks. > > -Steve As all the others have said already, AJAX has nothing to do with python, but everything with JavaScript. You might wa

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-30 Thread Antoon Pardon
Op 2005-08-29, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> Op 2005-08-27, Steve Holden schreef <[EMAIL PROTECTED]>: >> >>>If you want an exception from your code when 'w' isn't in the string you >>>should consider using index() rather than find. >> >> >> Sometimes i

Re: OpenSource documentation problems

2005-08-30 Thread Bryan Olson
Adriaan Renting wrote: [...] > I do agree that a lot of OSS projects seem to lack somewhat in > the documentation department, compared to a lot of commercial > software. I would give the man page of gcc as an example, it's > just one 6600 line blurb. I don't see any need to look beyond Python

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Bryan Olson
Steve Holden wrote: > I'm all in favor of discussions to make 3.0 a better > language. This one should definitely be two-phase. First, the non-code- breaking change that replaces-and-deprecates the warty handling of negative indexes, and later the removal of the old style. For the former, there'

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Antoon Pardon
Op 2005-08-29, Steven Bethard schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> I think a properly implented find is better than an index. > > See the current thread in python-dev[1], which proposes a new method, > str.partition(). I believe that Raymond Hettinger has shown that almost > al

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Terry Reedy
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message news:[EMAIL PROTECTED] > Really it's x[-1]'s behavior that should go, not find/rfind. I complete disagree, x[-1] as an abbreviation of x[len(x)-1] is extremely useful, especially when 'x' is an expression instead of a name. But ev

Re: Writing Multithreaded Client-Server in Python.

2005-08-30 Thread google
Paul Rubin schreef: > "Sidd" <[EMAIL PROTECTED]> writes: > >I tried finding and example of multithreaded client-serve program in > > python. Can any one please tell me how to write a multithreaded > > client-server programn in python such that > > 1.It can handle multiple connections > > 2.It

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Paul Rubin
"Terry Reedy" <[EMAIL PROTECTED]> writes: > > Really it's x[-1]'s behavior that should go, not find/rfind. > > I complete disagree, x[-1] as an abbreviation of x[len(x)-1] is extremely > useful, especially when 'x' is an expression instead of a name. There are other abbreviations possible, for e

Re: Writing Multithreaded Client-Server in Python.

2005-08-30 Thread Paul Rubin
[EMAIL PROTECTED] writes: > What it does do, is handle each request (from the same client too) in a > new separate thread. Convenient if your processing intensive handle may > otherwise slow down the main server process becoming less responsive to > other requests. > What it doesn't do (and what Si

wxnotebook and tooltips

2005-08-30 Thread klaus . roedel
Hi, I've implemented a wxnotebook on my application. I can set a tooltip for the complete notebook, but I want to set for every page a tooltip, so that the user can get additionally information over it before he change it. Is this possible with python and wxwidgets? Thanks for any help. Greets Klau

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Bryan Olson
Terry Reedy wrote: > "Paul Rubin" wrote: > >>Really it's x[-1]'s behavior that should go, not find/rfind. > > I complete disagree, x[-1] as an abbreviation of x[len(x)-1] is extremely > useful, especially when 'x' is an expression instead of a name. Hear us out; your disagreement might not

array of arrays question

2005-08-30 Thread Meo
Hi, Here is what I'm doing in python 2.4.1 : >>> aOfa=[[[]]*3]*4 >>> aOfa [[[], [], []], [[], [], []], [[], [], []], [[], [], []]] >>> aOfa[3][2].append(1) >>> aOfa [[[1], [1], [1]], [[1], [1], [1]], [[1], [1], [1]], [[1], [1], [1]]] Ok, so there is something I didn't understand about python's a

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Paul Rubin
Bryan Olson <[EMAIL PROTECTED]> writes: > Specifically, to support new-style slicing, a class that > accepts index or slice arguments to any of: > > __getitem__ > __setitem__ > __delitem__ > __getslice__ > __setslice__ > __delslice__

Re: array of arrays question

2005-08-30 Thread Paul Rubin
"Meo" <[EMAIL PROTECTED]> writes: > Somebody understand what's going on here? Yes, []*3 gives you three references to the same empty list, not three separate empty lists. You need something like [[] for i in xrange(3)] to get separate lists. Another example: a = [1,2,3] b = a a

Re: Python port on Palm Treo?

2005-08-30 Thread tooper
I'm not aware of any Treo dedicated port, but as Treo is running Palm, the Palm port of Python should be OK (if I remember well it's pypi or pipy, standing for PYthon for palm PIlot) Hope it helps... -- http://mail.python.org/mailman/listinfo/python-list

time.mktime problem

2005-08-30 Thread McBooCzech
Hi, on Linux (Fedora FC4) and Python 2.4.1 I am trying to know the time delta in seconds between two times given in the HHMMSS format. My code looks like: import datetime, time ta1=(time.strptime('01', '%H%M%S')) ta2=(time.strptime('230344', '%H%M%S')) t1=time.mktime(ta1) t2=time.mktime(ta2) p

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Antoon Pardon
Op 2005-08-30, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message > news:[EMAIL PROTECTED] > >> Really it's x[-1]'s behavior that should go, not find/rfind. > > I complete disagree, x[-1] as an abbreviation of x[len(x)-1] is extremely > use

Re: OpenSource documentation problems

2005-08-30 Thread Roel Schroeven
Bryan Olson wrote: > Adriaan Renting wrote: > [...] > > > I do agree that a lot of OSS projects seem to lack somewhat in > > the documentation department, compared to a lot of commercial > > software. I would give the man page of gcc as an example, it's > > just one 6600 line blurb. > > I don

Re: Release of PyPy 0.7.0

2005-08-30 Thread holger krekel
Hi Valentino, Michael, all, On Sun, Aug 28, 2005 at 20:46 +0200, Valentino Volonghi aka Dialtone wrote: > Michael Sparks <[EMAIL PROTECTED]> wrote: > > Would it be useful for people to start trying out their modules/code to see > > if they work with this release, and whether they can likewise be

Re: Python port on Palm Treo?

2005-08-30 Thread tooper
I'm not aware of any Treo dedicated port, but as Treo is running Palm, the Palm port of Python should be OK (if I remember well it's pypi or pipy, standing for PYthon for palm PIlot) Hope it helps... -- http://mail.python.org/mailman/listinfo/python-list

Re: Release of PyPy 0.7.0

2005-08-30 Thread Michael Hudson
Michael Sparks <[EMAIL PROTECTED]> writes: > Valentino Volonghi aka Dialtone wrote: > >> Michael Sparks <[EMAIL PROTECTED]> wrote: >> >>> Would it be useful for people to start trying out their modules/code to >>> see if they work with this release, and whether they can likewise be >>> translated

Re: DOM text

2005-08-30 Thread Richard Lewis
On Fri, 26 Aug 2005 11:43:18 +0100, "Richard Lewis" <[EMAIL PROTECTED]> said: > > I'm implementing a Cursor class now which keeps track of the current > parent Element, text node and character position so that I can easily (I > hope ;-) work out where the splitting and inserting needs to occur. W

Re: File parser

2005-08-30 Thread MrJean1
Take a closer look at SimpleParse/mxTextTools We have used these to parse log files of several 100 MB with simple and complex grammars up to 250+ productions. Highly recommended. /Jean Brouwers PS) For an introduction see also this story

Re: [Jython-users] Re: [Jython-dev] Parsing grammar for jython available (compatible with python 2.4)

2005-08-30 Thread Fabio Zadrozny
Well, if you post your problems in the pydev bug-tracker, maybe those cases can be sorted out... (one area on where it is really difficult currently, is when you do code-completion and it is unable to parse your module... is this your case?) Cheers, Fabio could ildg wrote: > thanks. > pydev

Re: Pypy - Which C modules still need converting to py?

2005-08-30 Thread holger krekel
Hi Caleb, On Tue, Feb 08, 2005 at 22:32 -0500, Caleb Hattingh wrote: > I saw it on a webpage a few days ago, can't seem to find it again. Tried > a google search for > > "pypy needed translate C modules" > > but that didn't turn up what I was looking for. Anyone have that page > ref hand

Re: time.mktime problem

2005-08-30 Thread Matt Hammond
I don't get the same results: >>> import datetime, time >>> ta1=(time.strptime('01', '%H%M%S')) >>> ta2=(time.strptime('230344', '%H%M%S')) >>> t1=time.mktime(ta1) >>> t2=time.mktime(ta2) >>> print t1, t2 -2208988799.0 -2208905776.0 >>> print t1-t2 -83023.0 Suse 9.3, python 2.4 (all 64bit)

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Robert Kern
Bryan Olson wrote: > Currently, user-defined classes can implement Python > subscripting and slicing without implementing Python's len() > function. In our proposal, the '$' symbol stands for the > sequence's length, so classes must be able to report their > length in orde

Re: Writing portable applications

2005-08-30 Thread Ulrich Hobelmann
Mike Meyer wrote: > If your web apps are well-written, any of them should work. As > previously stated, Sturgeon's law applies to the web, so chances are > good they aren't well-written. :) >> But as soon as some user of platform 54 tries your website, she'll >> encounter some weird behavior with

Re: DOM text

2005-08-30 Thread Richard Lewis
On Tue, 30 Aug 2005 11:17:25 +0100, "Richard Lewis" <[EMAIL PROTECTED]> said: > > Here is the *complete* code for my SectionCursor class: In case anyone's interested, I've just noticed a logical error in the next_node() method: = def next_node(self): if self.cur

micro-python - is it possible?

2005-08-30 Thread Evil Bastard
Hi, Has anyone done any serious work on producing a subset of python's language definition that would suit it to a tiny microcontroller environment? In its full form, python is a resource hog. If a microcontroller implementation honoured the 'everything is an object' philosophy, the code would sp

Re: array of arrays question

2005-08-30 Thread Meo
yes, thank you for your help -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Antoon Pardon
Op 2005-08-30, Robert Kern schreef <[EMAIL PROTECTED]>: > Bryan Olson wrote: > >> Currently, user-defined classes can implement Python >> subscripting and slicing without implementing Python's len() >> function. In our proposal, the '$' symbol stands for the >> sequence's length

Re: Jargons of Info Tech industry

2005-08-30 Thread axel
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > Alan Balmer <[EMAIL PROTECTED]> wrote: >> On 29 Aug 2005 21:12:13 GMT, John Bokma <[EMAIL PROTECTED]> wrote: Now, go away. And please, stay away. >>>Like I already said, it doesn't work that way. >> Goodbye, John. Filters set

Re: sslerror: (8, 'EOF occurred in violation of protocol') ???

2005-08-30 Thread Robert
"Robert" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > On some connections only from some computers/network setups I get this > error: > > Traceback (most recent call last): > File "", line 1, in ? > File "ClientCookie\_urllib2_support.pyo", line 524, in open > File "Cl

Re: time.mktime problem

2005-08-30 Thread Edvard Majakari
"McBooCzech" <[EMAIL PROTECTED]> writes: > Hi, on Linux (Fedora FC4) and Python 2.4.1 > I am trying to know the time delta in seconds between two times given > in the HHMMSS format. My code looks like: > > import datetime, time > ta1=(time.strptime('01', '%H%M%S')) > ta2=(time.strptime('230344

Re: variable hell

2005-08-30 Thread Fredrik Lundh
Steve Holden wrote: > Yes. A large part of learning a language is discovering the many idioms > that have already been established for doing certain things. These are a > kind of shorthand, established by long convention, that allow one to > avoid the "learning-by-use" curve. it's not obvious tha

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Robert Kern
Antoon Pardon wrote: > Op 2005-08-30, Robert Kern schreef <[EMAIL PROTECTED]>: > >>Bryan Olson wrote: >> >>> Currently, user-defined classes can implement Python >>> subscripting and slicing without implementing Python's len() >>> function. In our proposal, the '$' symbol stands for th

Re: micro-python - is it possible?

2005-08-30 Thread Robert
"Evil Bastard" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hi, > > Has anyone done any serious work on producing a subset of python's > language definition that would suit it to a tiny microcontroller > environment? > remember there was some work done for minimizing py1.5.

Code run from IDLE but not via double-clicking on its *.py

2005-08-30 Thread n00m
When I double-click on "some.py" file console window appears just for a moment and right after that it's closed. If this script is started from inside of IDLE (F5 key) then it executes as it should be (e.g. executing all its print statements). Any ideas? OS: Windows; Python 2.3.4. Thanks. -- htt

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Bryan Olson
Robert Kern wrote: > Bryan Olson wrote: > > >> Currently, user-defined classes can implement Python >> subscripting and slicing without implementing Python's len() >> function. In our proposal, the '$' symbol stands for the >> sequence's length, so classes must be able to rep

Re: DOM text

2005-08-30 Thread Richard Lewis
On Tue, 30 Aug 2005 12:05:38 +0100, "Richard Lewis" <[EMAIL PROTECTED]> said: > > On Tue, 30 Aug 2005 11:17:25 +0100, "Richard Lewis" > <[EMAIL PROTECTED]> said: > > > > Here is the *complete* code for my SectionCursor class: > > In case anyone's interested, I've just noticed a logical error in

Perl books (was: Experience regarding Python tutorials?)

2005-08-30 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, SamFeltus <[EMAIL PROTECTED]> wrote: . . . >with (google TMTOWTDI), so Perl will teach you to BE CAREFUL. The >O'Reilly Perl books are excellent. > Well, no. I understand you writing that, and

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 30)

2005-08-30 Thread \"\" Diez B.Roggisch \"\"
QOTW: "If I wanted to write five lines instead of one everywhere in a Python program, I'd use Java." -- Paul Rubin http://groups.google.com/group/comp.lang.python/msg/6fac4f3022acd1fa?hl=de&; "i think less buggy code is not the main concern for all." -- km http://groups.google.com/group/co

Re: time.mktime problem

2005-08-30 Thread McBooCzech
according to the Python documentation: http://docs.python.org/lib/module-time.html ===snip=== Values 100-1899 are always illegal. . . strptime(string[, format]) . . The default values used to fill in any missing data are: (1900, 1, 1, 0, 0, 0, 0, 1, -1) ===snip=== BTW, check the following code: >

Re: micro-python - is it possible?

2005-08-30 Thread McBooCzech
Check Lua programing language. Maybe this can fit your requirements. HTH Petr Jakes -- http://mail.python.org/mailman/listinfo/python-list

Re: Yielding a chain of values

2005-08-30 Thread Michael Hudson
Talin <[EMAIL PROTECTED]> writes: > I'm finding that a lot of places within my code, I want to return the > output of a generator from another generator. Currently the only > method I know of to do this is to explicitly loop over the results > from the inner generator, and yield each one: > >

Re: Warning when doubly linked list is defined gloablly

2005-08-30 Thread chand
Hi Terry.., Here is the code which gives the error... Let me know exact reason for this Error import os,sys,re,string,math from xml.dom import minidom, Node from Layer import Layer from LMessage import * from Param import * from Message import * from message_mapping import * from protocol_mappi

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 30)

2005-08-30 Thread \"\" Diez B.Roggisch \"\"
QOTW: "If I wanted to write five lines instead of one everywhere in a Python program, I'd use Java." -- Paul Rubin http://groups.google.com/group/comp.lang.python/msg/6fac4f3022acd1fa?hl=de&; "i think less buggy code is not the main concern for all." -- km http://groups.google.com/group/co

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread Robert Kern
Bryan Olson wrote: > Robert Kern wrote: > > from Numeric import * > > A = array([[0, 1], [2, 3], [4, 5]]) > > A[$-1, $-1] > > > > The result of len(A) has nothing to do with the second $. > > I think you have a good observation there, but I'll stand by my > correctness. len() cannot b

Re: variable hell

2005-08-30 Thread Tim N. van der Leeuw
What you could do is to create a class for this; fill it's __dict__ instance; and use custom getattr() / setattr() methods for accessing a0, a1, a2 etc. cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

SpamBayes wins PCW Editors Choice Award for anti-spam software.

2005-08-30 Thread Alan Kennedy
Hi All, If there any contributors of SpamBayes reading, Congratulations! SpamBayes has won the Personal Computer World (pcw.co.uk) Editors Choice award for anti-spam software, in a review of anti-SPAM solutions in the October 2005 edition. (PCW, for those who don't know it, is sort of the UK's

Re: close failed: [Errno 0] No error goes to stdout

2005-08-30 Thread Yoav
Steve Holden wrote: > Yoav wrote: > >> I run a Java command line program. The point is, that it's not the >> program that output this error message for sure. And I don't expect >> popen3() to catch and report errors. I just want to keep my screen >> output clean, and I expect popen3() to run th

regexps with unicode-aware characterclasses?

2005-08-30 Thread Stefan Rank
Hi all, in a python re pattern, how do I match all unicode uppercase characters (in a unicode string/in a utf-8 string)? I know that there is string.uppercase/.lowercase which are 'locale-aware', but I don't think there is a "all locales" locale. I know that there is a re.U switch that makes \

Problem with select.poll and popen2

2005-08-30 Thread Magnus Lycka
I'm trying to read standard out in a process started with popen2 in a non-blocking way. (Other good ways of doing this than the one I tried are appreciated.) I've tried to dumb down my code to see what happens, and socket.poll seems to behave very strangely. I've tried to use the .poll method for

Re: python and ajax

2005-08-30 Thread gene tani
http://www.modernmethod.com/sajax/ http://selenium.thoughtworks.com/usage.html Stephan Diehl wrote: > On Mon, 29 Aug 2005 12:04:46 -0700, Steve Young wrote: > > > Hi, I was wondering if anybody knew of any good > > tutorial/example of AJAX/xmlhttprequest in python. > > Thanks. > > > > -Steve > > A

Anyone know how to do this in pyOpenSSL

2005-08-30 Thread Scott Chapman
The pyOpenSSL list is _very_ quiet. I'm hoping somebody here knows how to do this: openssl smime -sign -in $tempfile -signer /path/to/my_cert -inkey /path/to/my_key -outform der -nodetach -binary | openssl smime -encrypt -des3 -binary -outform pem /path/to/paypal_public_cert ... using pyOpenS

Re: reg email packages work

2005-08-30 Thread Sybren Stuvel
Steve Holden enlightened us with: > It's obvious you aren't using that EXACT code, because it doesn't > formulate a three-paragraph message. So the bit we really need to > see is how you capture and formulate the argument to set_payload(). I'd rather see what I asked for, which is the output of ms

Re: micro-python - is it possible?

2005-08-30 Thread Grant Edwards
On 2005-08-30, Evil Bastard <[EMAIL PROTECTED]> wrote: > Has anyone done any serious work on producing a subset of python's > language definition that would suit it to a tiny microcontroller > environment? No, not a tiny microcontroller environment. In the microcontroller world, "tiny" means 100

Re: regexps with unicode-aware characterclasses?

2005-08-30 Thread Fredrik Lundh
Stefan Rank wrote: > I know that there is a re.U switch that makes \w match all unicode word > characters, but there are no subclasses of that ([[:upper:]] or preferably > \u). unicode character classes are not supported by the current RE engine. it's usually possible to work around this by mat

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-30 Thread max
"n00m" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > When I double-click on "some.py" file console window appears just > for a moment and right after that it's closed. If this script is > started from inside of IDLE (F5 key) then it executes as it > should be (e.g. executing all its prin

Re: array of arrays question

2005-08-30 Thread gene tani
I think this is addressed somewhere in a python Gotchas list. These lists're huge, but if you scan thru these every once in a while, they're big timesavers: http://www.ferg.org/projects/python_gotchas.html http://zephyrfalcon.org/labs/python_pitfalls.html http://zephyrfalcon.org/labs/beginners_mi

how to join two Dictionary together?

2005-08-30 Thread DENG
dict1={...something...} dict2={...somethind else ..} dict1 + dict2 that's does works ..:(, it's not like List... anyone can tell me how to get it? thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join two Dictionary together?

2005-08-30 Thread Iain King
DENG wrote: > dict1={...something...} > > dict2={...somethind else ..} > > dict1 + dict2 > > > that's does works ..:(, it's not like List... > > > anyone can tell me how to get it? > Uh, I'm just learning python too, so there may be a much simpler way to do this, but you could: dict3 = {} for k,

Re: micro-python - is it possible?

2005-08-30 Thread Wouter van Ooijen (www.voti.nl)
>No, not a tiny microcontroller environment. In the >microcontroller world, "tiny" means 100 bytes of ram and 4KB of >code space. That's medium :) PIC10F200: 256 12-bit instructions, 16 bytes RAM. Wouter van Ooijen -- http://www.voti.nl Webshop for PICs

Re: how to join two Dictionary together?

2005-08-30 Thread Benji York
See http://docs.python.org/lib/typesmapping.html for a description of the "update" method. -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join two Dictionary together?

2005-08-30 Thread Will McGugan
DENG wrote: > dict1={...something...} > > dict2={...somethind else ..} > > dict1 + dict2 > > > that's does works ..:(, it's not like List... I think you want.. dict1.update(dict2) Will McGugan -- http://www.willmcgugan.com "".join({'*':'@','^':'.'}.get(c,0) or chr(97+(ord(c)-84)%26) for c

Re: how to join two Dictionary together?

2005-08-30 Thread DENG
yes, that's really what i want! the 2nd replace the 1st one' value! thanks so much King -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join two Dictionary together?

2005-08-30 Thread Iain King
Iain King wrote: > DENG wrote: > > dict1={...something...} > > > > dict2={...somethind else ..} > > > > dict1 + dict2 > > > > > > that's does works ..:(, it's not like List... > > > > > > anyone can tell me how to get it? > > > > Uh, I'm just learning python too, so there may be a much simpler way

Re: how to join two Dictionary together?

2005-08-30 Thread Mikael Olofsson
DENG wrote: > dict1={...something...} > dict2={...somethind else ..} > dict1 + dict2 > > that's does works ..:(, it's not like List... > anyone can tell me how to get it? I would do the following in most cases. >>> dict1={'a':'A'} >>> dict2={'b':'B'} >>> dict3=dict1.copy() >>> dict3 {'a': 'A

Re: Jargons of Info Tech industry

2005-08-30 Thread Mark McIntyre
On Tue, 30 Aug 2005 11:30:19 GMT, in comp.lang.c , [EMAIL PROTECTED] wrote: >Why do I think of a Dutch expression 'mieren neuker' with regards to >Balmer's posts? Its a complete mystery. Just as is the reason why you are x-posting complete garbage to comp.lang.c... -- Mark McIntyre CLC FAQ

RE: how to join two Dictionary together?

2005-08-30 Thread Michael . Coll-Barth
update works like append for lists a = {} a['a']='a' a['c']='c' b={} b['b'] = 'b' c={} c.update(a) c.update(b) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] n.org]On Behalf Of DENG Sent: Tuesday, August 30, 2005 10:45 AM To: python-list@python.org Subject: how to

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-30 Thread [EMAIL PROTECTED]
n00m wrote: > When I double-click on "some.py" file console window appears just for a > moment and right after that it's closed. If this script is started from > inside of IDLE (F5 key) then it executes as it should be (e.g. > executing all its print statements). > > Any ideas? OS: Windows; Python

Re: how to join two Dictionary together?

2005-08-30 Thread DENG
thanks all!! update is very useful! -- http://mail.python.org/mailman/listinfo/python-list

Re: how to join two Dictionary together?

2005-08-30 Thread gene tani
look Pyth Cookbook 2nd edit, Sec 4.17: "Unions/intersections dictionaries". You'll see idioms like this for dict unions: uniondict=dict(dict1, **dict2) filter (dicta.has_key, dictb.keys()) DENG wrote: > yes, that's really what i want! > > the 2nd replace the 1st one' value! > > thanks so much

Re: how to join two Dictionary together?

2005-08-30 Thread Iain King
[EMAIL PROTECTED] wrote: > update works like append for lists > > a = {} > a['a']='a' > a['c']='c' > b={} > b['b'] = 'b' > c={} > c.update(a) > c.update(b) > So what do you think is the better way to do it, based on speed or aesthetics? (1) c=a.copy() c.update(b) or (2) c={} c.update(a) c.upd

Re: ANN: PyDev 0.9.8 released

2005-08-30 Thread Max M
Fabio Zadrozny wrote: > Hi All, > > PyDev - Python IDE (Python Development Enviroment for Eclipse) version > 0.9.8 has just been released. I read this, and thought it was time to check out both Eclipse, end the pydev plugin. I got it all installed, along with a subversion plugin for eclipse,

Re: how to join two Dictionary together?

2005-08-30 Thread Roy Smith
In article <[EMAIL PROTECTED]>, DENG <[EMAIL PROTECTED]> wrote: > >dict1={...something...} > >dict2={...somethind else ..} > >dict1 + dict2 > > >that's does works ..:(, it's not like List... > > >anyone can tell me how to get it? > >thanks in advance First, you have to tell us what you want to hap

Re: File parser

2005-08-30 Thread infidel
Angelic Devil wrote: > I'm building a file parser but I have a problem I'm not sure how to > solve. The files this will parse have the potential to be huge > (multiple GBs). There are distinct sections of the file that I > want to read into separate dictionaries to perform different > operations

Re: aproximate a number

2005-08-30 Thread billiejoex
I wanted the round up the number (5.0 = 5.0, not 6.0.). The ceil funciotn is the right one for me. Thanks to all. >> Grant Edwards wrote: >>> On 2005-08-30, Devan L <[EMAIL PROTECTED]> wrote: >>> > >>> > RoundToInt(2.0) will give you 3. >>> >>> That's what the OP said he wanted. The next bigger

Re: micro-python - is it possible?

2005-08-30 Thread Grant Edwards
On 2005-08-30, Wouter van Ooijen (www.voti.nl) <[EMAIL PROTECTED]> wrote: >>No, not a tiny microcontroller environment. In the >>microcontroller world, "tiny" means 100 bytes of ram and 4KB of >>code space. > > That's medium :) > > PIC10F200: 256 12-bit instructions, 16 bytes RAM. Touché -- G

py2exe can't compile this program

2005-08-30 Thread billiejoex
Hi all. I tried to compile this little source with py2exe: http://pastebin.com/350143 ...but once I execute the program I encount this error: C:\src\dist>sniffer.exe Traceback (most recent call last): File "sniffer.py", line 24, in ? File "sniffer.py", line 18, in get_int LookupError: no codec

Re: micro-python - is it possible?

2005-08-30 Thread Magnus Lycka
Evil Bastard wrote: > Hi, > > Has anyone done any serious work on producing a subset of python's > language definition that would suit it to a tiny microcontroller > environment? Isn't pypy meant to support different backends with different requirements and constraints using the same basic langua

Re: Problem with select.poll and popen2

2005-08-30 Thread Magnus Lycka
Magnus Lycka wrote: > I'm trying to read standard out in a process started with popen2 > in a non-blocking way. (Other good ways of doing this than the > one I tried are appreciated.) I'm starting to get on top of this. First of all, I was confused by POLLIN and POLLOUT, since it's IN or OUT of th

Re: What are new-style classes?

2005-08-30 Thread Colin J. Williams
Reinhold Birkenfeld wrote: > Terry Hancock wrote: > >>On Sunday 28 August 2005 04:47 am, Vaibhav wrote: >> >>>I recently heard about 'new-style classes'. I am very sorry if this >>>sounds like a newbie question, but what are they? I checked the Python >>>Manual but did not find anything conclusive

Re: pydoc, best practices, and Data class

2005-08-30 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > I have a python program that I am trying to generate documentation for. > But in one of my files I have a class called "Data", when pydoc gets to > this class it just barfs. Well more specifically it generates > documentation for only that one class in the file, it ignore

Re: global interpreter lock

2005-08-30 Thread phil hunt
On Sun, 28 Aug 2005 20:34:07 GMT, Bryan Olson <[EMAIL PROTECTED]> wrote: >phil hunt wrote: > > Yes, find solutions. Don't find dangerous dead-ends that look like > > solutions but which will give you lots of trouble. > >If concurrency is a dead end, why do the programs that provide >the most sophis

Re: global interpreter lock

2005-08-30 Thread phil hunt
On Sun, 28 Aug 2005 19:25:55 -0400, Mike Meyer <[EMAIL PROTECTED]> wrote: >Bryan Olson <[EMAIL PROTECTED]> writes: >> phil hunt wrote: >> > Yes, find solutions. Don't find dangerous dead-ends that look like >> > solutions but which will give you lots of trouble. >> If concurrency is a dead end, w

Re: Code run from IDLE but not via double-clicking on its *.py

2005-08-30 Thread n00m
Thank you, guys, for your replies! Now it works! -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyDev 0.9.8 released

2005-08-30 Thread Fabio Zadrozny
Hi Max, I may be a little (or maybe a lot) biased for it (as I'm its maintainer), but as I do 'eat my own dogfood', I though I might share it with you... At my company, everybody that programs with python switched to pydev. Most people used 'highly customized' text-editors before pydev, as the

Embedding Matplotlib images into wxPython

2005-08-30 Thread [EMAIL PROTECTED]
I am trying to embed images into a wxPython app (created using Boa Constructor), but have not been able to do so. I know how to embed plots, but images seem to be a problem. I've tried using code analogous to the example given at the Matplotlib website to no avail. If anybody has been successful at

Re: File parser

2005-08-30 Thread Mike C. Fletcher
infidel wrote: >Angelic Devil wrote: > > ... >Some time ago I was toying around with writing a tool in python to >parse our VB6 code (the original idea was to write our own .NET >conversion tool because the Wizard that comes with VS.NET sucks hard on >some things). I tried various parsing tool

py2exe can't compile this program

2005-08-30 Thread Uwe Schmitt
> > Hi all. I tried to compile this little source with py2exe: > http://pastebin.com/350143 > ...but once I execute the program I encount this error: > > C:\src\dist>sniffer.exe > Traceback (most recent call last): > File "sniffer.py", line 24, in ? > File "sniffer.py", line 18, in get_int >

Re: micro-python - is it possible?

2005-08-30 Thread Michael Hudson
Magnus Lycka <[EMAIL PROTECTED]> writes: > Evil Bastard wrote: >> Hi, >> Has anyone done any serious work on producing a subset of python's >> language definition that would suit it to a tiny microcontroller >> environment? > > Isn't pypy meant to support different backends with different > requir

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-08-30 Thread phil hunt
On Tue, 30 Aug 2005 08:53:27 GMT, Bryan Olson <[EMAIL PROTECTED]> wrote: > Specifically, to support new-style slicing, a class that > accepts index or slice arguments to any of: > > __getitem__ > __setitem__ > __delitem__ > __getslice__ > __setslice__

Re: Writing Multithreaded Client-Server in Python.

2005-08-30 Thread Steve Holden
Paul Rubin wrote: > [EMAIL PROTECTED] writes: > >>What it does do, is handle each request (from the same client too) in a >>new separate thread. Convenient if your processing intensive handle may >>otherwise slow down the main server process becoming less responsive to >>other requests. >>What it

Python2Html regex question

2005-08-30 Thread Gerard Flanagan
Hello I've been using the Html Formatter at http://www.manoli.net/csharpformat to format c# code (paste your code into the box, click the button and get html/css). Is there anything similar for Python code, does anyone know? Either way, the (c#) source is available for the above formatter and it

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-30 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-08-29, Steve Holden schreef <[EMAIL PROTECTED]>: > >>Antoon Pardon wrote: >> >>>Op 2005-08-27, Steve Holden schreef <[EMAIL PROTECTED]>: >>> >>> If you want an exception from your code when 'w' isn't in the string you should consider using index() rather tha

Re: Python2Html regex question

2005-08-30 Thread Trent Mick
[Gerard Flanagan wrote] > I've been using the Html Formatter at > http://www.manoli.net/csharpformat to format c# code (paste your code > into the box, click the button and get html/css). Is there anything > similar for Python code, does anyone know? Checkout SilverCity: http://silvercity.sou

Precise timings ?

2005-08-30 Thread Madhusudan Singh
Hi I am using time.clock() to get the current time of the processor in seconds. For my application, I need really high resolution but currently seem to be limited to 0.01 second. Is there a way to specify the resolution (say 1-10 microseconds) ? My processor is a 1.4 MHz Intel processor. Surely, i

Re: variable hell

2005-08-30 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>Yes. A large part of learning a language is discovering the many idioms >>that have already been established for doing certain things. These are a >>kind of shorthand, established by long convention, that allow one to >>avoid the "learning-by-use"

  1   2   >