Re: sys.stdin and two CTRL-Ds

2006-07-01 Thread John Machin
On 2/07/2006 3:48 PM, Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > John Machin <[EMAIL PROTECTED]> wrote: > >> -u unbuffers sys.stdout >> and sys.stderr (and makes them binary, which wouldn't be a good idea on >> a Windows box). > > Why not? If binary, '\n' would appear as L

Error Trapping

2006-07-01 Thread JohnJohnUSA
I ran the following program to retrieve entries from the windows registry on Windows XP: import win32api, win32con aReg = win32api.RegConnectRegistry(None, win32con.HKEY_CURRENT_USER) aKey = win32api.RegOpenKeyEx(aReg, r"Software\Microsoft\Internet Explorer\PageSetup") for i in range(100): Na

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This has been bothering me for a while. Just want to find out if it > just me or perhaps others have thought of this too: Why shouldn't the > keyset of a dictionary be represented as a set instead of a list? I think this is an interesti

Re: python/libxml2dom questions

2006-07-01 Thread Stefan Behnel
bruce wrote: > in playing around with the test python app (see below) i've got a couple of > basic questions. i can't seem to find the answers via google, and when i've > looked in the libxml2dom stuff that i downloaded i didn't see answers > either... > > for the list in the "for label in d.xpath

Re: sys.stdin and two CTRL-Ds

2006-07-01 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, John Machin <[EMAIL PROTECTED]> wrote: >-u unbuffers sys.stdout >and sys.stderr (and makes them binary, which wouldn't be a good idea on >a Windows box). Why not? -- http://mail.python.org/mailman/listinfo/python-list

Re: slow non-blocking reads

2006-07-01 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Mark Dufour" <[EMAIL PROTECTED]> wrote: >any thoughts about why this runs extremely slowly? Because both processes are chewing up most of your CPU each waiting for the other to do something. -- http://mail.python.org/mailman/listinfo/python-list

Re: MySQLdb not updating rows

2006-07-01 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Bowen" <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, Benjamin Niemann <[EMAIL PROTECTED]> >wrote: > >>Another side note: don't build your queries using (dumb) string formatting, >>let the MySQLdb module do it for you. > >Thanks for that tip, it's a

RE: python/libxml2dom questions

2006-07-01 Thread bruce
thanks barry... now if i can figure out what the attributes do, and which ones i need to deal with!! -bruce -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Barry Kelly Sent: Saturday, July 01, 2006 10:24 PM To: python-list@python.org Subject: Re: python/li

Re: python/libxml2dom questions

2006-07-01 Thread Barry Kelly
"bruce" <[EMAIL PROTECTED]> wrote: > also, how can i determine what methods are available for a libxml2dom > object? Have you tried dir(object)? It works great on the command-line reply-eval-print loop. -- Barry -- http://barrkel.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python

Re: size of an array..

2006-07-01 Thread Barry Kelly
"bruce" <[EMAIL PROTECTED]> wrote: > from the "for label in d.xpath", i assume that "d.xpath" is returning > multiple strings/objects/etc... and that label is assigned to the next > "element during the loop. > > is there a way to determine the number of elements in "l", or the number of > iterati

Re: python/libxml2dom questions

2006-07-01 Thread Paul McGuire
"bruce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi paul... > > in playing around with the test python app (see below) i've got a couple of > basic questions. i can't seem to find the answers via google, and when i've > looked in the libxml2dom stuff that i downloaded i didn't

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Nick Vatamaniuc
You are correct I should have thought of that. I still think the keys() method should return a set() though. Robert Kern wrote: > [EMAIL PROTECTED] wrote: > > The same thing goes for the values(). Here most people will argue that > > values are not necessarily unique, so a list is more appropriate

python/libxml2dom questions

2006-07-01 Thread bruce
hi paul... in playing around with the test python app (see below) i've got a couple of basic questions. i can't seem to find the answers via google, and when i've looked in the libxml2dom stuff that i downloaded i didn't see answers either... for the list in the "for label in d.xpath" how can i f

python/libxml2dom questions

2006-07-01 Thread bruce
hi paul... in playing around with the test python app (see below) i've got a couple of basic questions. i can't seem to find the answers via google, and when i've looked in the libxml2dom stuff that i downloaded i didn't see answers either... for the list in the "for label in d.xpath" how can i f

Can I do it using python?? about xterm and telnet

2006-07-01 Thread valpa
I'm a net admin for about 20 unix servers, and I need to frequently telnet on to them and configure them. It is a tiring job to open a xterm and telnet, username, password to each server. Can I do it automatically by python? After that, there have 20 xterm consoles opened and telneted to their co

size of an array..

2006-07-01 Thread bruce
hi.. another basic question... in the following: #test python script import libxml2dom import urllib print "hello" turl = "http://courses.tamu.edu/ViewSections.aspx?campus=CS&x=hvm4MX4PXIY9J8C2Dcxz5 0ncXTJdT7v2&type=M" f = urllib.urlopen(turl) s = f.read() f.close() # s contains HTML not XML t

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Roy Smith
"Nick Vatamaniuc" <[EMAIL PROTECTED]> wrote: > But there is a side note: old code that assumed a particular ordering > of the keys or values is broken anyway. >From a testing point of view, it would be interesting if there was a flag which said, "Deliberately change everything which isn't guara

Re: efficiency question

2006-07-01 Thread diffuser78
Thanks for this thing. http://www.python.org/doc/current/lib/module-dis.html made it more clear. Fredrik Lundh wrote: > David Harvey wrote: > > > Suppose I write > > > > if x in ("abc", "def", "xyz"): > > doStuff() > > > > elif x in ("pqr", "tuv", "123"): > > doOtherStuff() > > > > elif ... >

Re: Non-ASCII languages

2006-07-01 Thread Scott David Daniels
Tim Roberts wrote: > It surprises many people to learn that virtually everything we > think of as modern and interesting in computer science was first explored > in the 1960s and early 1970s. GUIs, color, 3D, structured progamming, > networking, interpreters, Unix; the list goes on and on. It was

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread Thorsten Kampe
* gavino (2006-07-01 11:34 +) > This seems easy but I have been asking tcl and python IRC chat all day > and no one gave an answer. > I have 100 servers which need a new backup server added to a text file, > and then the backup agent restarted. > If I have a list of the servers, all with same

Re: Odd behavior with staticmethods

2006-07-01 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > ya know, I've searched for these "new classes" at least five times. > I've heard all the wonderful things about how they make your life into > a piece of chocolate with rainbows sprinkled in it. Never once have I > found a site that explains what syntax to use to make th

Re: python guru in the Bay Area

2006-07-01 Thread gene tani
bruce wrote: > hi... > > is there someone in the Bay Area who knows python, that I can talk to ... I > have the shell of a real basic app, and I'd like someone who can walk me > through how to set it up. > > i'm talking about passing arrays, setting up global data, etc... basically, > if i can cre

Re: python guru in the Bay Area

2006-07-01 Thread John Bokma
"bruce" <[EMAIL PROTECTED]> wrote: > ps. yeah.. i know i could eventually figure most of this by > searching/experimenting/etc... using google.. but i'd rather move as > fast as possible. Then I recommend a book instead of trial and error programming. Dive into Python can be downloaded for free,

Re: Non-ASCII languages

2006-07-01 Thread Tim Roberts
Scott David Daniels <[EMAIL PROTECTED]> wrote: > >SAIL (Stanford AI Lab) had the first laser printer >to play with (people wrote incredibly ugly documents with tons of fonts >in them because it was the first they could spec it). "Ransom note syndrome." Virtually everyone falls prey to this the f

python guru in the Bay Area

2006-07-01 Thread bruce
hi... is there someone in the Bay Area who knows python, that I can talk to ... I have the shell of a real basic app, and I'd like someone who can walk me through how to set it up. i'm talking about passing arrays, setting up global data, etc... basically, if i can create a shell for what i'm try

Re: Odd behavior with staticmethods

2006-07-01 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > ya know, I've searched for these "new classes" at least five times. > I've heard all the wonderful things about how they make your life into > a piece of chocolate with rainbows sprinkled in it. Never once have I > found a site that explains what syntax to use to make

Re: Odd behavior with staticmethods

2006-07-01 Thread [EMAIL PROTECTED]
ya know, I've searched for these "new classes" at least five times. I've heard all the wonderful things about how they make your life into a piece of chocolate with rainbows sprinkled in it. Never once have I found a site that explains what syntax to use to make these new classes. Anyone have a U

python-dev Summary for 2006-05-16 through 2006-05-31

2006-07-01 Thread Steven Bethard
python-dev Summary for 2006-05-16 through 2006-05-31 .. contents:: [The HTML version of this Summary is available at http://www.python.org/dev/summary/2006-05-16_2006-05-31] = Announcements =

Re: really basic question regarding arrays/function output...

2006-07-01 Thread Paul McGuire
"bruce" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > hi... > > i have the following test python script i'm trying to figure out a > couple of things... > > 1st.. how can i write the output of the "label" to an array, and then how i > can select a given element of the array.. i

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread Paul McGuire
"gavino" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This seems easy but I have been asking tcl and python IRC chat all day > and no one gave an answer. > I have 100 servers which need a new backup server added to a text file, > and then the backup agent restarted. > If I have a

Re: beautifulsoup .vs tidy

2006-07-01 Thread Ravi Teja
Paul Boddie wrote: > Ravi Teja wrote: > > > > 1.) XPath is not a good idea at all with "malformed" HTML or perhaps > > web pages in general. > > import libxml2dom > import urllib > f = urllib.urlopen("http://wiki.python.org/moin/";) > s = f.read() > f.close() > # s contains HTML not XML text > d =

really basic question regarding arrays/function output...

2006-07-01 Thread bruce
hi... i have the following test python script i'm trying to figure out a couple of things... 1st.. how can i write the output of the "label" to an array, and then how i can select a given element of the array.. i know real basic.. 2nd.. where can i go to find methods of libxml2dom. i've been

Re: beautifulsoup .vs tidy

2006-07-01 Thread Matt Good
bruce wrote: > that's exactly what i'm trying to accomplish... i've used tidy, but it seems > to still generate warnings... > > initFile -> tidy ->cleanFile -> perl app (using xpath/livxml) > > the xpath/linxml functions in the perl app complain regarding the file. my > thought is that tidy isn't

doctest, sys.stderr, SystemExit and unused return values

2006-07-01 Thread Steven Bethard
I have an optparse-like module and though I have a full unittest-style suite of tests for it, I'd also like to be able to run doctest on the documentation to make sure my examples all work. However, I see that doctest (1) doesn't capture anything from sys.stderr, and (2) unlike the normal inte

Re: missing feature classes and missing fields

2006-07-01 Thread Roel Schroeven
Gary Herron schreef: > subramanian2003 wrote: >> Hello All, >> >> How can I check missing feature classes in a folder/personal geodatabase >> using python script. And how can I check missing fields in shape files. And >> also I want to check the attribute values using python. >> >> Thnx, >>

Re: list comprehension

2006-07-01 Thread John Machin
On 2/07/2006 6:43 AM, a wrote: > if i remove the global > i get an undefined error! That's because you have feed_list in one place and feeds_list in another. Ditto feed_id and feeds_id. Your code was *already* broken before you removed the global(s). > it was suggested as a solution in this gro

Re: Event notification system - where to start ?

2006-07-01 Thread Michael
[EMAIL PROTECTED] wrote: > We have been asked to develop and application for a client that is a > 'notification" system. We would like to use python, but are struggling > to find the right starting point. Any suggestions, tips or sample code > would be appreciated. Kamaelia [1] sounds like a go

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread John Machin
On 2/07/2006 6:01 AM, [EMAIL PROTECTED] wrote: > This has been bothering me for a while. [snip] Summary of OP's post: d.keys() and d.values() should return sets in Python 3.0. Observations: (1) My code [some of which dates back to Python 1.5.1] uses about 12 x d.items() and 11 x d.keys() for e

Re: Odd behavior with staticmethods

2006-07-01 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I'm getting rather inconsistent behavior with staticmethod. Not really. class A: > def orig(): > print "hi" > st = staticmethod(orig) > st2 = st > wrapped = [ orig ] > wrapped2 = [ st ] ... A.wrapped[0]() # ODD - wra

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Robert Kern
[EMAIL PROTECTED] wrote: > The same thing goes for the values(). Here most people will argue that > values are not necessarily unique, so a list is more appropriate, but > in fact the values are unique it is just that more than one key could > map to the same value. What is 'seen' in dictionary is

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Nick Vatamaniuc
> 1 - golden handcuffs. Breaking old code is bad 90% of the time I agree with you on that, mostly for code that counted on list methods of result of keys() - like you later show with sort. But there is a side note: old code that assumed a particular ordering of the keys or values is broken any

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I can't speak for your code, but this is the most common use of keys in > my coding: > # d is some dictionary > keys = d.keys() > keys.sort() > for k in keys: > #blah This you can rewrite quite effectively as: for k in sorted(d): #blah --Scott David Dan

Re: list comprehension

2006-07-01 Thread a
if i remove the global i get an undefined error! it was suggested as a solution in this group below http://groups.google.com/group/comp.lang.python/browse_thread/thread/b7b2dcdc3e109f3e?hide_quotes=no#msg_8130543f82c6 thanks Simon Forman wrote: > a wrote: > > hi simon thanks for your reply > >

Re: sys.stdin and two CTRL-Ds

2006-07-01 Thread John Machin
On 2/07/2006 5:02 AM, Christoph Haas wrote: > Hi... > > I encountered a problem that - according to my google search - other > people have found, too. Example code: > > import sys > for line in sys.stdin: >print line > > Running this code in Python 2.3 or 2.4 has the problem that I need to >

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread [EMAIL PROTECTED]
I would sugest looking at http://pexpect.sourceforge.net/ The Expect metalanguage was specifically designed for the kind of things you are trying to do. I used it recently on a project to configure 25 instances of an application, remotly, half over ssh half over telnet. -- http://mail.python.or

RE: building/installing python libs/modules...

2006-07-01 Thread bruce
my bad.. saw that.. completely missed it... i had guessed.. and am up/runing/testing.. -bruce -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of John Machin Sent: Saturday, July 01, 2006 12:53 PM To: python-list@python.org Subject: Re: building/installing py

Re: Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread [EMAIL PROTECTED]
There's a few good reasons. 1 - golden handcuffs. Breaking old code is bad 90% of the time 2 - creating a set MAY be slower. Python's sets seem to imply to that they will always be a hash map. in this case, some creative hash map "mapping" could allow one to create a set without calculating hash

Re: building/installing python libs/modules...

2006-07-01 Thread Ravi Teja
> Here is a click and go installer built for Windows that I found from > Google. > http://users.skynet.be/sbi/libxml-python/binaries/libxml2-python-2.6.22.win32-py2.4.exe Oops! That is for libxml2, not libxml2dom. -- http://mail.python.org/mailman/listinfo/python-list

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread Ravi Teja
gavino wrote: > list of servers L.txt > #cat L.txt > config file is /var/bkupexec/agent.cfg need to add "tell epobackup" to > bottom of file > # cat "tell epobackup" >> /var/bkupexec/agent.cfg > agent is /etc/init.d/agent.ini stop (and then start) > # /etc/init.d/agent.init stop > # /etc/init.d/ag

Odd behavior with staticmethods

2006-07-01 Thread [EMAIL PROTECTED]
I'm getting rather inconsistent behavior with staticmethod. @staticmethod has the same problems, but I'm demonstrating it with staticmethod() because it shows things more clearly --- >>> class A: def orig(): print "hi"

Dictionary .keys() and .values() should return a set [with Python 3000 in mind]

2006-07-01 Thread [EMAIL PROTECTED]
This has been bothering me for a while. Just want to find out if it just me or perhaps others have thought of this too: Why shouldn't the keyset of a dictionary be represented as a set instead of a list? I know that sets were introduced a lot later and lists/dictionaries were used instead but I thi

Re: building/installing python libs/modules...

2006-07-01 Thread Ravi Teja
> i've got the python app: > http://www.boddie.org.uk/python/downloads/libxml2dom-0.3.3.tar.gz > > and i've downloaded it, an untarred it... > i have the dir structure, but i don't know what needs to be done now!!! i > have a setup.py. does it get run? > > the Readme file didn't tell me how to buil

Re: building/installing python libs/modules...

2006-07-01 Thread John Machin
On 2/07/2006 5:37 AM, bruce wrote: > paul, > > thanks for the replies to my issues!!! much appreciation. > > i've got the python app: > http://www.boddie.org.uk/python/downloads/libxml2dom-0.3.3.tar.gz > > and i've downloaded it, an untarred it... > i have the dir structure, but i don't know wha

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread LittlePython
thx, "Ravi Teja" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > LittlePython wrote: > > Does this require a ssh client or server? > > > > I use authpf to open up my PF firewall for internet use. Generally I just > > open up putty and make a connection to the FW ( which open the po

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread Ravi Teja
LittlePython wrote: > Does this require a ssh client or server? > > I use authpf to open up my PF firewall for internet use. Generally I just > open up putty and make a connection to the FW ( which open the ports) and > minize it till I am done. When I close putty authpf losses the ssh session > h

building/installing python libs/modules...

2006-07-01 Thread bruce
paul, thanks for the replies to my issues!!! much appreciation. i've got the python app: http://www.boddie.org.uk/python/downloads/libxml2dom-0.3.3.tar.gz and i've downloaded it, an untarred it... i have the dir structure, but i don't know what needs to be done now!!! i have a setup.py. does it

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread LittlePython
Well, I guess you have sold me on this. I will wait till I have grown up to be a big and wise python (who is still employed) and all my growing (scripting) scares have healed properly or maybe even forgotten by my employers. Thx "Jezzz ... What could possible go wrong!" Signed, Mr. DoRight "Sco

sys.stdin and two CTRL-Ds

2006-07-01 Thread Christoph Haas
Hi... I encountered a problem that - according to my google search - other people have found, too. Example code: import sys for line in sys.stdin: print line Running this code in Python 2.3 or 2.4 has the problem that I need to send two EOFs (Ctrl-D) to break out of that loop. Use case is a

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread gavino
list of servers L.txt #cat L.txt config file is /var/bkupexec/agent.cfg need to add "tell epobackup" to bottom of file # cat "tell epobackup" >> /var/bkupexec/agent.cfg agent is /etc/init.d/agent.ini stop (and then start) # /etc/init.d/agent.init stop # /etc/init.d/agent.init start os=redhat ent 4E

Re: Non-ASCII languages

2006-07-01 Thread Scott David Daniels
Jorgen Grahn wrote: > On Thu, 29 Jun 2006 23:19:34 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Jorgen Grahn wrote: > ... >>> (I like well-typeset code in print though > Possibly true, and definitely for Knuth. But WYSIWYG was unknown at the > time; these people all programmed using fixe

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread Scott David Daniels
Jean-Paul Calderone wrote: > On Sat, 01 Jul 2006 16:36:02 GMT, LittlePython <[EMAIL PROTECTED]> > wrote: >> I am looking for some good beginner how-to links and maybe some simple >> example scripts that perform threading on windows platforms. Hopefully >> authors who don't mind doing "a little spo

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread LittlePython
Thx "Paul Rubin" wrote in message news:[EMAIL PROTECTED] > "LittlePython" <[EMAIL PROTECTED]> writes: > > I am looking for some good beginner how-to links and maybe some simple > > example scripts that perform threading on windows platforms. Hopefully > > authors who do

Re: How to create a limited set of instanceses of a class

2006-07-01 Thread Scott David Daniels
madpython wrote: > For the pure theory sake and mind expansion i got a question. > Experimenting with __new__ i found out how to create a singleton. > class SingleStr(object): > def __new__(cls,*args,**kwargs): > instance=cls.__dict__.get('instance') > if instance: >

Re: print shell output in a file

2006-07-01 Thread Scott David Daniels
Juergen Huber wrote: ... > here is the print command, which delivers me the following output (see > below) on the shell: > print '%-30s | %-12d | %-12d |%-12d ' % (typename, > size / count, > count,

Re: How to create a limited set of instanceses of a class

2006-07-01 Thread Alex Martelli
madpython <[EMAIL PROTECTED]> wrote: > For the pure theory sake and mind expansion i got a question. > Experimenting with __new__ i found out how to create a singleton. > class SingleStr(object): > def __new__(cls,*args,**kwargs): > instance=cls.__dict__.get('instance') > if in

Re: missing feature classes and missing fields

2006-07-01 Thread Gary Herron
subramanian2003 wrote: > Hello All, > > How can I check missing feature classes in a folder/personal geodatabase > using python script. And how can I check missing fields in shape files. And > also I want to check the attribute values using python. > > Thnx, > Subramanian. > > > > This li

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread LittlePython
I want to access the mailbox move methods and thread unto 4 moves at once. Currently I am access one move at a time via com but I would like to go a little deeper and start researching threading and the code that is behind the com. My use involves hundreds if not thousands of mailboxes over a short

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread Paul Rubin
"LittlePython" <[EMAIL PROTECTED]> writes: > I am looking for some good beginner how-to links and maybe some simple > example scripts that perform threading on windows platforms. Hopefully > authors who don't mind doing "a little spoon feeding" would be great as I am > a "baby python" who is very g

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread LittlePython
Does this require a ssh client or server? I use authpf to open up my PF firewall for internet use. Generally I just open up putty and make a connection to the FW ( which open the ports) and minize it till I am done. When I close putty authpf losses the ssh session heartbeat and will then instruct

Re: Threading HowTo's in Windows platforms

2006-07-01 Thread Jean-Paul Calderone
On Sat, 01 Jul 2006 16:36:02 GMT, LittlePython <[EMAIL PROTECTED]> wrote: >I am looking for some good beginner how-to links and maybe some simple >example scripts that perform threading on windows platforms. Hopefully >authors who don't mind doing "a little spoon feeding" would be great as I am >a

Re: What is Expressiveness in a Computer Language

2006-07-01 Thread Stephen J. Bevan
Darren New <[EMAIL PROTECTED]> writes: > Andreas Rossberg wrote: >> AFAICT, ADT describes a type whose values can only be accessed by a >> certain fixed set of operations. > > No. AFAIU, an ADT defines the type based on the operations. The stack > holding the integers 1 and 2 is the value (push(2,

Re: beautifulsoup .vs tidy

2006-07-01 Thread Paul Boddie
Ravi Teja wrote: > > 1.) XPath is not a good idea at all with "malformed" HTML or perhaps > web pages in general. import libxml2dom import urllib f = urllib.urlopen("http://wiki.python.org/moin/";) s = f.read() f.close() # s contains HTML not XML text d = libxml2dom.parseString(s, html=1) # get th

cheetah.

2006-07-01 Thread chun ping wang
I am having trouble using cheetah and getting it to work the way i want (mvc) I have the following file. index.py : # imports BibleController and setting. BibleController.py that includes the Bible.py model to database (those works). At the end of it i have. print Template ( file = "BibleView

Threading HowTo's in Windows platforms

2006-07-01 Thread LittlePython
I am looking for some good beginner how-to links and maybe some simple example scripts that perform threading on windows platforms. Hopefully authors who don't mind doing "a little spoon feeding" would be great as I am a "baby python" who is very green with threading.. Thx -- http://mail.python

How to create a limited set of instanceses of a class

2006-07-01 Thread madpython
For the pure theory sake and mind expansion i got a question. Experimenting with __new__ i found out how to create a singleton. class SingleStr(object): def __new__(cls,*args,**kwargs): instance=cls.__dict__.get('instance') if instance: return instance cls.in

Re: gmail/poplib: quickly detecting new mail

2006-07-01 Thread Alex Martelli
LJ <[EMAIL PROTECTED]> wrote: ... > 1. is this a standard behavior of pop protocol? (to give me the same > results for any API call on a single login?) > 2. OR is this a peculiarity of gmail Definitely POP3 standard behavior, as a simple reading of the relevant RFC will show (e.g., http://www.i

Re: gmail/poplib: quickly detecting new mail

2006-07-01 Thread Jean-Paul Calderone
On 1 Jul 2006 08:29:51 -0700, LJ <[EMAIL PROTECTED]> wrote: >Hello, > >I'm trying to monitor my gmail account to know when I have obtained a >new email. It seems that once I have logged in, I should be able to >call the stat() function repeatedly to see how many messages are in my >inbox. The pro

gmail/poplib: quickly detecting new mail

2006-07-01 Thread LJ
Hello, I'm trying to monitor my gmail account to know when I have obtained a new email. It seems that once I have logged in, I should be able to call the stat() function repeatedly to see how many messages are in my inbox. The problem is that this number does not seem to update until I have logg

Re: beautifulsoup .vs tidy

2006-07-01 Thread Fredrik Lundh
bruce wrote: > that's exactly what i'm trying to accomplish... i've used tidy, but it seems > to still generate warnings... > > initFile -> tidy ->cleanFile -> perl app (using xpath/livxml) > > the xpath/linxml functions in the perl app complain regarding the file. what exactly do they complai

Re: Replace Whole Object Through Object Method

2006-07-01 Thread John Roth
[EMAIL PROTECTED] wrote: > How can an object replace itself using its own method? See the > following code [code deleted] At the risk of creating totally incomprehensible and unmaintainable code, you need two things: First, you can change the class of any new style object by assigning to the __

RE: beautifulsoup .vs tidy

2006-07-01 Thread bruce
hi paddy... that's exactly what i'm trying to accomplish... i've used tidy, but it seems to still generate warnings... initFile -> tidy ->cleanFile -> perl app (using xpath/livxml) the xpath/linxml functions in the perl app complain regarding the file. my thought is that tidy isn't cleaning eno

Re: lxml and SimpleXMLWriter

2006-07-01 Thread Fredrik Lundh
Srijit Kumar Bhadra wrote: > I am new to lxml. I am interested to know the equivalent code using > lxml (http://cheeseshop.python.org/pypi/lxml/1.1alpha). The code is > taken from http://effbot.org/zone/xml-writer.htm the lxml library implements the ElementTree module API (with extensions), not

lxml and SimpleXMLWriter

2006-07-01 Thread Srijit Kumar Bhadra
I am new to lxml. I am interested to know the equivalent code using lxml (http://cheeseshop.python.org/pypi/lxml/1.1alpha). The code is taken from http://effbot.org/zone/xml-writer.htm from elementtree.SimpleXMLWriter import XMLWriter import sys w = XMLWriter(sys.stdout) html = w.start("html")

Re: languages with full unicode support

2006-07-01 Thread David Hopwood
Joachim Durchholz wrote: > Chris Uppal schrieb: >> Joachim Durchholz wrote: >> This is implementation-defined in C. A compiler is allowed to accept variable names with alphabetic Unicode characters outside of ASCII. >>> >>> Hmm... that could would be nonportable, so C support for Unicode

Re: Regular Expression - old regex module vs. re module

2006-07-01 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, Steve <[EMAIL PROTECTED]> wrote: >Hi All! > >Thanks for your suggestions and comments! I was able to use some of >your code and suggestions and have come up with this new version of >Report.py. > >Here's the updated code : > >exponentPattern = re.compile('\(^\|[^\\#

Re: I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread Ravi Teja
gavino wrote: > This seems easy but I have been asking tcl and python IRC chat all day > and no one gave an answer. > I have 100 servers which need a new backup server added to a text file, > and then the backup agent restarted. > If I have a list of the servers, all with same root password, and

Re: languages with full unicode support

2006-07-01 Thread Dr.Ruud
Chris Uppal schreef: > Since the interpretation of characters which are yet to be added to > Unicode is undefined (will they be digits, "letters", operators, > symbol, punctuation ?), there doesn't seem to be any sane way > that a language could allow an unrestricted choice of Unicode in > ide

Re: looks like in PIL, resize() will give high quality thumbnails than thumbnail()

2006-07-01 Thread Summercoolness
[EMAIL PROTECTED] wrote: > In PIL, since thumbnail() first makes a draft copy of the image, and > then resize it, so thumbnail() can run a lot faster than resize() > because draft() seems a lot faster when resizing from very big images > to small images... (such as the original image is 3000 x 20

looks like in PIL, resize() will give high quality thumbnails than thumbnail()

2006-07-01 Thread Summercoolness
In PIL, since thumbnail() first makes a draft copy of the image, and then resize it, so thumbnail() can run a lot faster than resize() because draft() seems a lot faster when resizing from very big images to small images... (such as the original image is 3000 x 2000, and it can make a draft really

Re: Interprocess communication on multi-user machine

2006-07-01 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Nick Maclaren) wrote: >In article <[EMAIL PROTECTED]>, >Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes: >|> > >|> >Sockets are often accessed via special files, but are not files. >|> >|> They are files. They are not _regular_ files. > >Yes, I k

I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted.

2006-07-01 Thread gavino
This seems easy but I have been asking tcl and python IRC chat all day and no one gave an answer. I have 100 servers which need a new backup server added to a text file, and then the backup agent restarted. If I have a list of the servers, all with same root password, and the connection is ssh. Ho

206 The filename or extension is too long / OSError: [Errno 38] Filename too long

2006-07-01 Thread robert
e.g. open/os module functions (os.path.getmtime...) and win32api/win32file functions fail on long paths (>~255 chars) even the '\\?\' trick from http://www.google.com/url?sa=D&q=http://msdn.microsoft.com/library/default.asp%3Furl%3D/library/en-us/fileio/fs/naming_a_file.asp does not work: >>>

Re: Non-ASCII languages (was: Re: style question)

2006-07-01 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Jorgen Grahn <[EMAIL PROTECTED]> writes: |> |> Possibly true, and definitely for Knuth. But WYSIWYG was unknown at the |> time; these people all programmed using fixed-width fonts, on teletypes or |> character-mapped terminals. Hell, even full-screen editors were

Non-ASCII languages (was: Re: style question)

2006-07-01 Thread Jorgen Grahn
On Thu, 29 Jun 2006 23:19:34 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: ... >> (I like well-typeset code in print though. Bjarne Stroustrup uses an elegant >> system for C++ code, where identifiers and strings are in Times italic, >> operators in Courier, and so on.) > >

Re: Replace Whole Object Through Object Method

2006-07-01 Thread Stefan Schwarzer
Hi Bruno :) On 2006-06-27 10:30, Bruno Desthuilliers wrote: > FWIW, a good part of the canonical design patterns are mostly workaround > the lack of flexibility in languages like C++ and Java. May be, but that doesn't exclude that some patterns are also useful in Python. :-) > The Strategy > pat

Computer Industry Workers May Face Cancer Risks

2006-07-01 Thread studyandjobs
Computer Industry Workers May Face Cancer Risks http://www.studyandjobs.com/Comp_worker_cancer.html or visit http://www.studyandjobs.com/Cancer.html Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: style question

2006-07-01 Thread Jorgen Grahn
On Thu, 29 Jun 2006 23:19:34 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Jorgen Grahn wrote: > >>> assuming fixed-pitch fonts isn't very Pythonic, though; to get reliable >>> indentation >>> no matter what font you're using, you can write [...] >> >> Since when? I've always coded, in all l

Re: using TreeBuilder in an ElementTree like way

2006-07-01 Thread Fredrik Lundh
Greg Aumann wrote: > In reading the elementtree documentation I found the > ElementTree.TreeBuilder class which it says can be used to create > parsers for XML-like languages. a TreeBuilder is a thing that turns a sequence of start(), data(), and end() method calls into an Element tree structu

Re: style question

2006-07-01 Thread Jorgen Grahn
On Thu, 29 Jun 2006 15:31:53 -0700, Scott David Daniels <[EMAIL PROTECTED]> wrote: ... >> I like well-typeset code in print though. Bjarne Stroustrup uses an elegant >> system for C++ code, > See Knuth on Literate Programming and the "Web" systems (e.g. CWeb). > His goal is to look good type

Re: Module executed twice when imported!

2006-07-01 Thread Georg Brandl
Michael Abbott wrote: > In article <[EMAIL PROTECTED]>, > Georg Brandl <[EMAIL PROTECTED]> wrote: >> That's because __name__ is normally set to the module's name in the package >> hierarchy. When you set it to "some1.some2", Python thinks it's >> in a subpackage > > A. > > So what I *should*

  1   2   >