Re: list.clear() missing?!?

2006-04-11 Thread Serge Orlov
Martin v. Löwis wrote: > Felipe Almeida Lessa wrote: > > I love benchmarks, so as I was testing the options, I saw something very > > strange: > > > > $ python2.4 -mtimeit 'x = range(10); ' > > 100 loops, best of 3: 6.7 msec per loop > > $ python2.4 -mtimeit 'x = range(10); del x[:]' > > 10

IMPORTANT 2.5 API changes for C Extension Modules and Embedders

2006-04-11 Thread Neal Norwitz
If you don't write or otherwise maintain Python Extension Modules written in C (or C++) or embed Python in your application, you can stop reading. Python 2.5 alpha 1 was released April 5, 2006. The second alpha should be released in a few weeks. There are several changes which can cause C extens

Best way to emulate ordered dictionary (like in PHP)?

2006-04-11 Thread pyGuy
I am dealing with user profiles, which are simply a set of field-value pairs. I've tried to many things to list, but for one, I tried creating a wrapper class which inherits the dictionary and overrides the iterator. Unfortunately I don't understand iterators enough to get this working and before I

Best way to emulate ordered dictionary (like in PHP)?

2006-04-11 Thread pyGuy
I am dealing with user profiles, which are simply a set of field-value pairs. I've tried to many things to list, but for one, I tried creating a wrapper class which inherits the dictionary and overrides the iterator. Unfortunately I don't understand iterators enough to get this working and before I

Re: Looking for a language/framework

2006-04-11 Thread Gregor Horvath
Magnus Lycka schrieb: > As I said, ORMs have their uses, but it seems to me that a reason for > many people to use ORMs is to avoid having to properly understand the > way relational databases work, and that means they will never use the So is the reason for using Python for many people to avoid

Re: About classes and OOP in Python

2006-04-11 Thread Gregor Horvath
Steven D'Aprano schrieb: > I don't know of many other OO languages that didn't/don't have > inheritance, VB4 - VB6 -- Mit freundlichen Grüßen, Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung http://www.gregor-horvath.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in > > I don't care about how people see my tabs. I use one tab for every >> indent level, so no matter how you set your tab width, my code will >> look consistent. > >Unless they v

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Ben Sizer" <[EMAIL PROTECTED]> wrote: >Lawrence D'Oliveiro wrote: >> In article <[EMAIL PROTECTED]>, >> "Carl Banks" <[EMAIL PROTECTED]> wrote: >> >> >Always use spaces when posting, and use them in your code as well. >> >Spaces are the current recommended practi

Re: How can I determine the property attributes on a class or instance?

2006-04-11 Thread Steven D'Aprano
Replying to myself now... how sad. On Wed, 12 Apr 2006 15:19:17 +1000, Steven D'Aprano wrote: > If you want a general purpose solution for an object introspection tool, > I must admit I'm as lost as you are. The only thing I have come up with is > this nasty hack: > t.p is None > True

Re: How can I determine the property attributes on a class or instance?

2006-04-11 Thread Steven D'Aprano
On Tue, 11 Apr 2006 19:11:46 -0700, mrdylan wrote: > Given a class like so: > > --- > class TestMe(object): > def get(self): > pass > def set(self, v): > pass > > p = property( get, set ) > > t = TestMe() > type(t.p) #returns NoneType, what???

executing perl script within python

2006-04-11 Thread amaltasb
I have few modules which are in perl, and all other scripts are in python. Is it possible to execute the perl scripts within python or import them like: Thanks -- http://mail.python.org/mailman/listinfo/python-list

turning python-cgi into an html output

2006-04-11 Thread Kun
i have a python cgi script that displays tables from a mysql database in html. the problem is, i want to use excel's web query to pull this data and the web query doesn't read .py files. thus i am wondering what is the easiest way to just turn my .py html output into a .html output. you can c

Re: Sorting a list of objects by multiple attributes

