Re: To the python-list moderator

2005-09-02 Thread Fredrik Lundh
Terry Reedy wrote: >> What's >> happening is that Spambayes is marking the message as UNSURE. The >> message that mailman sends to the sender is unfortunate. The >> "Message has a suspicious header" notice is misleading because the >> user did not have any header in their message that caused it

python logo

2005-09-02 Thread Xah Lee
i noticed that Python uses various logos: http://python.org/pics/pythonHi.gif http://python.org/pics/PyBanner038.gif http://python.org/pics/PyBanner037.gif http://python.org/pics/PythonPoweredSmall.gif http://wiki.python.org/pics/PyBanner057.gif is this some decision that python should use vario

Re: Problem with response object

2005-09-02 Thread Steve Holden
Harish Kotian wrote: > Hi Steve > Thank you for getting back. I suspect I am having problem with the > response object in Python. > > I also tried with response.write it didn't work. > I pasted your code into my page and tried it. I am again pasting the > code followed by the error page. > I sh

Re: Problem with response object

2005-09-02 Thread Steve Holden
Harish Kotian wrote: > Hi Steve > I copied the lines from your mail and again got the error. > I am only pasting the relevant error lines below. > > • Error Type: > Python ActiveX Scripting Engine (0x80020009) > Traceback (most recent call last): File "

Re: urllib.urlopen doesn't work

