Re: Nice unicode -> ascii translation?

2006-08-06 Thread John Machin
[EMAIL PROTECTED] wrote: > I'm using the ID3 tag of an mp3 file to query musicbrainz to get their > sort-name for the artist. A simple example is "The Beatles" -> > MusicBrainz -> "Beatles, The". I then want to rename the mp3 file > using this information. However, I would like the filename to c

Re: Question about using python as a scripting language

2006-08-06 Thread Steve Lianoglou
Delaney, Timothy (Tim) wrote: > This is just asking for trouble. > > my_list = eval('import shutil; shutil.rmtree('/')') Hah .. wow. And in related news: you still shouldn't be taking candy from strangers. Point well taken. Thanks for flagging that one. -steve -- http://mail.python.org/mailma

Re: Open letter to BDFL begging forgiveness.

2006-08-06 Thread Alex Martelli
Terry Reedy <[EMAIL PROTECTED]> wrote: > "The Eternal Squire" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > I tried to send you a private response but Comcast rejected it ('not a > customer'). As a Comcast customer, I can confirm that Comcast's email system is a mess (which

Re: easy question about join method

2006-08-06 Thread nephish
very helpful indeed. i did a help([]) to see if it would give me anything for a list. wow. thanks a lot. -sk Terry Reedy wrote: > The easy way to get one answer for buildin funcs and methods is the help > function in the interactive interpreter (and Idle's and probably other > imitations thereof)

Re: Initializing the number of slots in a dictionary

2006-08-06 Thread Tim Peters
... [Jon Smirl] > I know in advance how many items will be added to the dictionary. Most > dictionary implementations I have previously worked with are more > efficient if they know ahead of time how big to make their tables. Richard Jones spent considerable time investigating whether "pre-sizing

Re: Initializing the number of slots in a dictionary

2006-08-06 Thread Jon Smirl
On Sun, 06 Aug 2006 15:33:30 -0700, John Machin wrote: > Jon Smirl wrote: >> Is there some way to tell a dictionary object that I am going to load 1M >> objects into it and have it pre-allocate enought slots to hold all of >> the entries? > > Not according to the manual. > > Not according to the

Re: Nice unicode -> ascii translation?

2006-08-06 Thread Brian Beck
[EMAIL PROTECTED] wrote: > The trick is finding the right . Has someone attempted this > before, or am I stuck writing my own solution? You want ASCII, Dammit: http://www.crummy.com/cgi-bin/msm/map.cgi/ASCII +Dammit -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mail

Re: easy question about join method

2006-08-06 Thread Terry Reedy
The easy way to get one answer for buildin funcs and methods is the help function in the interactive interpreter (and Idle's and probably other imitations thereof) is, for example, >>> help(str.join) Help on method_descriptor: join(...) S.join(sequence) -> string Return a string which

Re: Python open a named pipe == hanging?

2006-08-06 Thread Rochester
Thanks Alex, now I think I understand much better the fifo/pipe mechanism and how Python treats them. For those who are interested, I would like to restate the problem I was tring to solve and a working solution (inspired by Alex Martelli's code), feel free to criticize it: The problem: I

RE: Question about using python as a scripting language

2006-08-06 Thread Delaney, Timothy (Tim)
Steve Lianoglou wrote: > One thing you could do is use the eval or compile methods. These > functions let you run arbitray code passed into them as a string. > > So, for instance, you can write: > my_list = eval('[1,2,3,4]') This is just asking for trouble. my_list = eval('import shutil; shutil

Re: Why do I require an "elif" statement here?

2006-08-06 Thread John Savage
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >--- >whitespace = " " >old_indent = 3 >new_indent = 5 > >x = " starts with 3 spaces" > >x = x.replace(whitespace*old_indent, whitespace*new_indent) >--- > >In this example though, it will repl

Re: Question about using python as a scripting language

2006-08-06 Thread Terry Reedy
"heavydada" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm writing a small game in python and I need to be able to run some > scripts inside the game. In the game I have these creatures each with > some attributes like name and weight and an action. Right now I'm > saving all t

bind invalid when execute oracle sql statement.

2006-08-06 Thread wqhflp
Hi, I want to insert data into a table SQL> desc jijin Name Null?Type - - IDNOT NULL NUMBER(6) T_TIMENOT NULL DATE NET

Re: Open letter to BDFL begging forgiveness.

2006-08-06 Thread Terry Reedy
"The Eternal Squire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I tried to send you a private response but Comcast rejected it ('not a customer'). tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about using python as a scripting language

2006-08-06 Thread Steve Lianoglou
Hi, > I was wondering how I can read > commands from the XML file and then execute them in the game. ... > I just need some way of > being able to read from the file what function the program needs to > call next. Any help is appreciated. One thing you could do is use the eval or compile meth

Re: easy question about join method

2006-08-06 Thread nephish
yep, easy enough thanks -shawn Jorge Godoy wrote: > "nephish" <[EMAIL PROTECTED]> writes: > > > i have seen the join method before, mostly in this group and i want to > > get it a little better. > > > > if i have a list > > > > x = ['this','is','a','sentence','held','in','a','list'] > > > > how

Re: where can I find Python acceptance test suite?

2006-08-06 Thread Terry Reedy
"The Eternal Squire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I've been doing some hacking of the Python engine, and I've been > looking for > where the comprehensive regression tests are kept so that I can > determine > where I've broken part of the engine. ...python2x/Lib/

Nice unicode -> ascii translation?

2006-08-06 Thread crowell
I'm using the ID3 tag of an mp3 file to query musicbrainz to get their sort-name for the artist. A simple example is "The Beatles" -> MusicBrainz -> "Beatles, The". I then want to rename the mp3 file using this information. However, I would like the filename to contain only ascii characters, whi

Re: easy question about join method

2006-08-06 Thread Jorge Godoy
"nephish" <[EMAIL PROTECTED]> writes: > i have seen the join method before, mostly in this group and i want to > get it a little better. > > if i have a list > > x = ['this','is','a','sentence','held','in','a','list'] > > how can i make it print as a single string? or make a single string out > of

easy question about join method

2006-08-06 Thread nephish
i have seen the join method before, mostly in this group and i want to get it a little better. if i have a list x = ['this','is','a','sentence','held','in','a','list'] how can i make it print as a single string? or make a single string out of it ? thanks -- http://mail.python.org/mailman/list

Re: embedding console in wxpython app

2006-08-06 Thread Cary Miller
On 6 Aug 2006 14:06:30 -0700, Janto Dreijer <[EMAIL PROTECTED]> wrote: I'm writing a Linux filemanager using wxPython. I'd like to embed abash console inside it. I have found the Logilab pyqonsole(http://www.logilab.org/projects/pyqonsole ), but it uses PyQT.Does anyone know how to do this from wx?

Re: Proposal: [... for ... while cond(x)]

2006-08-06 Thread Diez B. Roggisch
> No, the list comprehension lets you write an expression directly avoiding a > function call, and it also allows you to add in a condition which can be > used to filer the sequence. Your proposal adds nothing. It does. Consider this: whatever = [x for x in xrange(10) while x < 10] T

Question about using python as a scripting language

2006-08-06 Thread heavydada
I'm writing a small game in python and I need to be able to run some scripts inside the game. In the game I have these creatures each with some attributes like name and weight and an action. Right now I'm saving all this information in an XML file, which I parse whenever I need it. I can handle the

is there any Report module in python?

2006-08-06 Thread pan
hi.just like ReportBuilder in delphi.i did some google, but can't find. -- http://mail.python.org/mailman/listinfo/python-list

pycrust xmlrpclib problem

2006-08-06 Thread Timothy Gee
Have do a lot of lab work making use of xmlrpclib and am quite dependent on it. I just started working with pycrust under Linux RH9, and wanted to use it as my standard python environment, however, when I import xmlrpclib, I get a segmentation fault. Command line still works fine however. Details f

Re: Open letter to BDFL begging forgiveness.

2006-08-06 Thread Robert J. Hansen
ObWarning: I'm not Guido. I'm not even a friend of Guido. That said, some people think I have a clue about the open-source community, so maybe this will be worth something. And perhaps it won't. Take it with a grain of salt. > However, I am beginning to suspect that my status as persona > non

Re: strftime replacement which supports Unicode format strings?

2006-08-06 Thread John Machin
Dennis Benzinger wrote: > Is there a library with a strftime replacement which supports Unicode > format strings? > Not that I know of. I presume that you're not happy with workarounds like: #>>> import datetime #>>> now = datetime.datetime.now() #>>> now.strftime('Year=%Y Month=%m Day=%d') 'Yea

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread Philippe Martin
jojoba wrote: > Hi Phillipe! > Thanks for the response! > > Unfortunately, i have also reinstalled pywin32, and i still get the > same error. > > Isn't this weird? > You know what else. > > I have a py2exe version of this code, that actually runs fine, using > the embedded windows media player.

Re: embedding console in wxpython app

2006-08-06 Thread Philippe Martin
Janto Dreijer wrote: > I'm writing a Linux filemanager using wxPython. I'd like to embed a > bash console inside it. I have found the Logilab pyqonsole > (http://www.logilab.org/projects/pyqonsole), but it uses PyQT. > > Does anyone know how to do this from wx? > Is it possible to embed a PyQT wi

Re: Trouble displaying image with tkinter

2006-08-06 Thread Rob Williscroft
sj wrote in news:[EMAIL PROTECTED] in comp.lang.python: > I am just learning to use Tkinter and am having problems displaying > image files. I am able to display an image using tutorials (such as > http://www.daniweb.com/code/snippet296.html) But when I try my own > code all I get is an empty wid

US: Python/Webware, Linux, SQL, PostgreSQL, HTML, XHTML, CSS, Javascript contract

2006-08-06 Thread finsignia
A small consulting business in Champaign-Urbana (Illinois - we aren't all Illini fans) is trying to pull high callibre resources onto a Webware for Python project. We are a firm that delivers Ruby (please don't hate us more) and Python web applications to small-medium enterprises and fast growing

Re: Trouble displaying image with tkinter

2006-08-06 Thread jmdeschamps
sj wrote: > I am just learning to use Tkinter and am having problems displaying image > files. I am able to display an image using tutorials (such as > http://www.daniweb.com/code/snippet296.html) But when I try my own code all > I get is an empty widget. What is wrong with the following program?

Re: Why do I require an "elif" statement here?

2006-08-06 Thread John Machin
danielx wrote: > No offense. I didn't mean there was anything wrong with your way, just > that it wasn't "neat". By that, I meant, you were still using lots of > for loops and if blocks. > > Justin Azoff wrote: > > danielx wrote: > > > I'm surprised no one has mentioned neat-er, more pythonic ways

Re: Initializing the number of slots in a dictionary

2006-08-06 Thread John Machin
Jon Smirl wrote: > Is there some way to tell a dictionary object that I am going to load 1M > objects into it and have it pre-allocate enought slots to hold all of the > entries? Not according to the manual. Not according to the source [as at 2.4.3]. In any case, if there were a back-door undocum

Re: Windows vs. Linux

2006-08-06 Thread baalbek
Andy Dingley wrote: >> Python and Ubuntu rock...go fot it. > > That's nice. I've just burned myself a new Ubuntu f*ck-a-duck release CD Now, just out of curiosity, what's f*ck-a-duck? Baalbek -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Projects Continuous Integration

2006-08-06 Thread baalbek
Dave Potts wrote: > Hi, > > I'm just starting a development project in Python having spent time in > the Java world. I was wondering what tool advice you could give me > about setting up a continuous integration environment for the python > code: get the latest source, run all the tests, package

Re: Why do I require an "elif" statement here?

2006-08-06 Thread danielx
No offense. I didn't mean there was anything wrong with your way, just that it wasn't "neat". By that, I meant, you were still using lots of for loops and if blocks. Justin Azoff wrote: > danielx wrote: > > I'm surprised no one has mentioned neat-er, more pythonic ways of doing > > this. I'm also

Re: Nested function scope problem

2006-08-06 Thread danielx
Gerhard Fiedler wrote: > On 2006-08-05 09:30:59, Antoon Pardon wrote: > > >> But this means that C variables are not analog to Python variables, > >> [...] > > > > Yes they are. > > Nobody so far has been able to create a simple table with analog operations > Python vs C that operates on C /variabl

Open letter to BDFL begging forgiveness.

2006-08-06 Thread The Eternal Squire
Guido, It has been two years since PyCon 2005.I know I was a pest during the conference, and I am very sorry and regret my actions. At the time I had a 104 degree fever and pneumonia but I was determined to make the presentation for Honeywell, even if it killed me. That had greatly affected

Re: access abook addressbook with curses

2006-08-06 Thread Ben C
On 2006-08-06, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > Hi Ben, > > * Ben C <[EMAIL PROTECTED]> wrote: >> On 2006-08-05, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: >>> Hi, >>> >>> I want to get access to my abook address file with python. >>> Does anyone have some python lines to achive

embedding console in wxpython app

2006-08-06 Thread Janto Dreijer
I'm writing a Linux filemanager using wxPython. I'd like to embed a bash console inside it. I have found the Logilab pyqonsole (http://www.logilab.org/projects/pyqonsole), but it uses PyQT. Does anyone know how to do this from wx? Is it possible to embed a PyQT widget inside wxPython? Thanks! Jan

Re: Proposal: [... for ... while cond(x)]

2006-08-06 Thread Hugo Ferreira
I actually like the proposal...If the argument to remove map, lambda and filter can be that list comprehension is more "readable", then why can't this one also use it?Which reminds me this discussion: http://awkly.org/archive/can-python-take-advantage-of-mapreduce/ Cheers!HugoOn 8/6/06, Slawomir N

Initializing the number of slots in a dictionary

2006-08-06 Thread Jon Smirl
Is there some way to tell a dictionary object that I am going to load 1M objects into it and have it pre-allocate enought slots to hold all of the entries? Thus avoiding many thousand memory allocations. Jon Smirl [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

where can I find Python acceptance test suite?

2006-08-06 Thread The Eternal Squire
All, I've been doing some hacking of the Python engine, and I've been looking for where the comprehensive regression tests are kept so that I can determine where I've broken part of the engine. Thanks in advance, The Eternal Squire -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: [... for ... while cond(x)]

2006-08-06 Thread Slawomir Nowaczyk
On Sun, 06 Aug 2006 18:59:39 + (GMT) Duncan Booth <[EMAIL PROTECTED]> wrote: #> >> > I suggest a new extension of the list comprehension syntax: #> >> > #> >> > [x for x in xs while cond(x)] #> >> > #> >> > which would be equivalent to #> >> > #> >> > list(itertools.takewhile(cond, xs)) #> >>

Re: Nested function scope problem

2006-08-06 Thread Antoon Pardon
On 2006-08-05, Gerhard Fiedler <[EMAIL PROTECTED]> wrote: > On 2006-08-05 09:30:59, Antoon Pardon wrote: > >>> But this means that C variables are not analog to Python variables, >>> [...] >> >> Yes they are. > > Nobody so far has been able to create a simple table with analog operations > Python

[ANN] rest2web 0.5.0 Beta 1 Released

2006-08-06 Thread Fuzzyman
After five months there is finally a new release of `rest2web `_. This is **0.5.0 Beta 1**. There are an awful lot of changes and improvements, but there shouldn't be any backward compatability issues with previous versions. * `rest2web 0.5.0Beta1 zip

Re: email client like mutt

2006-08-06 Thread Aahz
In article <[EMAIL PROTECTED]>, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > >I am looking for a python email client for the terminal... something like >mutt; maybe, so powerfull ;-) What's wrong with mutt? -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "Debug

Re: current recursion level

2006-08-06 Thread Simon Forman
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Simon Forman <[EMAIL PROTECTED]> wrote: > >David Bear wrote: > >> Is there an easy way to get the current level of recursion? I don't mean > . > . > . > >import sys > > > >def

Re: Ann: SE 2.2b

2006-08-06 Thread Georg Brandl
[EMAIL PROTECTED] wrote: > Frederic> In the short period of time since I introduced SE. the > Frederic> feedback has been overwhelmingly postive. > > Ummm... what is it? The last SE I had was a Mac. It is supposed to be a Stream Editor (in the spirit of sed, I think). However, the PyPI

Re: Ann: SE 2.2b

2006-08-06 Thread skip
Frederic> In the short period of time since I introduced SE. the Frederic> feedback has been overwhelmingly postive. Ummm... what is it? The last SE I had was a Mac. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: [... for ... while cond(x)]

2006-08-06 Thread Duncan Booth
Eighty wrote: > > Duncan Booth wrote: >> Eighty wrote: >> >> > I suggest a new extension of the list comprehension syntax: >> > >> > [x for x in xs while cond(x)] >> > >> > which would be equivalent to >> > >> > list(itertools.takewhile(cond, xs)) >> > >> >> What would this syntax offer that: >>

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread jojoba
Hi Phillipe! Thanks for the response! Unfortunately, i have also reinstalled pywin32, and i still get the same error. Isn't this weird? You know what else. I have a py2exe version of this code, that actually runs fine, using the embedded windows media player. But Im guessing i made that py2exe d

How to suppress UnicodeError exception when enabling httplib debug?

2006-08-06 Thread Baptiste Lepilleur
I activated httplib debug, and when trace are printed, a UnicodeError exception is thrown. I have already set sys.stdout to use utf-8 encoding (this removed the exception when *I* was printing unicode), but from the stacktrace below, the encoding seems to magically have switched to 'ascii' when

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread Philippe Martin
Philippe Martin wrote: > jojoba wrote: > >> HI >> I wrote a little wxpython program with an embedded windows media >> player. >> It worked great. Recently, I reinstalled windows and then wxpython >> (most likely a newer version than i had before). Now when i run the >> exact same code, i get this

Re: why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread Philippe Martin
jojoba wrote: > HI > I wrote a little wxpython program with an embedded windows media > player. > It worked great. Recently, I reinstalled windows and then wxpython > (most likely a newer version than i had before). Now when i run the > exact same code, i get this error: > > File "C:\Documents

Re: Proposal: [... for ... while cond(x)]

2006-08-06 Thread Eighty
Duncan Booth wrote: > Eighty wrote: > > > I suggest a new extension of the list comprehension syntax: > > > > [x for x in xs while cond(x)] > > > > which would be equivalent to > > > > list(itertools.takewhile(cond, xs)) > > > > What would this syntax offer that: > >[x for x in takewhile(cond,

Re: Why do I require an "elif" statement here?

2006-08-06 Thread Justin Azoff
danielx wrote: > I'm surprised no one has mentioned neat-er, more pythonic ways of doing > this. I'm also surprised no one mentioned regular expressions. Regular > expressions are really powerful for searching and manipulating text. [snip] I'm surprised you don't count my post as a neat and python

why did wxpython MakeActiveXclass stopped working?!?!!?!?

2006-08-06 Thread jojoba
HI I wrote a little wxpython program with an embedded windows media player. It worked great. Recently, I reinstalled windows and then wxpython (most likely a newer version than i had before). Now when i run the exact same code, i get this error: File "C:\Documents and Settings\jojoba.DEMO-019591

Re: Why do I require an "elif" statement here?

2006-08-06 Thread danielx
I'm surprised no one has mentioned neat-er, more pythonic ways of doing this. I'm also surprised no one mentioned regular expressions. Regular expressions are really powerful for searching and manipulating text. Here is where I learned most of the stuff I know about regular expressions: http://www

Re: Proposal: [... for ... while cond(x)]

2006-08-06 Thread Duncan Booth
Eighty wrote: > I suggest a new extension of the list comprehension syntax: > > [x for x in xs while cond(x)] > > which would be equivalent to > > list(itertools.takewhile(cond, xs)) > What would this syntax offer that: [x for x in takewhile(cond, xs)] doesn't currently offer? (Apart, th

Re: subprocesses and deadlocks

2006-08-06 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Hi, > > there are many ways of solving the problem of finite buffer sizes when > talking to a subprocess. I'd usually suggest using select() but today I > was looking for a more readable/understandable way of doing this. Back > in 1997 Guido himself posted a very nice sol

Proposal: [... for ... while cond(x)]

2006-08-06 Thread Eighty
I suggest a new extension of the list comprehension syntax: [x for x in xs while cond(x)] which would be equivalent to list(itertools.takewhile(cond, xs)) + Since Python favors list comprehensions over map, filter, and reduce, this would be the preferred way to do this + "Takewhile operations"

Re: access abook addressbook with curses

2006-08-06 Thread Fabian Braennstroem
Hi Ben, * Ben C <[EMAIL PROTECTED]> wrote: > On 2006-08-05, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I want to get access to my abook address file with python. >> Does anyone have some python lines to achive this using >> curses? If not, maybe anybody has small python program do

subprocesses and deadlocks

2006-08-06 Thread [EMAIL PROTECTED]
Hi, there are many ways of solving the problem of finite buffer sizes when talking to a subprocess. I'd usually suggest using select() but today I was looking for a more readable/understandable way of doing this. Back in 1997 Guido himself posted a very nice solution, write your input to a tempora

Re: Nested function scope problem

2006-08-06 Thread Gerhard Fiedler
On 2006-08-06 06:41:27, Slawomir Nowaczyk wrote: > Since Python doesn't (supposedly) have variables, it couldn't have come > from Python. The idea (of this part of the thread) was to find the analogy between C variables and Python variables, at least that's what you said a few messages ago. >

Re: Thread Question

2006-08-06 Thread Gerhard Fiedler
On 2006-08-04 04:22:59, Ritesh Raj Sarraf wrote: > Gerhard Fiedler wrote: >> Rather than downloading and zipping in the same thread, you could run >> multiple threads like you're doing that only download files, and one >> zip-it-all-up thread. After downloading a file, the download threads >> plac

Re: string.translate with unicode

2006-08-06 Thread bearophileHUGS
[EMAIL PROTECTED]: It's not a bug, but such incompatibility problem will probably be solved with Python 3.0, when most strings will managed as unicode. The documentation says: >it returns a copy of the s where all characters have been mapped through the >given translation table which must be a

Re: Suppressing banner on interactive startup? [SOLVED]

2006-08-06 Thread Tim Chase
>> 1) is there a way to suppress the banner when starting Python >> interactively? [...] >> >> 2) is there a way to change the two prompts from ">>>" and "..." >> to other options? [...] > > I noticed that the first part of your query was never answered. > To combine both of these, try the fol

Trouble displaying image with tkinter

2006-08-06 Thread sj
I am just learning to use Tkinter and am having problems displaying image files. I am able to display an image using tutorials (such as http://www.daniweb.com/code/snippet296.html) But when I try my own code all I get is an empty widget. What is wrong with the following program? from Tkinter im

strftime replacement which supports Unicode format strings?

2006-08-06 Thread Dennis Benzinger
Is there a library with a strftime replacement which supports Unicode format strings? Bye, Dennis -- http://mail.python.org/mailman/listinfo/python-list

Re: Nested function scope problem

2006-08-06 Thread Edmond Dantes
Dennis Lee Bieber wrote: > On Sat, 5 Aug 2006 07:24:51 -0300, Gerhard Fiedler <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> I know. It's just that your explicit analogy made this better visible, so >> I wanted to add that to it. But I guess this thing is getting into the

string.translate with unicode

2006-08-06 Thread [EMAIL PROTECTED]
This has always worked fine for me. >>> import string >>> id = "Peter! *fine*" >>> transtab = string.maketrans('/ ','_ ') >>> print string.translate(id, transtab, '?&!;<=>*#[]{}') Peter fine Now if I do it with a unicode string: >>> id = u"Peter! *fine*" >>> transtab = string.maketrans('/ ','_ ')

Re: Are there any AOP project in python community?

2006-08-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, hiaips <[EMAIL PROTECTED]> wrote: >steve wrote: >> I mean Aspect-Oriented Programming. >> If any please give me some of links. >> Thanks a lot. > >See http://en.wikipedia.org/wiki/Aspect-oriented_programming. >There is a list of AOP implementations for a number of la

Re: current recursion level

2006-08-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Simon Forman <[EMAIL PROTECTED]> wrote: >David Bear wrote: >> Is there an easy way to get the current level of recursion? I don't mean . . . >import sys > >def getStackDepth(): >'''Return the

Re: Something for PyPy developers?

2006-08-06 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paddy <[EMAIL PROTECTED]> wrote: >I just found this: > http://www.cs.princeton.edu/~dpw/popl/06/Tim-POPL.ppt >And thought of you... :-) > >called "The Next Mainstream Programming Languages", Tim Sweeney of Epic >Games presents on problems that game writers see and m

Re: Is there an obvious way to do this in python?

2006-08-06 Thread Bruno Desthuilliers
H J van Rooyen a écrit : > "Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > (snip) > | If you go the web application route, each "login" would use a cookie > | to control session, so the application server can determine what > | functions to present to the user. You might even be able to use > |

Re: Using Python for my web site

2006-08-06 Thread Bruno Desthuilliers
Paul Boddie a écrit : > Bruno Desthuilliers wrote: > >>To make a long story short, my opinion is that the only sensible thing >>to do with Windows is to wipe it out and install an OS instead. > > > If you're convinced you won't be running Windows, why deal with the > problem so late in the game?

Re: Nested function scope problem

2006-08-06 Thread Slawomir Nowaczyk
On Fri, 04 Aug 2006 13:42:59 -0300 Gerhard Fiedler <[EMAIL PROTECTED]> wrote: #> On 2006-08-04 12:12:44, Antoon Pardon wrote: #> #> >>> You can hardly claim that what gets printed is the "id" of the variable c. #> >>> (Well, you can claim, but few C programmers would follow you.) #> >> #> >> Tha

Re: regex question

2006-08-06 Thread Slawomir Nowaczyk
On Fri, 04 Aug 2006 14:55:34 -0700 John Machin <[EMAIL PROTECTED]> wrote: #> > def test(data): #> > format, index = 'abcd', 0 #> > for c in data: #> > i = format.index(c) #> > if i > index+1: #> > return False #> > index = i #> > return index==format

Re: Nested function scope problem

2006-08-06 Thread Slawomir Nowaczyk
On Sat, 05 Aug 2006 02:55:03 -0700 Bill Pursell <[EMAIL PROTECTED]> wrote: #> Gerhard Fiedler wrote: #> > There's no Python equivalent to "int*p=345; *p++;". #> #> Sure there is: #> #> os.kill(os.getpid(), signal.SIGSEGV) LOL... that's a good one :) -- Best wishes, Slawomir Nowaczyk

Re: More int and float attributes

2006-08-06 Thread bearophileHUGS
Self: >>D is a very nice language, that I hope to see more used. It is copying >>lot of things from Python. Tim Roberts: >I don't see that. It looks rather like an incremental improvement to C and >C++ rather than a language influenced by Python. Thank you for your comments. Mine was probably j

Re: using an already running COM object with Dispatch

2006-08-06 Thread Roger Upole
"jiccab" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Greetings. > > with the following code, > > olApp = Dispatch("Outlook.Application") > > I am capable of getting a new instance of Outlook running. I would > like to be able to use the instance that is already running, if exists

Re: More int and float attributes

2006-08-06 Thread Robert Kern
Paddy wrote: > Question: do the scientific packages supported by Python supply this > data in a regular manner? For floating point types, at least. In [11]: from numpy import * In [12]: print finfo(float32) Machine parameters for -

Re: Which KDE IDE for Python?

2006-08-06 Thread crystalattice
Bart Ogryczak wrote: > Hi, > Rigth now I'm using two IDEs for Python, KDevelop and Eric. Both have > drawbacks. KDevelop is a multilanguage IDE, and doesn't really have > anything special for Python. There's no Python debugger, no PyDOC > integration, it's class browser doesn't display attributes.