2006-04-11 Thread nghoffma
I'm sure my avoidance of lambdas as due as much to laziness as adherence to principle. This is a good opportunity to learn about them. I suggested the above because it wasn't obvious to me how one would pass the arbitrary set of attributes to the lambda expression (and I envisioned them being spe

Re: Newbie wxPython questions.

2006-04-11 Thread Butternut squash
John Ladasky wrote: > > [EMAIL PROTECTED] wrote: >> I am also a newbie and learning like you are. I was wondering if do you >> know any wxPython forum just for GUIs ? >> Good luck with your project and hope that some guru helps us out. > > If you are reading this via Usenet, you can subscribe to

Re: How can I determine the property attributes on a class or instance?

2006-04-11 Thread Ben Cartwright
mrdylan wrote: > class TestMe(object): > def get(self): > pass > def set(self, v): > pass > > p = property( get, set ) > > t = TestMe() > type(t.p) #returns NoneType, what??? > t.p.__str__ #returns > --- > > What is the best way to determi

I meet problems while using the py2exe,Please help me!

2006-04-11 Thread boyeestudio
I want build a python source to .exe file. I use the py2exe and the script file I wrote as below: from distutils.core import setupimport py2exe setup(windows=["main.py"], name='palaver', description="palaver is a p2p software", version='0.05', ) it build rightly,But when I run the executable file,

Re: Application Generators

2006-04-11 Thread walterbyrd
Thanks. It does look good. The personal editon costs less than phprunner. And it seems much more powerful than PHPRunner. -- http://mail.python.org/mailman/listinfo/python-list

How can I determine the property attributes on a class or instance?

2006-04-11 Thread mrdylan
Given a class like so: --- class TestMe(object): def get(self): pass def set(self, v): pass p = property( get, set ) t = TestMe() type(t.p) #returns NoneType, what??? t.p.__str__ #returns --- What is the bes

Re: About classes and OOP in Python

2006-04-11 Thread Ben Cartwright
Michele Simionato wrote: > Roy Smith wrote: > > > That being said, you can indeed have private data in Python. Just prefix > > your variable names with two underscores (i.e. __foo), and they effectively > > become private. Yes, you can bypass this if you really want to, but then > > again, you c

Re: list.clear() missing?!?

2006-04-11 Thread Dan Christensen
Felipe Almeida Lessa <[EMAIL PROTECTED]> writes: > I love benchmarks, so as I was testing the options, I saw something very > strange: > > $ python2.4 -mtimeit 'x = range(10); ' > 100 loops, best of 3: 6.7 msec per loop > $ python2.4 -mtimeit 'x = range(10); del x[:]' > 100 loops, best of

Re: list.clear() missing?!?

2006-04-11 Thread Felipe Almeida Lessa
Em Qua, 2006-04-12 às 11:36 +1000, Steven D'Aprano escreveu: > On Tue, 11 Apr 2006 19:15:18 +0200, Martin v. Löwis wrote: > > > Felipe Almeida Lessa wrote: > >> I love benchmarks, so as I was testing the options, I saw something very > >> strange: > >> > >> $ python2.4 -mtimeit 'x = range(10)

Re: RIIA in Python 2.5 alpha: "with... as"

2006-04-11 Thread Ben Cartwright
Terry Reedy wrote: > "Alexander Myodov" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > and even list comprehensions: > > b1 = [l for l in a1] > > print "l: %s" % l > > This will go away in 3.0. For now, del l if you wish. Or use a generator expression: >>> b1 = list(l for l

Re: About classes and OOP in Python

2006-04-11 Thread Steven D'Aprano
On Tue, 11 Apr 2006 18:20:13 +, Casey Hawthorne wrote: >>I think it's important not to wrongly confuse 'OOP' with ''data hiding' >>or any other aspect you may be familiar with from Java or C++. The >>primary concept behind OOP is not buzzwords such as abstraction, >>encapsulation, polymorphism

Re: finish_endtag in sgmllib.py [Python 2.4]

2006-04-11 Thread Richard Hsu
thank you Ben. not only did i learn something about my question, i learnt the 'truth' :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-11 Thread Steven D'Aprano
On Tue, 11 Apr 2006 19:15:18 +0200, Martin v. Löwis wrote: > Felipe Almeida Lessa wrote: >> I love benchmarks, so as I was testing the options, I saw something very >> strange: >> >> $ python2.4 -mtimeit 'x = range(10); ' >> 100 loops, best of 3: 6.7 msec per loop >> $ python2.4 -mtimeit 'x =

Re: Python string.title Function

2006-04-11 Thread BartlebyScrivener
Whoah, that's a nifty trick. Thanks. rick -- http://mail.python.org/mailman/listinfo/python-list

Re: list.clear() missing?!?

2006-04-11 Thread Steven D'Aprano
On Tue, 11 Apr 2006 14:49:04 -0700, Ville Vainio wrote: > John Salerno wrote: > >> Thanks guys, your explanations are really helpful. I think what had me >> confused at first was my understanding of what L[:] does on either side >> of the assignment operator. On the left, it just chooses those el

Re: RIIA in Python 2.5 alpha: "with... as"

2006-04-11 Thread Terry Reedy
"Alexander Myodov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > for k in a1: >pass > print "k: %s" % k > where "k" lives long after the actual need in it was lost, There are occasions, especially when one breaks out of the loop, when keeping k bound *is* useful.

Re: finish_endtag in sgmllib.py [Python 2.4]

2006-04-11 Thread Ben Cartwright
Richard Hsu wrote: > code:- > ># Internal -- finish processing of end tag > def finish_endtag(self, tag): > if not tag: # < i am confused about this > found = len(self.stack) - 1 > if found < 0: > self.unknown_endtag(tag) # < and thi

Re: How to initiate HotSync of Palm device?

2006-04-11 Thread Peter Hansen
dylpkls91 wrote: > I posted a similar question on comp.sys.palmtops.pilot and am waiting > for a response. Thank you for your reply; the acknowledgement is > appreciated. I believe that a possible solution would be to use a > command line option of HotSync Manager, but I am not sure what the > corr

Re: Help...TT Python 2.4 decompiler

2006-04-11 Thread Peter Hansen
Robert Boyd wrote: > Can anyone on the list shed light on this? I'm accustomed to having > readable .py files with my .pyc files and I am unfamiliar with any > scenario where one would need to turn the byte-compiled version back > to the text version. One scenario is that you've lost your source c

Re: Decorators, Identity functions and execution...

2006-04-11 Thread Terry Reedy
"Sybren Stuvel" <[EMAIL PROTECTED]> wrote in > I don't care about how people see my tabs. I use one tab for every > indent level, so no matter how you set your tab width, my code will > look consistent. Unless they view with tab_width = 0, as with some news readers. tjr -- http://mail.pyth

finish_endtag in sgmllib.py [Python 2.4]

2006-04-11 Thread Richard Hsu
code:- # Internal -- finish processing of end tag def finish_endtag(self, tag): if not tag: # < i am confused about this found = len(self.stack) - 1 if found < 0: self.unknown_endtag(tag) # < and this return I am a l

Re: Help...TT Python 2.4 decompiler

2006-04-11 Thread Robert Boyd
On 4/9/06, 이광진 <[EMAIL PROTECTED]> wrote: > > Hello, > > I am a sofware engineer in Korea. > > Would you kindly give me the way to receive(take) python deccomplier as an > urgent business? > > Thanks for help..^^ > My wife translated your Korean explanation for me - now I have a question for the l

Re: Help needed on COM issue

2006-04-11 Thread Philippe Martin
Hi, First I'd check if the type is indeed tuple. How about converting the tuple to a list, modifying the list, then making it a tuple again ? Philippe Mike Howard wrote: > Should read ... > I'm doing some conversion of vb code to python code and I have a > problem with a COM object > > Spec

Re: Help needed on COM issue

2006-04-11 Thread Mike Howard
Should read ... I'm doing some conversion of vb code to python code and I have a problem with a COM object Specifically in VB I can do Set oR = oA.Action debug.print oR.Item(1,2) [returns say "1"] oR.Item(1,2)="4" debug.print oR [returns "4"] oR.Update [saves the record with the new item] In P

Re: I wanna use urllib2 to get a page with a socks 5 proxy, who can give me a sample code ?

2006-04-11 Thread John J. Lee
"Ju Hui" <[EMAIL PROTECTED]> writes: > I wanna use urllib2 to get a page with a socks 5 proxy,who can give me > a sample code ? [...] I haven't used it myself (though curiously, ftplib knows about this module and will use it if present -- and urllib2 uses ftplib to fetch ftp: URLs), but you could

Help needed on COM issue

2006-04-11 Thread Mike Howard
I'm doing some conversion of vb code to python code and I have a problem with a COM object Specifically in VB I can do Set oR = oA.Action debug.print oR.Item(1,2) [returns say "1"] oR.Item(1,2)="4" debug.print oR [returns "4"] In Python I need to do .. oR=oA.Action() print oR.Item(1,2)[0] [re

Re: Using pyinstaller to create an .exe, when using win32com

2006-04-11 Thread Giovanni Bajo
kbperry wrote: > Hi all, > I am pretty confused on this? > > While pyinstaller has a "MakeCOMServer.py" thing, it seems to blow up > every time I run it. It keeps complaining that a dictionary that I > have has "TypeError: unscriptable object.", but when I run my code > normally (outside of tryin

Re: modifying html input date for mysql, reg ex or string interpolation?

2006-04-11 Thread John J. Lee
Kun <[EMAIL PROTECTED]> writes: [...] > for x in form.keys(): > print "%s=%s" % (x, form[x].value) + "" [...] ...and the second thing that jumps out at me is that you're neglecting to HTML-quote the data you're inserting into your web page here (for example, using xml.sax.saxutils.escape()), w

'unknown' command processing in python ?

2006-04-11 Thread rjain7
Hello, I am a newbie; looking for an easy equivalent of TCL 'unknown' command in python. My basic aim is to be able to pass any command which python interpreter does not understand to my own C++ extension. The two ways that I understand: a) Extend cmd.Cmd() class: Will require me to write my ow

Re: modifying html input date for mysql, reg ex or string interpolation?

2006-04-11 Thread John J. Lee
Kun <[EMAIL PROTECTED]> writes: [...] > mysqlstatement = "INSERT INTO dir (date, purchasetype, price, comment) > VALUES ('"+ date +"','"+ purchasetype +"','"+ price +"','"+ comment +"' )" [...] Haven't read your post carefully, but the first thing that jumps out at me is that you should be using

Re: Regular expression intricacies: why do REs skip some matches?

2006-04-11 Thread Ben Cartwright
Tim Chase wrote: > > In [1]: import re > > > > In [2]: aba_re = re.compile('aba') > > > > In [3]: aba_re.findall('abababa') > > Out[3]: ['aba', 'aba'] > > > > The return is two matches, whereas, I expected three. Why does this > > regular expression work this way? It's just the way regexes work.

Re: Regular expression intricacies: why do REs skip some matches?

2006-04-11 Thread Tim Chase
> In [1]: import re > > In [2]: aba_re = re.compile('aba') > > In [3]: aba_re.findall('abababa') > Out[3]: ['aba', 'aba'] > > The return is two matches, whereas, I expected three. Why does this > regular expression work this way? Well, if you don't need the actual results, just their count, yo

Re: How to initiate HotSync of Palm device?

2006-04-11 Thread dylpkls91
I posted a similar question on comp.sys.palmtops.pilot and am waiting for a response. Thank you for your reply; the acknowledgement is appreciated. I believe that a possible solution would be to use a command line option of HotSync Manager, but I am not sure what the correct option would be. Thanks

Re: Regular expression intricacies: why do REs skip some matches?

2006-04-11 Thread John Machin
It's nothing to do with how/what a regular expression matches. It's all to do with the definition of whatever convenience methods like findall() that have been built on top of the basic match() method -- having found a match, where do they start looking for the next match? Typically, one does not w

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-11 Thread SR
>> Say I have three tables. > > Only three? Well, yeah, OK, it's more than that, but after years of being worn away by "Post a minimal example" requests on comp.text.tex, a minimal example is what you got... > Something like {untested... Might need to do a subselect for the > sec

Re: Regular expression intricacies: why do REs skip some matches?

2006-04-11 Thread Diez B. Roggisch
> Is this simply not the way REs work? Does this sort of matching really > have to be home-coded? Yes. The reason is basically that consumed characters can't be "unconsumed". However, if you use the search-variant with a start-argument you can search from the last occurence start+1 to achieve w

Regular expression intricacies: why do REs skip some matches?

2006-04-11 Thread Chris Lasher
Hey guys and gals, This is a followup of my "Counting all permutations of a substring" thread (see http://groups.google.com/group/comp.lang.python/browse_thread/thread/60ebeb7ae381b0a9/7657235b3fd3966f#7657235b3fd3966f in Google Groups) I'm still having a difficult time figuring out the intricacies

Re: Removing an item from a QListView in PyQt

2006-04-11 Thread David Boddie
To summarize my previous misformatted post: removeChild() is a QScrollView method. You can call it because QListView inherits it from QScrollView, but you need to call your QListView instance's takeItem() method with the item you want to remove as the argument. Hope this helps, David -- http:/

Re: How can I reduce the number of queries to my PostgreSQL database?

2006-04-11 Thread SR
Martin Christensen said: >SR> Scenario: I have a python script which creates web page listing >SR> all books in the database, and all authors for each book. My >SR> python script does essentially three things: > >SR> 1. retrieve a list of all book_ids and book_titles. > >SR> 2. for each book_id, q

Re: list.clear() missing?!?

2006-04-11 Thread Ville Vainio
John Salerno wrote: > Thanks guys, your explanations are really helpful. I think what had me > confused at first was my understanding of what L[:] does on either side > of the assignment operator. On the left, it just chooses those elements > and edits them in place; on the right, it makes a copy

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >Aahz a écrit : >> In article <[EMAIL PROTECTED]>, >> bruno at modulix <[EMAIL PROTECTED]> wrote: >>> >>>Please repeat this 101 times each morning: >>>"thou shall not use old-style classes for they are deprecated". >>

Re: using vim as a python class/module/function etc.. browser

2006-04-11 Thread Chris Jones
Daniel Nogradi wrote: Of course, modern versions of Exuberant Ctags also support Python, too. >>> >>>I apt-installed this package but the man page is rather intimidating so >>>I thought I might as well make sure I was going in the right direction. >> >>You will probably want to read the vim doc

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Bruno Desthuilliers
Aahz a écrit : > In article <[EMAIL PROTECTED]>, > bruno at modulix <[EMAIL PROTECTED]> wrote: > >>Please repeat this 101 times each morning: >>"thou shall not use old-style classes for they are deprecated". > > > Classic classes are *NOT* deprecated. Perhaps not *officially* yet... -- http

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Bruno Desthuilliers
Wildemar Wildenburger a écrit : > Aahz wrote: > >> Classic classes are *NOT* deprecated. > > I'm surprised ... > So there will be two (in most cases subtly) different classes of classes > (so to speak) for all eternity? > > Why is that? Do classic classes have some advantage over new style ones

trouble with Tkinter and Tix

2006-04-11 Thread CT
Hi, I installed python 2.4.3, Tcl 8.4 Tk8.4 and also with Tix 8.4 I got some error like _tkinter.TclError:ambigous option "-col": must be column, etc with my LabelFrame from Tix. It seems that the python interpreter is mixing my Tix with Tkinter? If I put Tix.LabelFrame and use import Tix instead

Re: Sorting a list of objects by multiple attributes

2006-04-11 Thread Scott David Daniels
Kent Johnson wrote: > Scott David Daniels wrote: >> Kent Johnson wrote: >>> In Python 2.5 you can do this with operator.attrgetter(): >>> L.sort(key=operator.attrgetter('whatever', 'someother', 'anotherkey')) >> >> Note: this is also available in Python 2.4 > > No, the ability to specify more th

Re: list.clear() missing?!?

2006-04-11 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >> Steven Bethard wrote: >> >> >>> lst[:] = [] >>> lst = [] >> What's the difference here? > > L[:]= modifies the object in place, L=[] binds the variable to a > new object. compare and contrast: Thanks guys, your explanations are really help

Re: list.clear() missing?!?

2006-04-11 Thread John Salerno
Felipe Almeida Lessa wrote: > You see? lst[:] removes all elements from the list that lst refers to, > while lst = [] just creates a new list and discard the only one. The > difference is, for example: Thanks, your explanation was great! -- http://mail.python.org/mailman/listinfo/python-list

Re: RegExp question

2006-04-11 Thread John Machin
Precise? The OP asked for "tokens". #>>> re.search(r"(and|or|xor)\s*#", "a = the_operand # gotcha!") #<_sre.SRE_Match object at 0x00AE6620> Try this: #>>> re.search(r"\b(and|or|xor)\s*#", "a = the_operand # should fail") #>>> re.search(r"\b(and|or|xor)\s*#", "and # OK") #<_sre.SRE_Match object a

Python editing with emacs/wordstar key bindings.

2006-04-11 Thread Thomas Bartkus
Does anyone use emacs together with both WordStar key bindings and python mode? I'm afraid that Wordstar editing key commands are burned R/O into my knuckles! I would like to play with emacs for Python editing but I'm having (2) problems. 1) When I load a .py file, emacs automatically overrid

Re: RegExp question

2006-04-11 Thread Ben C
On 2006-04-11, Michael McGarry <[EMAIL PROTECTED]> wrote: > Tim, > > for some reason that does not seem to do the trick. > > I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile) Try with grep -P, which means use perl-compatible regexes as opposed to POSIX ones. I only know for sure

Re: pre-PEP: The create statement

2006-04-11 Thread Steven Bethard
John J. Lee wrote: > "Michele Simionato" <[EMAIL PROTECTED]> writes: > [...] >> This agrees with my scan (except I also found an occurrence of 'create' >> in Tkinter). >> BTW, I would be curious to see the script you are using for the >> scanning. Are you >> using tokenize too? In am quite fond of

Re: RegExp question

2006-04-11 Thread John Machin
(-: Sorry about Tim. He's not very imaginative. He presumed that because you asked on comp.lang.python that you would be testing it with Python. You should have either (a) asked your question on comp.toolswithfunnynames.grep or (b) not presumed that grep's re syntax is the same as Python's. :-) My

Re: XPath/Screen Scraping Gurus..

2006-04-11 Thread John J. Lee
Peter Hansen <[EMAIL PROTECTED]> writes: [...] > Screen-scraping refers, I believe, to the process of identifying what is > onscreen in GUI programs, possibly even at the pixel level, and trying > to translate that back into a higher level model (e.g. text in fields) > of what is going on. > >

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Felipe Almeida Lessa <[EMAIL PROTECTED]> wrote: >Em Ter, 2006-04-11 às 07:17 -0700, Aahz escreveu: >> >> Can, yes. But should it? The whole point of adding the () option to >> classes was to ease the learning process for newbies who don't >> understand why classe

Re: RegExp question

2006-04-11 Thread Tim Chase
> I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile) Well, you asked for the python regexp...different environments use different regexp parsing engines. Your response is akin to saying "the example snippet of python code you gave me doesn't work in my Pascal program". For g

Re: XPath/Screen Scraping Gurus..

2006-04-11 Thread John J. Lee
"bruce" <[EMAIL PROTECTED]> writes: > I'm not that familiar with Pythin, but I wasn wondering if there are any > XPath/Python Gurus that I might be able to talk to regarding screen scraping > applications... Can you be more specific? John -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: The create statement

2006-04-11 Thread John J. Lee
"Michele Simionato" <[EMAIL PROTECTED]> writes: [...] > This agrees with my scan (except I also found an occurrence of 'create' > in Tkinter). > BTW, I would be curious to see the script you are using for the > scanning. Are you > using tokenize too? In am quite fond of the tokenize module ;) Havi