2005-09-02 Thread Steve Holden
Josef Cihal wrote: > Hallo, > > i need a help with module URLLIB. > > I am trying to open url via: > -urllib.urlopen > ('http://brokerjet.ecetra.com/at/markets/stocks/indices.phtml?notation=92866') > > > Problem is, that I am always redirecting to > - LOGIN page (www.brokerjet.at

Re: defining classes

2005-09-02 Thread Steve Holden
LeRoy Lee wrote: > I have been searching for the answer to this as it will determine how I use > classes. Here are two bits of code. [snip already well-quoted examples] > > I can't figure out why it is working this way. I figure I must be thinking > about this wrong. I was thinking that I c

Re: 'isa' keyword

2005-09-02 Thread Bengt Richter
On Thu, 01 Sep 2005 21:25:20 -0500, D H <[EMAIL PROTECTED]> wrote: >talin at acm dot org wrote: >> Although I realize the perils of even suggesting polluting the Python >> namespace with a new keyword, I often think that it would be useful to >> consider defining an operator for testing whether or

Re: 'isa' keyword

2005-09-02 Thread Steve Holden
phil hunt wrote: > On Thu, 01 Sep 2005 20:39:14 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: > >>phil hunt wrote: >> >>>It could be argued of course, that an OOPL should allow methods to >>>be sent with a grammar: >>> >>> receiver selector argument >>> >>>(which is almost what Smalltalk does)

RE: To the python-list moderator

2005-09-02 Thread Tony Meyer
> What still puzzles me is why the spamblocker that embargoed > me and others did not catch such obvious spam as Subject: Re: > The penis is way too delicate for masturbation (and occasional > others like this). I know nothing about how spambayes is setup for python-list, but my guess would be

Re: Record separator for readlines()

2005-09-02 Thread Bengt Richter
On Fri, 2 Sep 2005 22:10:18 -0500, [EMAIL PROTECTED] wrote: > >--SkvwRMAIpAhPCcCJ >Content-Type: text/plain; charset=us-ascii >Content-Disposition: inline > >I think you still have to roll your own. > >Here's a start: > def ireadlines(f, s='\n', bs=4096): > if not s: raise ValueErr

Re: Bug in string.find

2005-09-02 Thread Terry Reedy
"Ron Adam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: >> "Ron Adam" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>>So how do I express a -0? >> >> >> You just did ;-) but I probably do not know what you mean. > > b[-1:] = ['Z']# rep

Re: Problems with os.system

2005-09-02 Thread jepler
On Fri, Sep 02, 2005 at 01:45:42PM -0700, alexLIGO wrote: > Can I force python to execute the program on the bash? What can > I do? os.system() is a wrapper on system(3), which invokes /bin/sh. If you want to use a different shell, you can use os.spawnv(os.P_WAIT, '/bin/bash', ['bash', '-c',

Re: unicode and os.system

2005-09-02 Thread jepler
I think you need u.encode('utf-8') .encode() turns unicode into a byte string, .decode() turns a byte string into unicode. Jeff pgpCGSuYcXhRF.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Record separator for readlines()

2005-09-02 Thread jepler
I think you still have to roll your own. Here's a start: def ireadlines(f, s='\n', bs=4096): if not s: raise ValueError, "separator must not be empty" r = [] while 1: b = f.read(bs) if not b: break ofs = 0

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing,was Re: Bug in slice type

2005-09-02 Thread Bengt Richter
On Wed, 31 Aug 2005 14:16:28 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: [...] > >The problem with negative index's are that positive index's are zero >based, but negative index's are 1 based. Which leads to a non >symmetrical situations. > >Note that you can insert an item before the first item us

Re: Bug in string.find

2005-09-02 Thread Ron Adam
Terry Reedy wrote: > "Ron Adam" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Fredrik Lundh wrote: >> >>>Ron Adam wrote: >>> The problem with negative index's are that positive index's are zero based, but negative index's are 1 based. Which leads to a non symmetri

Re: Find day of week from month and year

2005-09-02 Thread John Machin
Peter Hansen wrote: > Carsten Haese wrote: > >> On Fri, 2005-09-02 at 16:46, Laguna wrote: >> >>> def expiration(year, month): >>> weekday = calendar.weekday(year, month, 1) >>> table = [19, 18, 17, 16, 15, 21, 20] >>> return table[weekday] >>> >> This, of course, can be "optimized" in

Re: Find day of week from month and year

2005-09-02 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > (And, if I were "optimizing", I would of course dispense with the > dynamic creation of the static table upon every execution of > expiration(), and move it outside the function.) Replacing it with a tuple might be enough for that. -- http://mail.python.

Re: Find day of week from month and year

2005-09-02 Thread Peter Hansen
Carsten Haese wrote: > On Fri, 2005-09-02 at 16:46, Laguna wrote: >>def expiration(year, month): >> weekday = calendar.weekday(year, month, 1) >> table = [19, 18, 17, 16, 15, 21, 20] >> return table[weekday] >> > This, of course, can be "optimized" into > > def expiration(year, mont

Re: Epydoc - Documenting class members?

2005-09-02 Thread Terry Hancock
On Friday 02 September 2005 08:28 am, Michael Ekstrand wrote: > On Thu, 1 Sep 2005 22:38:03 -0500 > Terry Hancock <[EMAIL PROTECTED]> wrote: > > > I don't like this, I want to document where I declare the variable > > > below. Doxygen (www.doxygen.org), for one example, knows how to do > > > this.

Re: Add lists to class?

2005-09-02 Thread BBands
> Why don't you use a real list instead? I am using lists... I just showed the naming schema. Here is how they are implemented. for var in range(len(self.symbols)): setattr(self, "_" + str(var), []) > I don't understand what > self.__dict__["_" + str(var)] gets you. It let's me access lists

Re: unicode and os.system

2005-09-02 Thread Erik Max Francis
Dumbkiwi wrote: > I've tried that previously, and get: > > Traceback (most recent call last): > File "/home/matt/karamba/lwbkup/liquid_weather.py", line 2765, in initWidget > os.system('dcop kxdocker docker addIcon Current %s "%s : %s" /dev/null > GIcon lwp none none none none' %(icopath,

Re: unicode and os.system

2005-09-02 Thread Dumbkiwi
On Fri, 02 Sep 2005 16:11:48 -0700, Erik Max Francis wrote: > Dumbkiwi wrote: > >> Can anyone help me to work through this issue? I'm a bit lost as to where >> to start. > > If you want to convert it to UTF-8, then do so with > > u.decode('utf-8') I've tried that previously, and get: T

Re: unicode and os.system

2005-09-02 Thread Erik Max Francis
Dumbkiwi wrote: > Can anyone help me to work through this issue? I'm a bit lost as to where > to start. If you want to convert it to UTF-8, then do so with u.decode('utf-8') -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W &

unicode and os.system

2005-09-02 Thread Dumbkiwi
I've got a rather large python script that I write and maintain. It has some interaction with other programmes on the linux/kde desktop through the dcop interface. This script also uses the gettext module to enable the output of the script to be translated into several languages, including utf-8

Re: To the python-list moderator

2005-09-02 Thread Terry Reedy
"Neil Schemenauer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > In the future, sending a message to [EMAIL PROTECTED] is > suggested rather than posting to only to python-list. Thank you information. Since python.org is mostly stuff other than the mailing lists, I did not thin

Re: Find day of week from month and year

2005-09-02 Thread Laguna
Hey Donn, I don't mean to offend anyone here. I was just saying that the other solution is better suited for my problem. I truly appreciate your analysis and suggestions. BTW, I am not a programmer :( and I like the simplest solution whenever possible. Cheers, L -- http://mail.python.org/mailm

Re: Record separator for readlines()

2005-09-02 Thread gene tani
universal newlines? http://www.python.org/doc/2.3.3/whatsnew/node7.html Angelic Devil wrote: > I know this has been asked before (I already consulted the Google > Groups archive), but I have not seen a definative answer. Is there a > way to change the record separator in readlines()? The documen

Re: Sockets: code works locally but fails over LAN

2005-09-02 Thread Bryan Olson
n00m wrote: > My today's tests (over LAN). > I think *it* will drive me mad very soon. Network programming is like that. Just because something worked once doesn't mean it really works. I had guessed two causes for the behavior you were seeing, and either could result in sporadic failures. >

Fw: urllib.urlopen doesn't work

2005-09-02 Thread Josef Cihal
  - Original Message - From: Josef Cihal To: python-list@python.org Sent: Saturday, September 03, 2005 12:09 AM Subject: urllib.urlopen doesn't work Hallo,   i need a help with module URLLIB.   I am trying to open url via: -    urllib.urlopen ('http://brokerjet.ecetra.com/at/market

Re: Problems with os.system

2005-09-02 Thread Michael Hoffman
alexLIGO wrote: > I am trying to run a python script that executes several other programs > on the bash (under linux) and reads some of the output of those > programs. This works fine for a couple of os.system() calls, but then > it does not work anymore. os.system() returns always -1, but when > e

urllib.urlopen doesn't work

2005-09-02 Thread Josef Cihal
Hallo,   i need a help with module URLLIB.   I am trying to open url via: -    urllib.urlopen ('http://brokerjet.ecetra.com/at/markets/stocks/indices.phtml?notation=92866')     Problem is, that I am always redirecting to - LOGIN page (www.brokerjet.at), and cannot get my page with "news", whi

Re: Problems with os.system

2005-09-02 Thread jepler
Repeated calls to system() seem to cause no problem here. I ran the following program: import os for i in xrange(1): assert os.system("true") == 0 in around 25 seconds, the 'for' loop completed, and the 'true' command always returned 0 from system, as expected.

Re: 'isa' keyword

2005-09-02 Thread phil hunt
On Thu, 01 Sep 2005 20:39:14 -0500, Steve Holden <[EMAIL PROTECTED]> wrote: >phil hunt wrote: >> It could be argued of course, that an OOPL should allow methods to >> be sent with a grammar: >> >>receiver selector argument >> >> (which is almost what Smalltalk does), but you're not arguing f

Re: Find day of week from month and year

2005-09-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Laguna" <[EMAIL PROTECTED]> wrote: > > What do you mean by, "the 9 element tuple need to be populated > > correctly"? Do you need someone to tell you what values it > > needs? What happens if you use (2005, 9, 1, 0, 0, 0, 0, 0, 0), > > for example? If you make

Record separator for readlines()

2005-09-02 Thread Angelic Devil
I know this has been asked before (I already consulted the Google Groups archive), but I have not seen a definative answer. Is there a way to change the record separator in readlines()? The documentation does not mention any way to do this. I know way back in 1998, Guido said he would consider

Re: Problems with os.system

2005-09-02 Thread alexLIGO
No I read some other data files that has been created by the other program. I am not interested in the stdout or err of that program... -- http://mail.python.org/mailman/listinfo/python-list

ANN: Python Computer Graphics Kit v2.0.0alpha5

2005-09-02 Thread Matthias Baas
The fifth alpha release of version 2 of the Python Computer Graphics Kit is available at http://cgkit.sourceforge.net What is it? --- The Python Computer Graphics Kit is a generic 3D package written in C++ and Python that can be used for a variety of domains such as scientific visualizat

Re: Find day of week from month and year

2005-09-02 Thread Laguna
Thanks for the "hint" :) I may use your solution if this becomes my bottleneck! I try to get away from Perl-ish syntax though. Best, L -- http://mail.python.org/mailman/listinfo/python-list

Re: Decrypting GPG/PGP email messages

2005-09-02 Thread Piet van Oostrum
> François Pinard <[EMAIL PROTECTED]> (FP) wrote: >FP> Protection against replay is easily guaranteed by sequencing requests, >FP> that is, including a sequence number within the message, each originator >FP> his sequence. A digital signature prevents someone from tampering with >FP> the seq

Re: Problems with os.system

2005-09-02 Thread marduk
On Fri, 2005-09-02 at 13:45 -0700, alexLIGO wrote: > Hi, > > I am trying to run a python script that executes several other programs > on the bash (under linux) and reads some of the output of those > programs. This works fine for a couple of os.system() calls, but then > it does not work anymore.

Re: Jargons of Info Tech industry

2005-09-02 Thread John Bokma
[EMAIL PROTECTED] wrote: > Of course what the original poster did not consider is why > the standard line length was laid down... the VT100 terminals > (and related ones) had a line length which was 80 characters > (ok, with some options to switch to 132 characters if I > remember correctly)... an

Re: Find day of week from month and year

2005-09-02 Thread Carsten Haese
On Fri, 2005-09-02 at 16:46, Laguna wrote: > Paul, > > Thanks for the suggestion on calendar module. Here is my solution and > it works: > > def expiration(year, month): > weekday = calendar.weekday(year, month, 1) > table = [19, 18, 17, 16, 15, 21, 20] > return table[weekday] >

Re: Find day of week from month and year

2005-09-02 Thread Laguna
Paul, Thanks for the suggestion on calendar module. Here is my solution and it works: def expiration(year, month): weekday = calendar.weekday(year, month, 1) table = [19, 18, 17, 16, 15, 21, 20] return table[weekday] Cheers, Laguna -- http://mail.python.org/mailman/list

Problems with os.system

2005-09-02 Thread alexLIGO
Hi, I am trying to run a python script that executes several other programs on the bash (under linux) and reads some of the output of those programs. This works fine for a couple of os.system() calls, but then it does not work anymore. os.system() returns always -1, but when executing exactly the

Re: Proposal: add sys to __builtins__

2005-09-02 Thread Paul Watson
Steve Holden wrote: > Rick Wotnaz wrote: > >> Michael Hoffman <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >>> What would people think about adding sys to __builtins__ so that >>> "import sys" is no longer necessary? This is something I must >>> add to every script I write that's not

Re: Find day of week from month and year

2005-09-02 Thread Laguna
> What do you mean by, "the 9 element tuple need to be populated > correctly"? Do you need someone to tell you what values it > needs? What happens if you use (2005, 9, 1, 0, 0, 0, 0, 0, 0), > for example? If you make this tuple with localtime or gmtime, > do you know what the 7th (tm[6]) elemen

Re: defining classes

2005-09-02 Thread Steve Horsley
LeRoy Lee wrote: > I have been searching for the answer to this as it will determine how I > use classes. Here are two bits of code. > > class foo1: >def __init__(self, i): >self.r = i >self.j = 5 > >>> h = foo1(1) >>> h.r > > 1 > >>> h.j > > 5 > > > Now take this examp

Re: Problem building Python on HP-UX

2005-09-02 Thread sponix2ipfw
I don't know much about HP-UX, and I'm sure someone will shoot me down for saying this, but all *nix is about the same to me. I'd just try a ./configure --prefix=/opt/tcl_tk on both the TCL and TK installs, and then just drop the ./configure params in there to use /opt/tcl_tk/ as the prefix to the

Re: defining classes

2005-09-02 Thread Benji York
LeRoy Lee wrote: > I have been searching for the answer to this as it will determine how I use > classes. Here are two bits of code. > class foo2: > def __init__(self): > self.j = 5 > > >>>h = foo2() >>>h.j > > Traceback (most recent call last): > File "", line 1, in ? > Attribu

Re: defining classes

2005-09-02 Thread Grant Edwards
On 2005-09-02, LeRoy Lee <[EMAIL PROTECTED]> wrote: > Now take this example > > class foo2: > def __init__(self): > self.j = 5 > >>>h = foo2() >>>h.j > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: foo2 instance has no attribute 'j' Works fine for me e

Re: defining classes

2005-09-02 Thread Michael Hoffman
LeRoy Lee wrote: > class foo2: >def __init__(self): >self.j = 5 > >>> h = foo2() >>> h.j > > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: foo2 instance has no attribute 'j' Try again: >>> class foo2: ...def __init__(self): ...self.j = 5

defining classes

2005-09-02 Thread LeRoy Lee
I have been searching for the answer to this as it will determine how I use classes. Here are two bits of code. class foo1: def __init__(self, i): self.r = i self.j = 5 >>h = foo1(1) >>h.r 1 >>h.j 5 Now take this example class foo2: def __init__(self): self.j

Re: OpenSource documentation problems

2005-09-02 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Also, "not that long ago" must mean different things for different people. > I think we've required logins for three years or more. I hope you're not right and that it hasn't really been that long. Yikes ;-). -- http://mail.python.org/mailman/listinfo/python-list

Re: Find day of week from month and year

2005-09-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Laguna" <[EMAIL PROTECTED]> wrote: > I want to find the expiration date of stock options (3rd Friday of the > month) for an any give month and year. I have tried a few tricks with > the functions provided by the built-in module time, but the problem was > that the

Re: Problem building Python on HP-UX

2005-09-02 Thread Trent Mick
[Dr. Who wrote] > I'm trying to build Python 2.4.1 on HP-UX 11.00 with full tcl/tk IDLE > support. So far, I haven't had any luck. I always wind up getting > errors of the form: > > ld: DP relative code in file > /ptg/devtools/hppa1.1/pre/lib/libtk8.4.a(tkWindow.o) - shared library > must be pos

Re: OpenSource documentation problems

2005-09-02 Thread skip
Tim> [Paul Rubin] >> Until not that long ago, it was possible to submit sf bugs without >> being logged into sf. Why did that change? Tim> To reduce tracker spam, to reduce tracker vandalism, and to make it Tim> possible to contact submitters when needed. Also, "not that lon

Re: Find day of week from month and year

2005-09-02 Thread Robert Kern
Laguna wrote: > Hi Gurus, > > I want to find the expiration date of stock options (3rd Friday of the > month) for an any give month and year. I have tried a few tricks with > the functions provided by the built-in module time, but the problem was > that the 9 element tuple need to be populated cor

Re: Find day of week from month and year

2005-09-02 Thread Paul Rubin
"Laguna" <[EMAIL PROTECTED]> writes: > I want to find the expiration date of stock options (3rd Friday of the > month) for an any give month and year. I have tried a few tricks with > the functions provided by the built-in module time, but the problem was > that the 9 element tuple need to be popul

Find day of week from month and year

2005-09-02 Thread Laguna
Hi Gurus, I want to find the expiration date of stock options (3rd Friday of the month) for an any give month and year. I have tried a few tricks with the functions provided by the built-in module time, but the problem was that the 9 element tuple need to be populated correctly. Can anyone help me

Re: Code run from IDLE but not via double-clicking on its *.py

2005-09-02 Thread n00m
Dennis Lee Bieber wrote: > Hope you'll forgive my comment -- but for some reason those look... Your comments are absolutely relevant. > My version, using select(), shouldn't have this problem. Now I see what you meant ("You need no threads"). Your code works just fine (hope over LAN too). I correc

Re: problems with smtplib

2005-09-02 Thread Jon Hewer
just got home and i've tried my script on windows with my isp's smtp server, and found that my code wasn't getting past the s.connect() changed me code to: s = smtplib.SMTP('smtp.lineone.net') s.sendmail(me, to, msg.as_string()) s.quit() and now it works fine On 9/2/05, Steve Holden

Problem building Python on HP-UX

2005-09-02 Thread Dr. Who
I'm trying to build Python 2.4.1 on HP-UX 11.00 with full tcl/tk IDLE support. So far, I haven't had any luck. I always wind up getting errors of the form: ld: DP relative code in file /ptg/devtools/hppa1.1/pre/lib/libtk8.4.a(tkWindow.o) - shared library must be position independent. Use +z or

Re: is there a better way to check an array?

2005-09-02 Thread Peter Hansen
Fredrik Lundh wrote: > Peter Hansen wrote: >>Probably because at one point lists didn't even have the index() method, >>and when it was suggested and (I believe) Raymond H. added it > > the list "index" method has been in Python since, like, forever (early 1991, > according to CVS, which means tha

Re: Add lists to class?

2005-09-02 Thread Michael Hoffman
BBands wrote: > I start with a text file of ticker symbols. I read each symbol and > stick it in a list, retrieve the data for it from MySQL, do a trivial > smoothing and pass the data to a modeling routine. I read the tickers > into a list, self.symbols. OK... > Then for each ticker I create a

Re: problems with smtplib

2005-09-02 Thread Steve Holden
Peter Hansen wrote: > Steve Holden wrote: > >>n00m wrote: >> >> >>>I also can't get my SMTP (win2k) working with Python. >>>But... funnily this works fine: >>> >>>import smtplib >>>s = smtplib.SMTP('smtp.mail.ru') >>>s.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', 'hi >>>there!') >>>s.quit()

Re: Bug in string.find

2005-09-02 Thread Steve Holden
Dennis Lee Bieber wrote: > On Fri, 02 Sep 2005 00:23:14 GMT, Ron Adam <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > >>So how do I express a -0? Which should point to the gap after the last >>item. >> > > Step one: Obtain a processor that uses ones-complement arit

Re: Sockets: code works locally but fails over LAN

2005-09-02 Thread n00m
My today's tests (over LAN). I think *it* will drive me mad very soon. Firstly I tested both Bryan's codes. And they worked fine! Just as if they were tested locally! Then I tested Fredrik suggestion. And it worked out too. Expect unexpected, - as they say. At last I decided to test my own versi

Re: Add lists to class?

2005-09-02 Thread BBands
That's interesting and I take your point. Maybe there is a better way. Here is what I am doing now. (working) I start with a text file of ticker symbols. I read each symbol and stick it in a list, retrieve the data for it from MySQL, do a trivial smoothing and pass the data to a modeling routine.

Re: 'isa' keyword

2005-09-02 Thread talin at acm dot org
Thanks for all the respones :) I realized up front that this suggestion is unlikely to gain approval, for reasons eloquently stated above. However, there are still some interesting issues raised that I would like to discuss. Let me first respond to a few of the comments: >What's the difference be

Re: Add lists to class?

2005-09-02 Thread BBands
That's interesting and I take your point. Maybe there is a better way. Here is what I am doing now. (working) I start with a text file of ticker symbols. I read each symbol and stick it in a list, retrieve the data for it from MySQL, do a trivial smoothing and pass the data to a modeling routine.

Re: Code run from IDLE but not via double-clicking on its *.py

2005-09-02 Thread bryanjugglercryptographer
I wrote: > I prefer the tread solution. You can see my exmaple > in message <[EMAIL PROTECTED]>. > >http://groups.google.com/group/comp.lang.python/msg/ffd0159eb52c1b49 [...] > you should send the shutdown > across, much like you copy data across: shutdown writing on the > other socket. Whic

Re: Sockets: code works locally but fails over LAN

2005-09-02 Thread Bryan Olson
I wrote: > Below is a version that respects ^C to terminate > more-or-less cleanly. Oops, one more bug^H^H^H improvement. I forgot to shutdown writing. > import socket, threading, select > > sqls_host, sqls_port = '192.168.0.3', 1443 > proxy_host, proxy_port = '', 1434 > > > def start_d

Re: Code run from IDLE but not via double-clicking on its *.py

2005-09-02 Thread Bryan Olson
Dennis Lee Bieber wrote: > I'm going to go back a few messages... Looking for a > simplification... [...] > TWO threads, both just infinite loops of the same nature (you could > actually have done ONE def and passed different arguments in to > differentiate the two thread invocations

Help for NewBies at WikiBooks

2005-09-02 Thread Alessandro Bottoni
I just discovered that Wikipedia has a very fine WikiBook about Python Programming: http://en.wikibooks.org/wiki/Programming:Python I think that most of the newbies (like me ;-) will find it very interesting. CU --- Alessandro Bottoni -- http://mail.python.org/ma

Re: is there a better way to check an array?

2005-09-02 Thread Fredrik Lundh
Peter Hansen wrote: > Probably because at one point lists didn't even have the index() method, > and when it was suggested and (I believe) Raymond H. added it the list "index" method has been in Python since, like, forever (early 1991, according to CVS, which means that it was added about two yea

Re: .pth files question

2005-09-02 Thread Peter Hansen
Benjamin Rutt wrote: > Am I correct in understanding that: > > 1) foo.pth will be used if it is in the directory > /usr/lib/python-2.4/site-packages > > 2) foo.pth will not be read from if it is only placed somewhere in the > PYTHONPATH environment, such as foo.pth exists as the file > /tmp/bar/f

