Re: pre-PEP: The create statement

2006-04-06 Thread Sion Arrowsmith
Kay Schluehr <[EMAIL PROTECTED]> wrote: >Steven Bethard wrote: >> Python-Version: 2.6 >Have you a rough estimation how many modules will be broken when >"create" is introduced as a keyword? A quick scan of the standard library suggests that it will have a grand total of 3 modules requiring a fix (

Re: pre-PEP: The create statement

2006-04-06 Thread Azolex
Michele Simionato wrote: > Steven Bethard wrote: >> The PEP is based on a suggestion [1]_ from Michele Simionato on the >> python-dev list. > > True, but I would also mention that the idea of the 'create' keyword > come from > Nick Coghlan: > > http://mail.python.org/pipermail/python-dev/2005-Oct

Re: GUI issues in Python

2006-04-06 Thread Daniel Dittmar
[EMAIL PROTECTED] wrote: > I want to create a GUI where a user can select drag and drop kind of > boxes, circles and make connections between them. > > This is basically for depicting states and dependencies. I am writing a > program where I let the user input states and dependencies in a certain

Re: urllib.urlencode wrongly encoding � character

2006-04-06 Thread Fredrik Lundh
Evren Esat Ozkan wrote: > when I remove "# -*- coding: utf-8 -*-" line from start of the script > it worked properly. So I moved variable decleration to another file and > imported than it worked too. the coding directive controls how *unicode* literals in the *source code* are parsed into unic

Re: GUI issues in Python

2006-04-06 Thread diffuser78
Thanks Daniel, I really think that this should be the solution to my problem. A quick Question...is wxPython Operating System dependent or it can be used with anu OS like Linux, Windows and Mac ? -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Sion Arrowsmith wrote: > Kay Schluehr <[EMAIL PROTECTED]> wrote: > >Steven Bethard wrote: > >> Python-Version: 2.6 > >Have you a rough estimation how many modules will be broken when > >"create" is introduced as a keyword? > > A quick scan of the standard library suggests that it will have > a gran

Re: DO NOT USE JAVA BECAUSE IT IS NOT OPEN SOURCE

2006-04-06 Thread Dean G.
[EMAIL PROTECTED] wrote: > Programing Languiges Are Ment to be free. That is why i am starting The > Coo De Tar thats french for Blow of state it is a flash/java > alternative and if you are going to use a server side languige use > Perl,Python or better yet Ruby. What is the point of a languige w

Re: python411 podcast -- problem with the 'modules' podcast?

2006-04-06 Thread John Salerno
[EMAIL PROTECTED] wrote: > John, I'll go back and look intoi this tonight on the Modules Podcast. > Sometimes, the problems are specific to a given user's equipmentn, and > I don't always know how to fix them, which is frustrating. But, maybe > there is a problem I can fix with that podcast. I'll

Re: GUI issues in Python

2006-04-06 Thread Grant Edwards
On 2006-04-06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Thanks Daniel, I really think that this should be the solution to my > problem. > > A quick Question...is wxPython Operating System dependent or it can be > used with anu OS like Linux, Windows and Mac ? http://wxwidgets.org/ -- Grant

Re: Counting all permutations of a substring

2006-04-06 Thread Michele Simionato
Azolex wrote: > Python 2.5a1 (r25a1:43589, Apr 5 2006, 10:36:43) [MSC v.1310 32 bit > (Intel)] on win32 > ... > >>> cnt_ss = lambda s,ss,p=-1,n=-1 : n if n>p else > >>> cnt_ss(s,ss,s.find(ss,p+1),n+1) Ah, the pleasure of having a ternary operator in the language! Michele Simionato --

Re: GUI issues in Python

2006-04-06 Thread Daniel Dittmar
[EMAIL PROTECTED] wrote: > Thanks Daniel, I really think that this should be the solution to my > problem. > > A quick Question...is wxPython Operating System dependent or it can be > used with anu OS like Linux, Windows and Mac ? > see http://www.wxpython.org/download.php#binaries Linux and Wi

Re: pre-PEP: The create statement

2006-04-06 Thread Ron Adam
> Abstract > > > This PEP proposes a generalization of the class-declaration syntax, > the ``create`` statement. The proposed syntax and semantics parallel > the syntax for class definition, and so:: > >create : > > > is translated into the assignment:: > > = ("", ,

Re: python on Mac

2006-04-06 Thread Thomas Nelson
Well, as I stated in post, I've already replaced the link at /usr/bin/python. I'm not clear why that's unhealthy. Should I change it back to whatever it was before? I guess maybe it was /System/Library/Frameworks/Python.framework/Versions/Current/bin/python ? Thanks, THN -- http://mail.python.

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Tim N. van der Leeuw wrote: > Could this still make it in Python 2.5 even? If it's pushed hard > enough? I don't know if this has been discussed on the python-dev > mailing lists and what the reactions of python-devs and GvR was? Unlikely. I haven't posted it to python-dev yet, and they've basical

Re: pre-PEP: The create statement

2006-04-06 Thread Sion Arrowsmith
Michele Simionato <[EMAIL PROTECTED]> wrote: >Sion Arrowsmith wrote: >> A quick scan of the standard library suggests that it will have >> a grand total of 3 modules requiring a fix (it's a method name >> in imaplib and a named argument in a couple of places in bsddb >> and distutils). Your own cod

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Carl Banks wrote: > Steven Bethard wrote: >> This PEP proposes a generalization of the class-declaration syntax, >> the ``create`` statement. The proposed syntax and semantics parallel >> the syntax for class definition, and so:: >> >> create : >> >> >> is translated into the assignm

[fcntl]how to lock a file

2006-04-06 Thread marcello
Hello I need to do this: 1 opening a file for writing/appending 2 to lock the file as for writing (i mean: the program that lock can keep writing, all others programs can't ) 3 wtite and close/unlock Even better would be changing the order of steps 1 and 2 (that is,first locking than writing,

xml <-> python Re: pre-PEP: The create statement

2006-04-06 Thread Azolex
Steven Bethard wrote: ... > > Optional Extensions > === > > Remove the create keyword > - > > It might be possible to remove the create keyword so that such > statements would begin with the callable being called, e.g.: > > module mod: > def f

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Sion Arrowsmith wrote: > Michele Simionato <[EMAIL PROTECTED]> wrote: > >Sion Arrowsmith wrote: > >> A quick scan of the standard library suggests that it will have > >> a grand total of 3 modules requiring a fix (it's a method name > >> in imaplib and a named argument in a couple of places in bsdd

Re: Difference in Python and Ruby interactive shells

2006-04-06 Thread dmh2000
Thanks all for the responses. Extra kudos to Steve J and Michele S. that cleared it up for me. the context of my question comes from reading up on Lisp in "Loving Lisp - the Savy Programmer's Secret Weapon", http://www.markwatson.com/opencontent/lisp_lic.htm, where the author described building up

Re: python on Mac

2006-04-06 Thread Robert Kern
Thomas Nelson wrote: > Well, as I stated in post, I've already replaced the link at > /usr/bin/python. I'm not clear why that's unhealthy. The FAQ describes why it's unhealthy in detail. "FAQ 5.7 Describe Apple's Framework implementation of Python and how that affects me adding new Python imple

updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html In this post, I'm especially soliciting review of

Re: "definitive" source on advanced python?

2006-04-06 Thread pruebauno
vdrab wrote: > Hi all, > > Is there some sort of coherent source (dead tree format, maybe?) on > some of the more advanced features > of python (decorators, metaclasses, etc)? I'm sort of looking for a If you just want a good book in feature description I recomend Python in a Nutshell. It will ex

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Carl Banks wrote: > My biggest concern with this is the special arguments of the caller. > It breaks my heart that we couldn't do something like this: > > create dict keymap: > A = 1 > B = 2 > > And it'll probably confuse people as well. We ought to keep that in > mind. > > > > Of course,

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michele Simionato wrote: > Carl Banks wrote: >>> create module mod: >>> "This creates a sub-module named mod with an f1 function" >>> >>> def f1(): >>> ... >> Let's not do this, really. A module should be one-to-one with a file, >> and you should be able to impo

Re: updated pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Steven Bethard wrote: > I've updated the PEP based on a number of comments on comp.lang.python. > The most updated versions are still at: > > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html > > In this post, I'

How can I get the text under the cusor ?

2006-04-06 Thread Bo Yang
Hello , I want to develop an application to record some of the best words and ideas in the web when I surfing with the Firefox or IE . I would like the application have such a GUI : 1.it appear in the system tray area in the Windows ; 2.whenever I select some words (ether in an IE or MS word),I hop

Re: How can I get the text under the cusor ?

2006-04-06 Thread Fredrik Lundh
"Bo Yang" wrote: > I want to develop an application to record some of the best words and > ideas in the web when I surfing with the Firefox or IE . > I would like the application have such a GUI : > 1.it appear in the system tray area in the Windows ; > 2.whenever I select some words (ether in an

Re: GUI issues in Python

2006-04-06 Thread Thomas Jollans
[EMAIL PROTECTED] wrote: > My question basically revolves around... that I dont want to draw > circles and boxes for drawing purposes. > > I want the end user to be able to draw the GUI boxes and circles and > makes connection to depict states and dependencies. So its a little > unconventional an

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michele Simionato wrote: > Steven Bethard wrote: >> I've updated the PEP based on a number of comments on comp.lang.python. >> The most updated versions are still at: >> >> http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt >> http://ucsu.colorado.edu/~bethard/py/pep_create_sta

Re: shelve and ".bak .dat .dir" files

2006-04-06 Thread Michele Petrazzo
Sion Arrowsmith wrote: > > This is a documented behaviour of shelve: Sorry, I had read only the: """Open a persistent dictionary. The filename specified is the base filename""" ... :) > I guess this depends on what dbm shelve is built on the documentation > implies it goes through anydbm. I'm no

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Steven Bethard wrote: > I've updated the PEP based on a number of comments on comp.lang.python. > The most updated versions are still at: > > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt > http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html > > In this post, I

Re: How to work with directories and files with spaces

2006-04-06 Thread Larry Bates
[EMAIL PROTECTED] wrote: > hi > > I am working in unix and i have some directories names with spaces > eg ABC DEF A > how can i work effectively with spaces in directory/file names in > python? > > sometimes when i do os.path.join(dir_with_spaces,"-somestring" ) , it > gives me "-somestring" as

Re: how to create file with spaces

2006-04-06 Thread Larry Bates
Fulvio wrote: > Alle 18:18, giovedì 06 aprile 2006, [EMAIL PROTECTED] ha scritto: >> How can i deal with spaces in this case? > I don't have an idea with python, but if can help I may say that bash you > might use "\ " to escape a space or use a quoted full path. > The shell program "basename" is

ANN: ActivePython 2.4.3.11 is now available

2006-04-06 Thread Trent Mick
I'm happy to announce that ActivePython 2.4.3.11 is now available for free download from: http://www.ActiveState.com/Products/ActivePython/ This release is a maintenance/update release for existing platforms. Changes in this release include: - [Windows] Update to recent PyWin32 (build 208.1+)

Docstring line wrapping in C modules?

2006-04-06 Thread Kelvie Wong
While writing docstrings in C, they don't get wrapped properly (i.e., lines will break in the middle of a word) when invoking the `help' function. Is there any way to have Python break lines automatically, or do I have to write my own C function/vim script to do it? Kelvie -- http://mail.python.

32-bit python on Opteron, Solaris 10?

2006-04-06 Thread Gary Robinson
I'm in the market for a server to run some python code which is optimized via psyco. Sun T2100 servers come with Solaris 10, which comes with python pre-installed. Since those servers use the 64-bit Opteron box, I would assume that the Python is a 64-bit version. (Does anyone know whether thi

Re: pre-PEP: The create statement

2006-04-06 Thread Terry Reedy
"Azolex" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'd advocate for the shortest possible keyword, and - maybe because > English is not my native language - I'd thus prefer "make" if any is > really required. While currently +0 on the proposal, I am +1 on 'make' versus 'creat

Re: pre-PEP: The create statement

2006-04-06 Thread Terry Reedy
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is a very relevant question. I would expect the new keyword would > break lots > of modules. However measuring is better than speculating. Please run also with alternatives, such as 'make'. tjr -- http://

Re: Cleaning the current environment after a fork

2006-04-06 Thread Robin Haswell
On Thu, 06 Apr 2006 12:47:25 +0200, Diez B. Roggisch wrote: > And even if that wasn't the case: I think as long as you don't run into > memory-troubles, don't do it. Its complex, flaky and thus an unnecessary > source of failure. Yeah that sounds fair enough. Actually I ran in to threading proble

Quickie: converting r"\x2019" to int

2006-04-06 Thread Robin Haswell
Hey guys. This should just be a quickie: I can't figure out how to convert r"\x2019" to an int - could someone give me a hand please? Cheers -Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.5 (alpha 1)

2006-04-06 Thread Terry Reedy
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Michael Ekstrand wrote: >> The day Python (without using Stackless) has true continuations will be >> a happy day. Don't hold your breath. Guido regards 'true continuations' as complexity overload for the typical

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Kent Johnson
Robin Haswell wrote: > Hey guys. This should just be a quickie: I can't figure out how to convert > r"\x2019" to an int - could someone give me a hand please? Is this what you mean? In [9]: int(r'\x2019'[2:], 16) Out[9]: 8217 or maybe you meant this: In [6]: ord(u'\u2019') Out[6]: 8217 Kent --

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Just
In article <[EMAIL PROTECTED]>, Kent Johnson <[EMAIL PROTECTED]> wrote: > Robin Haswell wrote: > > Hey guys. This should just be a quickie: I can't figure out how to convert > > r"\x2019" to an int - could someone give me a hand please? > > Is this what you mean? > In [9]: int(r'\x2019'[2:], 16)

Re: Quickie: converting r"\x2019" to int

2006-04-06 Thread Fredrik Lundh
Just wrote: > > Robin Haswell wrote: > > > Hey guys. This should just be a quickie: I can't figure out how to convert > > > r"\x2019" to an int - could someone give me a hand please? > > > > Is this what you mean? > > In [9]: int(r'\x2019'[2:], 16) > > Out[9]: 8217 > > > > or maybe you meant this:

Re: output formatting for user-defined types

2006-04-06 Thread Russ
>Yeah, how about we read your mind or make wild guesses about why it's >not acceptable, and about what your requirements really are. >Really, your response seems a little bizarre to me, given that __float__ >is the defined way in which float() gets a value from an instance, and >float() is what th

Re: help with designing an app. based on ConfigParser

2006-04-06 Thread Fuzzyman
Alexandre CONRAD wrote: [snip..] > > So I told my self, the best way would be able to have a "sub-section". I > could then look for all servers (aka sub-sections) inside [UPDATE > SERVERS] and retrieve the needed info. But AFAIK, it's not possible > having sub-sections with ConfigParser. So I'm he

Re: HTMLParser fragility

2006-04-06 Thread Paul Boddie
Richie Hindle wrote: > > But Tidy fails on huge numbers of real-world HTML pages. Simple things like > misspelled tags make it fail: > > >>> from mx.Tidy import tidy > >>> results = tidy("Hello world!") [Various error messages] > Is there a Python HTML tidier which will do as good a job as a bro

Re: XMLRPCLIB appears to be broken?

2006-04-06 Thread flamesrock
Thanks for the response. I'm using IXR_library, which is one of the defato xml-rpc libs out there. It seems to be working for other people... The reason I think its a python error is because php doesn't understand lists, which is what the data is being returned as. -- http://mail.python.org/mai

Re: XMLRPCLIB appears to be broken?

2006-04-06 Thread Fredrik Lundh
"flamesrock" wrote: > I'm using IXR_library, which is one of the defato xml-rpc libs out > there. It seems to be working for other people... > > The reason I think its a python error is because php doesn't understand > lists, which is what the data is being returned as. umm. xml-rpc is a platfor

Re: how to create file with spaces

2006-04-06 Thread infidel
dirpath is just a string, so there's no sense in putting it in a list and then iterating over that list. If you're trying to do something with each file in the tree: for dir, subdirs, names in os.walk(rootdir): for name in names: filepath = os.path.join(dir, name) + "-dummy" i

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Terry Reedy wrote: > "Michele Simionato" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> This is a very relevant question. I would expect the new keyword would >> break lots >> of modules. However measuring is better than speculating. > > Please run also with alternatives, such a

good style guides for python-style documentation ?

2006-04-06 Thread Fredrik Lundh
(reposted from doc-sig, which seems to be mostly dead these days). over at the pytut wiki, "carndt" asked: Are there any guidelines about conventions concerning punctuation, text styles and language style (e.g. how to address the reader)? any suggestions from this list ? -- htt

How to create a tear off menu in TKinter. Help Needed

2006-04-06 Thread ishtar2020
Hi everybody I'd appreciate some help on creating a tear off menu with TkInter. I've been reading some documentation but still no luck. Please don't get confused: when I mean "tear off" menu I don't mean a drop-down or a pop-up menu, but those options which yield to another batch of sub-options w

Re: XMLRPCLIB appears to be broken?

2006-04-06 Thread flamesrock
Ughhh I feel like such an idiot :( Thanks for clearing that up it works now. -- http://mail.python.org/mailman/listinfo/python-list

Partially unpacking a sequence

2006-04-06 Thread tkpmep
I have a list y >>>y ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', '19.500', '224'] from which I want to extract only the 2nd and 4th item by partially unpacking the list. So I tried >>>a,b = y[2,4] Traceback (most recent call last): File "", line 1, in ? TypeError: list indices

Re: good style guides for python-style documentation ?

2006-04-06 Thread Ron Adam
> (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any suggestions from this

Re: Partially unpacking a sequence

2006-04-06 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a list y > >>>y > ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', > '19.500', '224'] > > from which I want to extract only the 2nd and 4th item by partially > unpacking the list. So I tried > >>>a,b = y[2,4] > Trace

Re: Partially unpacking a sequence

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I have a list y > >>>y > ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', > '19.500', '224'] > > from which I want to extract only the 2nd and 4th item by partially > unpacking the list. So I tried > >>>a,b = y[2,4] > Traceback (most recent call last): >

Re: Partially unpacking a sequence

2006-04-06 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I have a list y > > >>>y > > ['20001201', 'ARRO', '04276410', '18.500', '19.500', '18.500', > > '19.500', '224'] > > > > from which I want to extract only t

standard library audio/image support

2006-04-06 Thread Johan Kotlinski
Hi there! I spent the afternoon making a simple graphics-to-audio converter.. I was surprised to find that the AIFF parser/writer is in the standard library, but that I had to go to some external library for opening and manipulating a JPG file. How come audio is deemed more important for the sta

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Apr 4)

2006-04-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, gene tani <[EMAIL PROTECTED]> wrote: > >Peter Otten wrote: >> The old Python "To-Do List" now lives principally in a >> SourceForge reincarnation. >> http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse >> http://python.source

Re: "definitive" source on advanced python?

2006-04-06 Thread Russ Salsbury
[EMAIL PROTECTED] wrote: > vdrab wrote: > > Hi all, > > > > Is there some sort of coherent source (dead tree format, maybe?) on > > some of the more advanced features > > of python (decorators, metaclasses, etc)? I'm sort of looking for a > > If you just want a good book in feature description I

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Steve R. Hastings
On Wed, 05 Apr 2006 22:08:29 -0700, Carl Banks wrote: >> for i in range(n) >> >> into compiled code equivalent to >> >> for i in itr >> >> where "itr" is a lightweight iterator that returns the same values as >> iter(range(n)). > Nope, out of the question for Python 2.x. Note that the the builtin

Missing C modules in 2.5 on OS X?

2006-04-06 Thread Jay Parlar
I just downloaded, built, and installed the new 2.5 alpha on OS X 10.3, and it seems that the new 'functional' didn't get installed. I know that it got built (done from the 2.5 source directory): Jay-Computer:~/Desktop/Python-2.5a1 jayparlar$ find . -iname functional* ./build/lib.darwin-7.9.0-Po

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Fredrik Lundh
Carl Banks wrote: > > I wondered if the Python compiler could, as a special case, turn: > > > > for i in range(n) > > > > into compiled code equivalent to > > > > for i in itr > > > > where "itr" is a lightweight iterator that returns the same values as > > iter(range(n)). > > Nope, out of the que

Re: Partially unpacking a sequence

2006-04-06 Thread tkpmep
Thank you, everyone, for resolving my question. At one point, while trying to solve the problem, I typed >>> y[1,3] Traceback (most recent call last): File "", line 1, in ? TypeError: list indices must be integers The error message gave me no clue as to what I was doing wrong (in my mind, I was

Re: good style guides for python-style documentation ?

2006-04-06 Thread John Salerno
Fredrik Lundh wrote: > (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any

Re: Partially unpacking a sequence

2006-04-06 Thread Fredrik Lundh
Paul McGuire wrote: > Forgot one: > > _,_,a,_,b,_,_,_ = y > > There actually is some merit to this form. If the structure of y changes > sometime in the future (specifically if a field is added or removed), this > statement will fail noisily, calling your attention to this change. But if > a ne

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Georg Brandl <[EMAIL PROTECTED]> wrote: >Alan Morgan wrote: > >>>range is giving you a real list, while xrange is giving you an xrange object. >>>Have you tried to slice an xrange object? Or using .append on it? >> >> No, I hadn't. I presume these could all be def

Re: Partially unpacking a sequence

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: y[1,3] > Traceback (most recent call last): > File "", line 1, in ? > TypeError: list indices must be integers > > The error message gave me no clue as to what I was doing wrong (in > my mind, I was just writing out the elements of a range), and I > tho

Re: Partially unpacking a sequence

2006-04-06 Thread jUrner
>> Thank you, everyone, for resolving my question. At one point, while >> trying to solve the problem, I typed >> > y[1,3] >> >> Traceback (most recent call last): >> File "", line 1, in ? >> TypeError: list indices must be integers >> >> The error message gave me no clue as to what I was doin

Re: Unicode, command-line and idle

2006-04-06 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: > This works if I use the console but gives the following error if I use > IDLE: > > Traceback (most recent call last): > File "C:\test.py", line 4, in ? > text2 = unicode(raw_input(), sys.stdin.encoding) > AttributeError: PyShell instance has no attribute 'encoding'

Re: How to create a tear off menu in TKinter. Help Needed

2006-04-06 Thread John McMonagle
On Thu, 2006-04-06 at 12:27 -0700, ishtar2020 wrote: > Hi everybody > > I'd appreciate some help on creating a tear off menu with TkInter. I've > been reading some documentation but still no luck. > > Please don't get confused: when I mean "tear off" menu I don't mean a > drop-down or a pop-up me

Re: Unicode, command-line and idle

2006-04-06 Thread John Machin
The docs say that the encoding attribute is "New in version 2.3". Python 2.2's IDLE produces exactly the exception reported by the OP. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple string formatting question

2006-04-06 Thread Steven D'Aprano
On Thu, 06 Apr 2006 22:16:05 +1000, Ben Finney wrote: > "Steven D'Aprano" <[EMAIL PROTECTED]> writes: >> I'm looking for a format string similar to '%.3f' except that >> trailing zeroes are not included. > > Can;t be done, to my knowledge. You specify a particular precision, > and the number wil

Re: python on Mac

2006-04-06 Thread Thomas Nelson
Ok, I fixed my /usr/bin/python and added /usr/public/bin/ to my PATH in .profile. Everything seems ok now. Thanks again to everyone for their help. THN -- http://mail.python.org/mailman/listinfo/python-list

Re: good style guides for python-style documentation ?

2006-04-06 Thread Ziga Seilnacht
Fredrik Lundh wrote: > (reposted from doc-sig, which seems to be mostly dead > these days). > > over at the pytut wiki, "carndt" asked: > > Are there any guidelines about conventions concerning > punctuation, text styles and language style (e.g. how > to address the reader)? > > any sug

Re: output formatting for user-defined types

2006-04-06 Thread Steven D'Aprano
On Thu, 06 Apr 2006 11:05:06 -0700, Russ wrote: >>Really, your response seems a little bizarre to me, given that __float__ >>is the defined way in which float() gets a value from an instance, and >>float() is what the % operator calls when it encounters a '%f' in the >>format string. > > My class

Can't Delete a Thread

2006-04-06 Thread flamesrock
I have the following two threads, called from a method: def uploading_region: uploading_region = AddRegionToServerThread(self,self.SESSION,create_region) while uploading_region.UPLOADING: pass #escape method when uploading_region thread is false

Re: binding - python

2006-04-06 Thread beta
Hi John, It works! thank you vey much. I have another question. I would very appreciated if you have any clue. I want the ball STOP whenever mouse is clicked anywhere, then ball KEEP MOVING when next mouse click is applied. Thanks. Regards, Quoc -- http://mail.python.org/mailman/listinfo/pyth

Re: Simple string formatting question

2006-04-06 Thread Ben Finney
"Steven D'Aprano" <[EMAIL PROTECTED]> writes: > On Thu, 06 Apr 2006 22:16:05 +1000, Ben Finney wrote: > > "Steven D'Aprano" <[EMAIL PROTECTED]> writes: 1> >> I'm looking for a format string similar to '%.3f' except that > >> trailing zeroes are not included. > > > > Can;t be done, to my knowledge

Re: output formatting for user-defined types

2006-04-06 Thread Russ
>I'm sorry, your system of units doesn't allow trig functions to operate on >degrees? I presume you don't allow grads either. What about steradians or >other arbitrary measures of angle or solid angle? I should have stated that more clearly. You can enter the value in degrees, but it will automati

Re: binding - python

2006-04-06 Thread John McMonagle
On Thu, 2006-04-06 at 16:39 -0700, beta wrote: > Hi John, > > It works! thank you vey much. > > I have another question. I would very appreciated if you have any clue. > > I want the ball STOP whenever mouse is clicked anywhere, then ball KEEP > MOVING when next mouse click is applied. Thanks. >

confusing behaviour of os.system

2006-04-06 Thread Todd
I'm trying to run the following in python. os.system('/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file \"test.c\")"') This connects to xemacs with gnuclient and runs htmlize. If I run it from a shell, xemacs gives me an error, but it generates the html file just fine. If I run the same

Re: Missing C modules in 2.5 on OS X?

2006-04-06 Thread Jay Parlar
On Apr 6, 2006, at 3:25 PM, Jay Parlar wrote: > I just downloaded, built, and installed the new 2.5 alpha on OS X > 10.3, and it seems that the new 'functional' didn't get installed. > > I know that it got built (done from the 2.5 source directory): > > Jay-Computer:~/Desktop/Python-2.5a1 jaypar

OpenGL on Intel Mac

2006-04-06 Thread Brian Victor
I am attempting to build PyOpenGL on my Intel iMac. The transcript of the build failure is here: http://brianhv.org/temp/pyopengl-build.log I'm using the universal MacPython 2.4.3 and PyOpenGL-2.0.1.09. The highlight of the build log is: /System/Library/Frameworks/Kernel.framework/Headers/sys/s

Re: pre-PEP: The create statement

2006-04-06 Thread Ben Cartwright
Michael Ekstrand wrote: > Is there a natural way > to extend this to other things, so that function creation can be > modified? For example: > > create tracer fib(x): > # Return appropriate data here > pass > > tracer could create a function that logs its entry and exit; behavior > could be

Re: confusing behaviour of os.system

2006-04-06 Thread Ben Cartwright
Todd wrote: > I'm trying to run the following in python. > > os.system('/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file > \"test.c\")"') Python is interpreting the \"s as "s before it's being passed to os.system. Try doubling the backslashes. >>> print '/usr/bin/gnuclient -batch -l htm

how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
Ok, I wrote this all by myself, which explains why it doesn't work. It is meant to take a number and generate the next number that follows according to the Morris sequence. It works for a single number, but what I'd like it to do is either: 1. repeat indefinitely and have the number of times co

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
John Salerno wrote: > 1. repeat indefinitely and have the number of times controlled elsewhere > in the program (e.g., use the morris() generator in a for loop and use > that context to tell it when to stop) > > 2. just make it a function that takes a second argument, that being the > number o

Re: 32-bit python on Opteron, Solaris 10?

2006-04-06 Thread ross lazarus
The answers depend entirely on the cpu in my experience. I'm staring at http://www.sun.com/servers/index.jsp and I can't see anything called a T2100. I have 3 X2100 servers which are opterons. Psyco only runs on x86 cpu hardware. Python cannot use psyco on opterons at all - 32 bit mode or other

Re: confusing behaviour of os.system

2006-04-06 Thread Todd
Ben Cartwright wrote: > Todd wrote: > > I'm trying to run the following in python. > > > > os.system('/usr/bin/gnuclient -batch -l htmlize -eval "(htmlize-file > > \"test.c\")"') > > Python is interpreting the \"s as "s before it's being passed to > os.system. Try doubling the backslashes. > > >>

Training/conventions featuring non-introductory Python

2006-04-06 Thread Jeff
Hey all, I'm looking around to see how best to spend the training monies allocated me by my employer for this year, and haven't really ever done this sort of thing before. I work primarily with Python (Django, Zope, and assorted small apps and scripts) so what would be best is something that is pr

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread John Salerno
John Salerno wrote: > 2. just make it a function that takes a second argument, that being the > number of times you want it to repeat itself and create numbers in the > sequence Here's what I've come up with so far. Probably not the most elegant solution because of the nested function, but it d

Re: updated pre-PEP: The create statement

2006-04-06 Thread skip
Steven> Optional Extensions Steven> === Steven> Remove the create keyword Steven> - Steven> It might be possible to remove the create keyword so that such Steven> statements would begin with the callable being called, e.g.:: Ste

glob and curly brackets

2006-04-06 Thread Zain Homer
Someone please let me know if I'm sending this to the wrong email alias... I'm wondering why we can't use the glob module to glob with curly brackets like we can from the command line (at least in tcsh). Is there a shell standard for which the python glob module has been designed which prevents t

Re: updated pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Steven> Optional Extensions > Steven> === > > Steven> Remove the create keyword > Steven> - > > Steven> It might be possible to remove the create keyword so that such > Steven> statements would begin with t

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread Lonnie Princehouse
The generator in your original post /does/ rebind seed, but only on the last iteration of the loop. You'll need to wrap that loop in another loop if you want the generator to yield more than once. As for "communicating" with a generator --- e.g. telling it to stop --- this might be done by passin

Re: how to make a generator use the last yielded value when it regains control

2006-04-06 Thread Ben Cartwright
John Salerno wrote: > It > is meant to take a number and generate the next number that follows > according to the Morris sequence. It works for a single number, but what > I'd like it to do is either: > > 1. repeat indefinitely and have the number of times controlled elsewhere > in the program (e.g

<    1   2   3   >