Re: RegExp question

2006-04-11 Thread Ben C
On 2006-04-11, Michael McGarry <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to form a regular expression to find a few different > tokens (and, or, xor) followed by some variable number of whitespace > (i.e., tabs and spaces) followed by a hash mark (i.e., #). What would > be the regular expre

Re: RegExp question

2006-04-11 Thread RunLevelZero
In my opinion you would be best to use a tool like Kiki. http://project5.freezope.org/kiki/index.html/# This will allow you to paste in the actual text you want to search and then play with different RE's and set flags with a simple mouse click so you can find just what you want. Rember what re.D

Re: Saving files from post data via sys.stdin

2006-04-11 Thread ACB
> Any further help is appreciated. : ) > > I figured it out. I just used sys.stdin = file("path/to/file", "r") and I was again able to read the data from stdin. -- http://mail.python.org/mailman/listinfo/python-list

Chicago Python Users Group Thurs April 13 at 7pm

2006-04-11 Thread bray
Learn, share, and have fun at ChiPy's Monthly meeting this Thurs, April 13 at 7pm. This is sure to be our best meeting yet. Confirm your attendance: mtobis aat gmail doot com with "ChiPy April" in your subject line. Headliners -- * httpy -- (Chad Whitacre) a sane and robust HTTP libra