Re: .pth files question

2005-09-02 Thread Michael Hoffman
Benjamin Rutt wrote: > Am I correct in understanding that: > > 1) foo.pth will be used if it is in the directory > /usr/lib/python-2.4/site-packages > > 2) foo.pth will not be read from if it is only placed somewhere in the > PYTHONPATH environment, such as foo.pth exists as the file > /tmp/bar/f

Re: scroll a frame to display several lines of widgets at a time

2005-09-02 Thread William Gill
Matt Hammond wrote: > I don't quite understand (if I'm interpreting you correctly) why you > want separate widgets, all displayed at once, for several hundred > records - surely better to just reuse the one set of widgets and have > the scrollbar or back-forward buttons change which record

Re: __setslice__ and classes derived from list

2005-09-02 Thread Michael Hoffman
Dave Opstad wrote: > I'm happy to submit a feature request, once I figure out how to do it! http://sourceforge.net/projects/python/ Follow the RFE link. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: problems with smtplib

2005-09-02 Thread Peter Hansen
Steve Holden wrote: > n00m wrote: > >> I also can't get my SMTP (win2k) working with Python. >> But... funnily this works fine: >> >> import smtplib >> s = smtplib.SMTP('smtp.mail.ru') >> s.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', 'hi >> there!') >> s.quit() >> > That's pretty strange: t

