Re: Conversion of perl based regex to python method

2006-05-24 Thread Peter Otten
Andrew Robert wrote: Wanted: > perl -ple 's/([^\w\s])/sprintf("%%%2X", ord $1)/ge'  somefile.txt Got: > # Evaluate captured character as hex > def ret_hex(ch): > return chr((ord(ch) + 1) % ) Make it compile at least before posting :-) > # Evaluate the value of whatever was matched > def

Re: John Bokma harassment

2006-05-24 Thread James
> We seem to have strayed a long way from Voltaire's > "I do not agree with what you say, but I will defend to the death your > right to say it." Not at all. My problem with Xah Lee is that he is abusing the Usenet as a personal BLOG. He has a web site to post these articles and he can certainly p

Re: deploying big python applications

2006-05-24 Thread Serge Orlov
AndyL wrote: > Hi, > > let me describe how I do that today. There is standard python taken from > python.org installed in a c:\python23 with at least dozen different > additional python packages (e.g. SOAPpy, Twisted, wx, many smaller ones > etc) included. Also python23.dll moved from c:\windows

Re: IronPython 1.0 Beta 7 Released

2006-05-24 Thread Ravi Teja
Also, IronPython cannot access CPython libraries. So it cannot be used as a drop-in replacement for CPython in most non-trivial apps. Python for .NET however allows you to both use both CPython and .NET libraries. > Ironpython is not a first class .NET language. > That means that although you can

Re: Modify one character in a string

2006-05-24 Thread Paul Rubin
"mp" <[EMAIL PROTECTED]> writes: > How do I go about modifying one character in a string elegantly? > In other words, I want a function that will change '' to 'aaza', > given the index 2 of the character in the string. Ehh, there are various ways, all ugly. x = '' y = x[:2] + 'z' + x

Re: how to change sys.path?

2006-05-24 Thread [EMAIL PROTECTED]
sys.path.append("") eg. sys.path.append("/home/webdoc") -- http://mail.python.org/mailman/listinfo/python-list

Re: how to change sys.path?

2006-05-24 Thread [EMAIL PROTECTED]
sys.append() Bye. -- http://mail.python.org/mailman/listinfo/python-list

Modify one character in a string

2006-05-24 Thread mp
X-No-Archive How do I go about modifying one character in a string elegantly? In other words, I want a function that will change '' to 'aaza', given the index 2 of the character in the string. Also, how do I do this when dealing with a file ; which file mode should I use and what function shou

Re: python __import__ question

2006-05-24 Thread Ben Finney
Evgeniy Zamriy <[EMAIL PROTECTED]> writes: > I have this code: > try: > empty_mod = __import__(some_empty_module) > except ImportError: > print "test" > raise > > But python doesn't work with this except: > ImportError: No module named Your example is incomplete.

Re: IronPython 1.0 Beta 7 Released

2006-05-24 Thread Luis M. González
Well, basically, ironpython is to .NET what jython is to JAVA. It is a faithful implementation of the python language, written in c#, created to run on and take full advantage of the .NET framework. That means that you have access to all the available libraries of the .NET framework and you can us

RE: determining available space for Float32, for instance

2006-05-24 Thread David Socha
Robert Kern wrote: > David Socha wrote: > > I am looking for a way to determine the maxium array size I can > > allocate for arrays of Float32 values (or Int32, or Int8, > ...) at an > > arbitrary point in the program's execution. This is needed because > > Python cannot allocate enough memor

Re: John Bokma harassment

2006-05-24 Thread David Steuber
I'm loath to crosspost this but I don't know which (if any) news group Xah actually reads. I also don't want to make just a private response to Xah's email to a public post. Anyway, the TOS of dreamhost.com is here: http://www.dreamhost.com/tos.html Two important sections I'll quote: INTER

Re: John Bokma harassment

2006-05-24 Thread marc spitzer
On 2006-05-25, John Bokma <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] (Bob Felts) wrote: > >> Count me among the clueless, then. I just wrote to DreamHost and asked >> that they reverse their decision to terminate his account. > > I am sure that DreamHost has quite a nice /dev/null for clueless