Re: RegExp question

2006-04-11 Thread Heiko Wundram
Am Dienstag 11 April 2006 21:16 schrieb Michael McGarry: > I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile) Test it with Python's re-module, then. \s for matching Whitespace is specific to Python (AFAIK). And as you've asked in a Python Newsgroup, you'll get Python-answers he

Using pyinstaller to create an .exe, when using win32com

2006-04-11 Thread kbperry
Hi all, I am pretty confused on this? While pyinstaller has a "MakeCOMServer.py" thing, it seems to blow up every time I run it. It keeps complaining that a dictionary that I have has "TypeError: unscriptable object.", but when I run my code normally (outside of trying to make an .exe), it runs p

Re: python on Mac

2006-04-11 Thread Alex Martelli
Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Alex Martelli) wrote: > > >Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > > > >> In article <[EMAIL PROTECTED]>, > >> "pierreth" <[EMAIL PROTECTED]> wrote: > >> > >> >You removed /usr/bin/py

Re: list.clear() missing?!?

2006-04-11 Thread Duncan Smith
John Salerno wrote: > Steven Bethard wrote: > > >> lst[:] = [] >> lst = [] > > > What's the difference here? >>> lst = [1,2,3] >>> lst2 = lst >>> lst[:] = [] >>> lst2 [] >>> lst = [1,2,3] >>> lst2 = lst >>> lst = [] >>> lst2 [1, 2, 3] >>> Duncan -- http://mail.python.org/mailman/list