Re: Jargons of Info Tech industry

2005-09-02 Thread axel
In comp.lang.perl.misc John Bokma <[EMAIL PROTECTED]> wrote: > "T Beck" <[EMAIL PROTECTED]> wrote: >> I suppose I was (as many people on the internet have a bad habit of >> doing) being more caustic than was strictly necessary. I don't really >> forsee the death of usenet anytime soon, I just do

Re: pain

2005-09-02 Thread Peter Hansen
Steve Holden wrote: > and the day managers stop being ignorant we'll all be able to fly around > on pigs. Not wishing to offend the pigs, of course. > > still-working-for-myself-ly y'rs - steve What Steve means here, of course, is that he is his own manager. ;-) -Peter -- http://mail.python.

Re: is there a better way to check an array?

2005-09-02 Thread Peter Hansen
Mike Meyer wrote: > "Steve M" <[EMAIL PROTECTED]> writes: >>my_list.find(candidate) >>-returns the index into my_list of the first occurrence of candidate. >>Returns -1 if candidate doesn't occur in my_list. > > Lists don't have a find method. strings do. Why is a good question. Probably because

Re: __setslice__ and classes derived from list

2005-09-02 Thread Dave Opstad
In article <[EMAIL PROTECTED]>, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Perhaps you should submit a feature request? It must be time to get rid > of __setslice__, if not now, then maybe by Python 3.0. I'm happy to submit a feature request, once I figure out how to do it! Dave -- http://m