os listdir access denied when run as a service

2006-05-24 Thread Thomas Thomas
Hi All, I am trying to access a mapped network drive folder. everything works fine normally. But when i run the application as service I am getting the error Traceback (most recent call last): File "docBoxApp.py", line 129, in ? File "core\PollFiles.pyc", line 332, in doPoll File "core\Poll

Re: Unexpected extension module behaviour

2006-05-24 Thread rimmer
Thanks for the help John. Indeed, changing <= to < has it licked. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to "normalize" indentation sources

2006-05-24 Thread AndyL
John Machin wrote: > On 25/05/2006 12:00 PM, AndyL wrote: > >> Hi, >> >> I have a lot of sources with mixed indentation typically 2 or 4 or 8 >> spaces. Is there any way to automatically convert them in let's say 4 >> spaces? >> > > Yup. Right under your nose: > > C:\junk>\python24\tools\scrip

python __import__ question

2006-05-24 Thread Evgeniy Zamriy
Hello, All: I have this code: try: empty_mod = __import__(some_empty_module) except ImportError: print "test" raise But python doesn't work with this except: ImportError: No module named My python version is 2.4.2 (Linux) Thanks for your replies -- http://ma

Re: John Bokma harassment

2006-05-24 Thread Ben Bullock
"Ken Tilton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > Ben Bullock wrote: >> "Xah Lee" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> >>> If you believe this lobbying to my webhosting provider is unjust, >>> please write to my web hosting provider [EMAIL

Re: how to "normalize" indentation sources

2006-05-24 Thread John Machin
On 25/05/2006 12:00 PM, AndyL wrote: > Hi, > > I have a lot of sources with mixed indentation typically 2 or 4 or 8 > spaces. Is there any way to automatically convert them in let's say 4 > spaces? > Yup. Right under your nose: C:\junk>\python24\tools\scripts\reindent.py --help reindent [-d][

Re: Unexpected extension module behaviour

2006-05-24 Thread John Machin
On 25/05/2006 12:09 PM, rimmer wrote: > I'm writing an extension module in C in which I'm passing an array of > floats from C to python. The code below illustrates a simple C > function designed to output an array of floats. > [snip] Couldn't restrain myself from reading further :-) > > Then I

deploying big python applications

2006-05-24 Thread AndyL
Hi, let me describe how I do that today. There is standard python taken from python.org installed in a c:\python23 with at least dozen different additional python packages (e.g. SOAPpy, Twisted, wx, many smaller ones etc) included. Also python23.dll moved from c:\windows to c:\python23. This

Re: John Bokma harassment

2006-05-24 Thread John Bokma
[EMAIL PROTECTED] (Bob Felts) wrote: > Count me among the clueless, then. I just wrote to DreamHost and asked > that they reverse their decision to terminate his account. I am sure that DreamHost has quite a nice /dev/null for clueless idiots like you and your sock puppets :-D. -- John

how to "normalize" indentation sources

2006-05-24 Thread AndyL
Hi, I have a lot of sources with mixed indentation typically 2 or 4 or 8 spaces. Is there any way to automatically convert them in let's say 4 spaces? Thx, A. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unexpected extension module behaviour

2006-05-24 Thread John Machin
On 25/05/2006 12:09 PM, rimmer wrote: > I'm writing an extension module in C in which I'm passing an array of > floats from C to python. The code below illustrates a simple C > function designed to output an array of floats. > > - > extTest.c > - > #include > > double *testArray

wxPython: changing entries of a HtmlListBox

2006-05-24 Thread KvS
Hi all, a question wrt renewing the entries in a wx.HtmlListBox, I don't understand how to do it. I have some global variable containing a list: gl_NAWList=["Bet","Dik"] then I create a subclass of wx.HtmlListBox as described in the wxPython demo: class MyHtmlListBox(wx.HtmlListBox): d

Re: How does a generator object refer to itself?

2006-05-24 Thread Michael
Russell wrote: > The issue is how to write a generator that refers to its own generator > object. > > def me(): > .. > nextVal = yield you(me.send)# This is wrong! >>> def self_decorate(func): ...class context: ...def __init__(self): ...self.me = None ...