Re: Python string.title Function

2006-04-11 Thread Jesse Hager
Try something like: def capwords(words): return ' '.join([x.capitalize() for x in words.split()]) capwords("here's my title!") "Here's My Title!" -- Jesse Hager email = "[EMAIL PROTECTED]".decode("rot13") -- http://mail.python.org/mailman/listinfo/python-list

Re: RegExp question

2006-04-11 Thread Paul McGuire
"Michael McGarry" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I would like to form a regular expression to find a few different > tokens (and, or, xor) followed by some variable number of whitespace > (i.e., tabs and spaces) followed by a hash mark (i.e., #). What would >

Re: RegExp question

2006-04-11 Thread Michael McGarry
Tim, for some reason that does not seem to do the trick. I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile) Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: About classes and OOP in Python

2006-04-11 Thread Ben C
On 2006-04-11, Michele Simionato <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > >> That being said, you can indeed have private data in Python. Just prefix >> your variable names with two underscores (i.e. __foo), and they effectively >> become private. Yes, you can bypass this if you really wan

Re: Py+SQLite or other (big output) ?

2006-04-11 Thread Magnus Lycka
DurumDara wrote: > I want to process many data with python, and want to store in database. ... > So I want to use one database file - but I want to protect it. > How to do it with SQLite ? > I see that solutions: > - 1. I use transactions. > - 2. I create full copy of database after every bigger tr