.pth files question

2005-09-02 Thread Benjamin Rutt
Am I correct in understanding that: 1) foo.pth will be used if it is in the directory /usr/lib/python-2.4/site-packages 2) foo.pth will not be read from if it is only placed somewhere in the PYTHONPATH environment, such as foo.pth exists as the file /tmp/bar/foo.pth, where PYTHONPATH contains "/t

Re: OpenSource documentation problems

2005-09-02 Thread Peter Hansen
A.M. Kuchling wrote: > On Fri, 02 Sep 2005 06:19:16 GMT, > Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> My attempts at simple came in closer to the life insurance than >>Lincoln -- forget about Hemingway; the only way I could approach his >>writing was to stick to: Hello World; Go

why no user-def. attributes?

2005-09-02 Thread severa
I appologize in advance for stupid question, which is: why are user-defined attributes not allowed for builtin types? [I guess I undestand why *instances* cannot have them (e.g. then every dict would have a dict which would have a dict..), but this is a different question] I can imagine several

Re: To the python-list moderator

2005-09-02 Thread Neil Schemenauer
Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Terry Hancock wrote: > >> I got one of these too, recently. Maybe somebody is turning up the >> screws to get rid of spam that's been appearing on the list? In the future, sending a message to [EMAIL PROTECTED] is suggested rather than posting to only to