Unexpected extension module behaviour

2006-05-24 Thread rimmer
I'm writing an extension module in C in which I'm passing an array of floats from C to python. The code below illustrates a simple C function designed to output an array of floats. - extTest.c - #include double *testArray(int nsamp) { double nums[1]; int i; double cum

Re: Compiling Python from Sources

2006-05-24 Thread rwr
Thank YOU ever s much as it worked my friend!!! Thank you. Sincerely, rwr -- http://mail.python.org/mailman/listinfo/python-list

Re: IronPython 1.0 Beta 7 Released

2006-05-24 Thread sam
vbgunz: When you download IronPython,the tutorial directory has some examples of interfacing With the .NET environment i.e.: 1: IronPython -> C# 2: C# -> IronPython 3: IronPython -> VB 4: VB -> IronPython Sam Schulenburg -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling Python from Sources

2006-05-24 Thread [EMAIL PROTECTED]
rwr wrote: > Due to my ignorance exactly what do you mean by "In my case, I had to > run configure over and over againeach time going through the log > finding a new missing file, re-install, > and repeat until the errors stopped." My In my case, my error log said it couldn't find the file "make"

Re: Bind an instance of a base to a subclass - can this be done?

2006-05-24 Thread Diez B. Roggisch
Maric Michaud schrieb: > Le Mercredi 24 Mai 2006 22:04, Diez B. Roggisch a écrit : >> Nope, not in that way. But you might consider writing a proxy/wrapper >> for an object. That looks like this (rouch sketch from head): >> >> class FileWrapper(object): >> def __init__(self, f): >>self.

GMPY: divm() still broken (was: module conflict? gmpy and operator)

2006-05-24 Thread [EMAIL PROTECTED]
Drat, gmpy is still broken. Prior to ver 1.01, divm(4,8,20) would produce a 'not invertible' error even though this is a valid linear congruence (because gcd(8,20)=4 divides 4). The issue was that the modular inverse function invert() requires that 8 & 20 be co-prime (have gcd=1). Linear congruenc

Re: John Bokma harassment

2006-05-24 Thread Bob Felts
John Bokma <[EMAIL PROTECTED]> wrote: > "Ant" <[EMAIL PROTECTED]> wrote: > > > I have no particular affinity for Xah's views, but what does get up my > > nose is usenet Nazism. > > That's because you're clueless. Count me among the clueless, then. I just wrote to DreamHost and asked that they

Python mentioned in context of $100 laptop...

2006-05-24 Thread skip
om/news.ars/post/20060524-6903.html> Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Web frameworks and credit cards

2006-05-24 Thread Victor Ng
Ed, Its very simple to add credit card processing to your app. I have personally used moneris , worldpay and debitech with no issues. Sometimes you need to do a little ctypes or pyrex but overall - its easy. On 5/24/06, Ed Leafe <[EMAIL PROTECTED]> wrote: > I may have an opportunity to devel

Re: Web frameworks and credit cards

2006-05-24 Thread Victor Ng
Ed, On 5/24/06, Ed Leafe <[EMAIL PROTECTED]> wrote: > I may have an opportunity to develop an online ordering system for a > client, and will have the ability to develop using any tool I choose. > Given the fact that there are more web frameworks in Python than > keywords ;-) , what I need

Re: how to change sys.path?

2006-05-24 Thread Ju Hui
yes, we can add path to PYTHONPATH,but how to remove some items? my sys.path: >>> import sys >>> for x in sys.path: ... print x ... D:\usr\local\lib\site-packages\setuptools-0.6a11-py2.4.egg D:\usr\local\lib\site-packages\clientcookie-1.3.0-py2.4.egg c:\temp C:\WINDOWS\system32\python24.zip C:

Re: IronPython 1.0 Beta 7 Released

2006-05-24 Thread vbgunz
maybe I am a bit ignorant and love living in the bliss of it and maybe I am a bit tired on the subject but may I ask you a question? if i decided to use IronPython for strict cPython work, is this possible? probably dumb when I can use cPython but is it still possible in case maybe sometime down th