Re: Memory limit to dict?

2006-04-11 Thread Tim Peters
[Olivier Langlois] > ... > I have kept thinking about the original problem and I now believe that > the only solution if he wants to store 3.6GB of data in a Python script > is to recompile Python in 64 bits. I do not know if this is something > that someone has already done successfully... I did

Re: Memory limit to dict?

2006-04-11 Thread Steve M
An alternative is to use ZODB. For example, you could use the BTree class for the outermost layers of the nested dict, and a regular dict for the innermost layer. If broken up properly, you can store apparently unlimited amount of data with reasonable performance. Just remember not to iterate ove

Re: XPath/Screen Scraping Gurus..

2006-04-11 Thread Peter Hansen
bruce wrote: > I'm not that familiar with Pythin, but I wasn wondering if there are any > XPath/Python Gurus that I might be able to talk to regarding screen scraping > applications... Since you mention XPath, it seems likely you are really interested in *web-scraping*. Screen-scraping refers, I

Re: RegExp question

2006-04-11 Thread Tim Chase
> I would like to form a regular expression to find a few > different tokens (and, or, xor) followed by some variable > number of whitespace (i.e., tabs and spaces) followed by > a hash mark (i.e., #). What would be the regular > expression for this? (and|or|xor)\s*# Unless "varible numb

Re: Manipulating sets from the 2.4 C API?

2006-04-11 Thread Raymond Hettinger
Dave Opstad wrote: > I just looked through the Python/C API reference for 2.4.3 and didn't > see anything about using sets. I'd been expecting things like PySet_New, > PySet_Check etc. In Py2.4, there was not a custom set C API because the module was still ungoing significant development. For 2.4

installing pyodbc

2006-04-11 Thread timw.google
I just downloaded the pyodbc source to try and install on my Linux FC3 box. I see that there is a setup.py file, but when I try to do a 'python setup.py build' (or just 'python setup.py') I get Traceback (most recent call last): File "setup.py", line 27, in ? revision = latest_revision('.')

RegExp question

2006-04-11 Thread Michael McGarry
Hi, I would like to form a regular expression to find a few different tokens (and, or, xor) followed by some variable number of whitespace (i.e., tabs and spaces) followed by a hash mark (i.e., #). What would be the regular expression for this? Thanks for any help, Michael -- http://mail.pytho

installing pyodbc

2006-04-11 Thread timw.googlepost
I just downloaded the pyodbc source to try and install on my Linux FC3 box. I see that there is a setup.py file, but when I try to do a 'python setup.py build' (or just 'python setup.py') I get Traceback (most recent call last): File "setup.py", line 27, in ? revision = latest_revision('.')

installing pyodbc

2006-04-11 Thread timw.googlepost
I just downloaded the pyodbc source to try and install on my Linux FC3 box. I see that there is a setup.py file, but when I try to do a 'python setup.py build' (or just 'python setup.py') I get Traceback (most recent call last): File "setup.py", line 27, in ? revision = latest_revision('.')

Re: Python string.title Function

2006-04-11 Thread Georg Brandl
Allan wrote: > Hi All - > > We're developing in Python 2.4.3 and are noticing something strange. I'm noticing strange semicolons in your code... ;) > For example, when testing, here's what we're seeing: > > x = "here's my title!"; > x = x.title(); > print x; > Here'S My Title! > > Notice the c

Re: Searching python-list and MySQL

2006-04-11 Thread BartlebyScrivener
Oh, sorry, Richard, and to answer your question about Python and MySql, try searching on mxODBC, or better, search on "mxODBC Holden" as Steve Holden seems to answer every question on sql and Python. Hope that helps. rick -- http://mail.python.org/mailman/listinfo/python-list

installing pyodbc

2006-04-11 Thread timw.googlepost
I just downloaded the pyodbc source to try and install on my Linux FC3 box. I see that there is a setup.py file, but when I try to do a 'python setup.py build' (or just 'python setup.py') I get Traceback (most recent call last): File "setup.py", line 27, in ? revision = latest_revision('.')

installing pyodbc

2006-04-11 Thread timw.googlepost
I just downloaded the pyodbc source to try and install on my Linux FC3 box. I see that there is a setup.py file, but when I try to do a 'python setup.py build' (or just 'python setup.py') I get Traceback (most recent call last): File "setup.py", line 27, in ? revision = latest_revision('.')

Python string.title Function

2006-04-11 Thread Allan
Hi All - We're developing in Python 2.4.3 and are noticing something strange. For example, when testing, here's what we're seeing: x = "here's my title!"; x = x.title(); print x; Here'S My Title! Notice the capitalization -- "Here'S". Any feedback on this issue is much appreciated. Thanks much,

RE: Memory limit to dict?

2006-04-11 Thread Olivier Langlois
With 32 bits address space, you have exactly 4GB. Of course out of that 4GB, the OS reserves some of that space for itself. So I think that 2GB of available memory for a user process is good approximation. However, on top of that, you need to account for space overhead that Python and the OS heap m

Re: list.clear() missing?!?

2006-04-11 Thread Fredrik Lundh
John Salerno wrote: > Steven Bethard wrote: > > > > lst[:] = [] > > lst = [] > > What's the difference here? L[:]= modifies the object in place, L=[] binds the variable to a new object. compare and contrast: >>> L = ["a", "b", "c"] >>> M = L >>> L ['a', 'b', 'c'] >>> M ['a', 'b', 'c'] >

Re: Searching python-list and MySQL

2006-04-11 Thread BartlebyScrivener
>> Can someone tell me how to search this mailing list, short of >> downloading every month's archive and searching manually? Huh? How are you accessing it now? Just point your browser to: http://groups.google.com/group/comp.lang.python and look in the upper right hand corner where there's a

  1   2   3   >