Re: __setslice__ and classes derived from list

2005-09-02 Thread Michael Hoffman
Dave Opstad wrote: > There's a workaround for this, namely to include this method: > > def __setslice__(self, i, j, seq): > self.__setitem__(slice(i, j), seq) > > That way any custom code I need to include in __setitem__ doesn't have > to be duplicated in __setslice__. But just out

Re: OpenSource documentation problems

2005-09-02 Thread Tim Peters
[Paul Rubin] > Until not that long ago, it was possible to submit sf bugs without > being logged into sf. Why did that change? To reduce tracker spam, to reduce tracker vandalism, and to make it possible to contact submitters when needed. -- http://mail.python.org/mailman/listinfo/python-list

Re: 'isa' keyword

2005-09-02 Thread Rocco Moretti
Terry Hancock wrote: > On Thursday 01 September 2005 07:28 am, Fuzzyman wrote: > >>What's the difference between this and ``isinstance`` ? > > I must confess that an "isa" operator sounds like it would > have been slightly nicer syntax than the isinstance() built-in > function. But not enough nic

__setslice__ and classes derived from list

2005-09-02 Thread Dave Opstad
According to the documentation the __setslice__ method has been deprecated since Python 2.0. However, if I'm deriving classes from the builtin list class, I've discovered I can't really ignore __setslice__. Have a look at this snippet: >>> cl