Re: Compiling Python from Sources

2006-05-24 Thread rwr
Due to my ignorance exactly what do you mean by "In my case, I had to run configure over and over againeach time going through the log finding a new missing file, re-install, and repeat until the errors stopped." My Why I ask is that I utilized "apt-get install gcc" to install gcc. Are there addi

Re: John Bokma harassment

2006-05-24 Thread Peter Decker
On 24 May 2006 15:54:56 GMT, John Bokma <[EMAIL PROTECTED]> wrote: > And ain't it cool that reporting Xah's abuse might stop both? C'mon - admit it! you hafta be a Republican with a hardon for Bush! -- # p.d. -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-24 Thread usenet
Xah Lee wrote: > I do not like to post off-topic messages Oh REALLY? That's strange, because I don't recall ever seeing an on-topic message (a Perl message in a Perl newsgroup) from Xah. Every one of the many Xah post I've ever seen (including the "Philosopher" message that this thread morphed i

Re: John Bokma harassment

2006-05-24 Thread Peter Decker
On 24 May 2006 15:26:12 GMT, John Bokma <[EMAIL PROTECTED]> wrote: > "Ant" <[EMAIL PROTECTED]> wrote: > > > I have no particular affinity for Xah's views, but what does get up my > > nose is usenet Nazism. > > That's because you're clueless. Sounds like your one of those Bush ass-lickers who think

Re: Why can't timedeltas be divided?

2006-05-24 Thread Robert Kern
Maric Michaud wrote: > Le Jeudi 25 Mai 2006 00:07, Dan Bishop a écrit : > >>If I try to write something like: >> >>num_weeks = time_diff / datetime.timedelta(days=7) > > because it has no meaning, Yes, it does. > what you want is : > > num_weeks = time_diff.days / 7 > or > num_weeks = (tim

Re: Compiling Python from Sources

2006-05-24 Thread rwr
Thank you ever so much mensanator!!! Very much appreciated! rwr -- http://mail.python.org/mailman/listinfo/python-list

Re: Python keywords vs. English grammar

2006-05-24 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Boris Borcic <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > and all three keywords are verbs, so when you describe the code, you can > > use the same English words as in the program source, "You try to execute > > some code, but it throws a foo, which is caug

Web frameworks and credit cards

2006-05-24 Thread Ed Leafe
I may have an opportunity to develop an online ordering system for a client, and will have the ability to develop using any tool I choose. Given the fact that there are more web frameworks in Python than keywords ;-) , what I need to know is any experience anyone out there has had i

Re: NEWB: how to convert a string to dict (dictionary)

2006-05-24 Thread manstey
Thanks. I didn't know eval could do that. But why do many posts say they want a solution that doesn't use eval? -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-05-24 Thread Klaas
Chris: > class StorageBerkeleyDB(StorageTest): >def runtest(self, number_hash): >db = bsddb.hashopen(None, flag='c', cachesize=8192) >for (num, wildcard_digits) in number_hash.keys(): >key = '%d:%d' % (num, wildcard_digits) >db[key] = None >db.clo

Re: pickling multiple dictionaries

2006-05-24 Thread manstey
Thanks very much. How large is *really* large for making pytables worthwhile. Our python script generates an xml file of about 450Mb. Is pytables worth using then? -- http://mail.python.org/mailman/listinfo/python-list

Re: Large Dictionaries

2006-05-24 Thread Klaas
Chris: > Berkeley DB is great for accessing data by key for things already > stored on disk (i.e. read access), but write performance for each > key-value pair is slow due to it being careful about flushing > writes to disk by default. This is absolutely false. -Mike -- http://mail.python.org/

Re: John Bokma harassment

2006-05-24 Thread Larry Elmore
Bill Atkins wrote: > John Bokma <[EMAIL PROTECTED]> writes: > > >>Ken Tilton <[EMAIL PROTECTED]> wrote: >> >> >>>Ben Bullock wrote: >>> "Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >If you believe this lobbying to my webhosting provider is unjust, >

Re: Best way to handle exceptions with try/finally