Re: The penis is way too delicate for masturbation

2005-09-02 Thread Chucky & Janica
Once upon a time - for example, 1 Sep 2005 05:32:54 -0700 - there was this guy, or something, called [EMAIL PROTECTED], and they made us all feel better by saying the following stuff: >. That penis, more to the point, is too small for masturbation. C&J -- Beware of Trojans, they're complete

Re: PyBool_FromLong

2005-09-02 Thread Michael Hoffman
Andrew MacKeith wrote: > In the C API Docs, the signature of PyBool from long seems to be incorrect. > > int PyBool_FromLong(long v) > Returns Py_True or Py_False depending on the truth value of v. New > in version 2.3. > > The description would suggest: > > PyObject* PyBool_FromLong(long v

Re: anaconda.real in RH7.1

2005-09-02 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > If I know the the name of the module > (for example it starts with sys.zz) I use: > http://www.python.org/doc/2.4.1/modindex.html > > If I know what I want but not the name I use: > http://www.python.org/doc/2.4.1/lib/lib.html I have a Firefox Quick Search installed wi

Re: Proposal: add sys to __builtins__

2005-09-02 Thread Michael Hoffman
tiissa wrote: > A developper should not be too lazy to add one small line in a complete > script/module. To the contrary, I agree with Larry Wall that laziness is one of the cardinal virtues of a programmer. Although my personal desire to be lazy is not at issue here--I always start new scripts

PyBool_FromLong

2005-09-02 Thread Andrew MacKeith
In the C API Docs, the signature of PyBool from long seems to be incorrect. int PyBool_FromLong(long v) Returns Py_True or Py_False depending on the truth value of v. New in version 2.3. The description would suggest: PyObject* PyBool_FromLong(long v) -- http://mail.python.org/mailman/li

Re: Well, Python is hard to learn...

2005-09-02 Thread Magnus Lycka
wen wrote: > due to the work reason, i have to learn python since last month. i have > spent 1 week on learning python tutorial and felt good. but i still don't > understand most part of sourcecode of PYMOL(http://pymol.sourceforge.net/) > as before. Maybe you (or someone else) is making a mistake

Re: anaconda.real in RH7.1

2005-09-02 Thread pruebauno
Allan Adler wrote: > I'm using the book, "Programming Python", by Mark Lutz, as a reference. No offence to Mark Lutz or O'Reilly but I consider "Programming Python" one of the worst books I have read (in my case an old first edition). It overwhelms the beginning programmer ("Learning Python" is pr

  1   2   >