2006-05-24 Thread Enigma Curry
We used to have a try..except..finally syntax in Python. It was taken out a while ago for reasons unknown to me. The good news is that it is back in Python 2.5. I haven't tested it, but Guido said so himself: http://video.google.com/videoplay?docid=60331183357868340 -- http://mail.python.org/mai

Re: Compiling Python from Sources

2006-05-24 Thread [EMAIL PROTECTED]
rwr wrote: > configure:1687: checking for gcc > configure:1703: found /usr/bin/gcc > configure:1713: result: gcc At this point, configure thinks you have the gcc compiler installed. > configure:1753: checking for C++ compiler default output file name > configure:1756: gccconftest.cc >&5

RE: PEP-xxx: Unification of for statement and list-comp syntax

2006-05-24 Thread Delaney, Timothy (Tim)
Heiko Wundram wrote: > Am Mittwoch 24 Mai 2006 06:12 schrieb Tim Roberts: >> At one time, it was said that the "%" operator was the fastest way to >> concatenate strings, because it was implemented in C, whereas the + >> operator was interpreted. However, as I recall, the difference was >> hardly

Re: Why can't timedeltas be divided?

2006-05-24 Thread John Machin
On 25/05/2006 8:25 AM, Maric Michaud wrote: > Le Jeudi 25 Mai 2006 00:07, Dan Bishop a écrit : >> If I try to write something like: >> >> num_weeks = time_diff / datetime.timedelta(days=7) > > because it has no meaning, what you want is : > > num_weeks = time_diff.days / 7 > or > num_weeks =

Re: Bind an instance of a base to a subclass - can this be done?

2006-05-24 Thread Ben Cartwright
Lou Pecora wrote: > I want to subclass a base class that is returned from a Standard Library > function (particularly, subclass file which is returned from open). I > would add some extra functionality and keep the base functions, too. > But I am stuck. > > E.g. > > class myfile(file): >def my

Re: Best way to handle exceptions with try/finally

2006-05-24 Thread Zameer
> I tend to put "return" > statements at the end of functions to make an attempt at being clean. I > realize that a lot of the time functions will just return but I was > hoping by explicitly stating my function returns that another person > reading my code would more easily see any exit points in

Re: Finding Upper-case characters in regexps, unicode friendly.

2006-05-24 Thread John Machin
On 25/05/2006 5:43 AM, [EMAIL PROTECTED] wrote: > I'm trying to make a unicode friendly regexp to grab sentences > reasonably reliably for as many unicode languages as possible, focusing > on european languages first, hence it'd be useful to be able to refer > to any uppercase unicode character ins

Re: COM Server crashing when returning large arrays

2006-05-24 Thread Alastair Alexander
Bingo! Downloaded release 208 and the problem is solved! "Stefan Schukat" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello Alistair, which version of pythoncom you are using? In the newer versions there is an support for a "native" safearray (the data type Excel is providing).

Re: Why can't timedeltas be divided?

2006-05-24 Thread Maric Michaud
Le Jeudi 25 Mai 2006 00:07, Dan Bishop a écrit : > If I try to write something like: > >     num_weeks = time_diff / datetime.timedelta(days=7) because it has no meaning, what you want is : num_weeks = time_diff.days / 7 or num_weeks = (time_diff / 7).days -- _ Maric Michaud _

Re: Compiling Python from Sources

2006-05-24 Thread rwr
This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by python configure 2.3, which was generated by GNU Autoconf 2.59. Invocation command line was $ ./configure ## - ## ## Platform. ## ##

Re: Compiling Python from Sources

2006-05-24 Thread [EMAIL PROTECTED]
rwr wrote: > As a newbie I am having problems/errors configuring Python after > unpacking the Python archive: > > # ./configure > checking MACHDEP... linux2 > checking EXTRAPLATDIR... > checking for --without-gcc... no > checking for --with-cxx=... no > checking for c++... no > checking for g++...

Why can't timedeltas be divided?

2006-05-24 Thread Dan Bishop
If I try to write something like: num_weeks = time_diff / datetime.timedelta(days=7) I get: TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'datetime.timedelta' Of course, one could extend the timedelta class to implement division, def _microseconds(self):

Re: Bind an instance of a base to a subclass - can this be done?

2006-05-24 Thread Maric Michaud
Le Mercredi 24 Mai 2006 22:04, Diez B. Roggisch a écrit : > Nope, not in that way. But you might consider writing a proxy/wrapper > for an object. That looks like this (rouch sketch from head): > > class FileWrapper(object): >     def __init__(self, f): >        self._f = f > >     def __getattr__(

Compiling Python from Sources

2006-05-24 Thread rwr
As a newbie I am having problems/errors configuring Python after unpacking the Python archive: # ./configure checking MACHDEP... linux2 checking EXTRAPLATDIR... checking for --without-gcc... no checking for --with-cxx=... no checking for c++... no checking for g++... no checking for gcc... gcc che

Request for comment: programmer starting page (micro knowledge base)

2006-05-24 Thread Paolo Pantaleo
I am writting down a pege with useful links for a Python programmer. That is reference, tutorials and anything that can be useful. I use it regulary when programming in Python and I can't do without it. I would be happy if you go and see that page, and tell me what you think about and suggest link

Re: Python keywords vs. English grammar

2006-05-24 Thread Boris Borcic
Roy Smith wrote: > I noticed something interesting today. In C++, you write: > > try { >throw foo; > } catch { > } > > and all three keywords are verbs, so when you describe the code, you can > use the same English words as in the program source, "You try to execute > some code, but it thr

Re: how to use matplotlib contour()?

2006-05-24 Thread Robert Kern
Grant Edwards wrote: > I downloaded examples/contour_demo.py, and it doesn't run. > > I've searched both the user guide and the Wiki for "contour" > and got zero hits. > > http://matplotlib.sourceforge.net/matplotlib.pylab.html#-contour > appears to be a good reference if you already know how to

how to use matplotlib contour()?

2006-05-24 Thread Grant Edwards
I downloaded examples/contour_demo.py, and it doesn't run. I've searched both the user guide and the Wiki for "contour" and got zero hits. http://matplotlib.sourceforge.net/matplotlib.pylab.html#-contour appears to be a good reference if you already know how to use contour(), but I could glean ze

Re: Using python for a CAD program

2006-05-24 Thread Paddy
I guess the 'advanced O/R mapping tools' make it easier to map the data to an RDBMS, but their is still the performance issue. Since this has degenerated into a an issue of performance then I suggest the original poster create a clear interface between his data and its persistance method. This shou

Re: Python Version Testing Tool?

2006-05-24 Thread Serge Orlov
Michael Yanowitz wrote: > Hello: > >Is there a version testing tool available for Python > such that I can check to see if my code will still run in > versions 2.2, 2.3, 2.4.3, and 1.1 (for example) (or whatever) > without having to install all these different versions on my > computer? Such t

Re: Finding Upper-case characters in regexps, unicode friendly. (oh, bugger)

2006-05-24 Thread Tim Chase
Sorry...I somehow missed the key *uppercase* bit of that, and somehow got it in my head that you just wanted unicode letters, not numbers. Please pardon the brain-blink. I can't find anything in Python's regexp docs that do what you want. Vim's regexp engine has a "uppercase characters" and

Re: Use of lambda functions in OOP, any alternative?

2006-05-24 Thread Scott David Daniels
Pablo wrote: > Second solution: This is what i want, but... > > class Base(object): > def __init__(self, attr): > self._attr = attr > def getattr(self): > return self._attr > attr = property(fget=lambda self: self.getattr()) > > class Derived(Base): > def getattr(

Re: Finding Upper-case characters in regexps, unicode friendly.

2006-05-24 Thread Tim Chase
> I'm trying to make a unicode friendly regexp to grab sentences > reasonably reliably for as many unicode languages as > possible, focusing on european languages first, hence it'd be > useful to be able to refer to any uppercase unicode character > instead of just the typical [A-Z], which doesn't

Python Version Testing Tool?

2006-05-24 Thread Michael Yanowitz
Hello: Is there a version testing tool available for Python such that I can check to see if my code will still run in versions 2.2, 2.3, 2.4.3, and 1.1 (for example) (or whatever) without having to install all these different versions on my computer? Thanks in advance: Michael Yanowitz -- ht

Re: PEP 3102 for review and comment

2006-05-24 Thread Kay Schluehr
molasses wrote: > I don't mind the naked star and will be happy if thats what we end up with. > > Though how about using *None? > I think that makes the intention of the function clearer. > > eg. > def compare(a, b, *None, key=None): > > Which to me reads as "no further positional arguments". > >

Re: Looking for help with Regular Expression

2006-05-24 Thread Roger Miller
Seem to be a lot of regular expression questions lately. There is a neat little RE demonstrator buried down in Python24/Tools/Scripts/redemo.py, which makes it easy to experiment with regular expressions and immediately see the effect of changes. It would be helpful if it were mentioned in the RE d

Re: Bind an instance of a base to a subclass - can this be done?

2006-05-24 Thread Diez B. Roggisch
Lou Pecora schrieb: > I've been scanning Python in a Nutshell, but this seems to be either > undoable or so subtle that I don't know how to do it. > > I want to subclass a base class that is returned from a Standard Library > function (particularly, subclass file which is returned from open). I

Pydev 1.0.8 released

2006-05-24 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.0.8 have been released Check http://www.fabioz.com/pydev for details on Pydev Extensions and http://pydev.sf.net for details on Pydev This is a 'single-bugfix' release because of a major bug that could cause Pydev to hang when making a new line under

Finding Upper-case characters in regexps, unicode friendly.

2006-05-24 Thread possibilitybox
I'm trying to make a unicode friendly regexp to grab sentences reasonably reliably for as many unicode languages as possible, focusing on european languages first, hence it'd be useful to be able to refer to any uppercase unicode character instead of just the typical [A-Z], which doesn't include, f

Re: simple print is not working..

2006-05-24 Thread Paul Osman
On 24-May-06, at 3:41 PM, [EMAIL PROTECTED] wrote: > What is wrong with this script? > > #!/usr/bin/python > fsfile = open('/tmp/fs_info.al', 'r') > for line in fsfiles.readlines(): > print line > fsfile.close() > > > #./get_fs_info.py > File "./get_fs_info.py", line 4 > print line >

Re: Python Programming Books?

2006-05-24 Thread vbgunz
> Thanks vbgunz that was the reply I was looking for! > Do you think it is wise to hold back for a 3rd edition? No, 2nd edition is literally perfect. The reason why is because almost nothing significant enough has changed since it's publication. In other words, you will not learn any outdated mate

Re: simple print is not working..

2006-05-24 Thread Carl J. Van Arsdall
[EMAIL PROTECTED] wrote: > What is wrong with this script? > > #!/usr/bin/python > fsfile = open('/tmp/fs_info.al', 'r') > for line in fsfiles.readlines(): > print line > fsfile.close() > > > Did you cut and paste that code? I see a couple typos First, on the line for line in fsfiles.readline

Re: simple print is not working..

2006-05-24 Thread lahirister
[EMAIL PROTECTED] wrote: Sorry typo: Script is like this: #!/usr/bin/python fsfile = open('/tmp/fs_info.al', 'r') for line in fsfile.readlines(): print line fsfile.close() *not* fsfiles as I typed in original post. > What is wrong with this script? > > #!/usr/bin/python > fsfile = open('/tmp/f

Finding Upper-case characters in regexps, unicode friendly.

2006-05-24 Thread possibilitybox
I'm trying to make a unicode friendly regexp to grab sentences reasonably reliably for as many unicode languages as possible, focusing on european languages first, hence it'd be useful to be able to refer to any uppercase unicode character instead of just the typical [A-Z], which doesn't include, f

simple print is not working..

2006-05-24 Thread lahirister
What is wrong with this script? #!/usr/bin/python fsfile = open('/tmp/fs_info.al', 'r') for line in fsfiles.readlines(): print line fsfile.close() #./get_fs_info.py File "./get_fs_info.py", line 4 print line ^ SyntaxError: invalid syntax Any ideas? Thanks AL -- http://mail.pyt

Bind an instance of a base to a subclass - can this be done?

2006-05-24 Thread Lou Pecora
I've been scanning Python in a Nutshell, but this seems to be either undoable or so subtle that I don't know how to do it. I want to subclass a base class that is returned from a Standard Library function (particularly, subclass file which is returned from open). I would add some extra functio

Re: PEP 3102 for review and comment

2006-05-24 Thread gangesmaster
None is not currently a keyword -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-24 Thread George Sakkis
Geoffrey Summerhayes wrote: > "Bill Atkins" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > John Bokma <[EMAIL PROTECTED]> writes: > > > > [snip] > > > >> -- > >> John MexIT: http://johnbokma.com/mexit/ > >>personal page:

Xah Lee network abuse

2006-05-24 Thread PofN
Xah Lee wrote: > I'm sorry to trouble everyone. Liar. You were never sorry when you troubled us with your posting excrements in the past, you are not sorry now. > But as you might know, due to my > controversial writings and style, Liar. You are a net abuser, a kook and a troll. It has nothing

Re: A critic of Guido's blog on Python's lambda

2006-05-24 Thread Kay Schluehr
Michele Simionato wrote: > Kay Schluehr wrote: > > http://www.fiber-space.de/EasyExtend/doc/EE.html > > Well, I have not read that page yet, but the name "fiber space" reminds > me of old > memories, when I was doing less prosaic things than now. Old times .. > ;) > > Michele Simionato

Re: Web framework comparison video

2006-05-24 Thread Adam Jones
Just as a note, TurboGears has added a lot that would change the scoring on this. The project has been moving pretty quickly towards 1.0 lately, and I would advise anyone interested in a comparison to check out the recent changes before making a final decision. The same will probably hold true for

Re: John Bokma harassment

2006-05-24 Thread Geoffrey Summerhayes
"Bill Atkins" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Bokma <[EMAIL PROTECTED]> writes: > > [snip] > >> -- >> John MexIT: http://johnbokma.com/mexit/ >>personal page: http://johnbokma.com/ >> Exper

Re: Conversion of perl based regex to python method

2006-05-24 Thread Andrew Robert
Andrew Robert wrote: > I have two Perl expressions > > > If windows: > > perl -ple "s/([^\w\s])/sprintf(q#%%%2X#, ord $1)/ge" somefile.txt > > If posix > > perl -ple 's/([^\w\s])/sprintf("%%%2X", ord $1)/ge' somefile.txt > > > > The [^\w\s] is a negated expression stating that any charac

Re: Scipy: vectorized function does not take scalars as arguments

2006-05-24 Thread Travis E. Oliphant
ago wrote: > Once I vectorize a function it does not acccept scalars anymore. Es > > def f(x): return x*2 > vf = vectorize(f) > print vf(2) > > AttributeError: 'int' object has no attribute 'astype' > > Is this the intended behaviour? > Vectorize handles scalars in recent versions of NumPy. W

Re: Python Programming Books?

2006-05-24 Thread gregarican
I third this opinion. This book gave me a lot of insight and helped me get comfortable using Python. I also recall looking at a document Guido published on how to get started with Python as well as reading the reference docs that come bundled with the language install. Of course I came from a backg

perl to python

2006-05-24 Thread Depcnb1
This is Jeff Hutchinson -- http://mail.python.org/mailman/listinfo/python-list

perl to python

2006-05-24 Thread Depcnb1
I'm looking for Steve Rumbalski    -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Books?

2006-05-24 Thread Jerry
I think that Beginning Python: From Novice to Professional is a great book for beginners. It's probably a bit too simplistic for someone who already understands the language or who has a decent background in development. I just borrowed it from my brother and while I consider myself a pretty good

Re: Python keywords vs. English grammar

2006-05-24 Thread bruno at modulix
defcon8 wrote: > 1. Does it matter? > 2. Is it affecting your productivity. > 3. Are you not trying to programme? > 4. It is open source, change it and stop whining. > What about trying emacs +x doctor ? -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]

  1   2   3   >