Re: Chrooted Python problem

2004-12-05 Thread John
        - Original Message - From: John To: [EMAIL PROTECTED] Sent: Sunday, December 05, 2004 9:10 PM Subject: Chrooted Python problem Hello to all   I lately installed the python 2.3 and mod_python 2.7.10   My apache runs in a chrooted enviroment so

convert string to raw string?

2004-12-05 Thread Phd
Hi, I'm writing a regex related program that lets the user supplies the regex definition. Is there an easy way to convert a string into a raw string? Cheers -- http://mail.python.org/mailman/listinfo/python-list

not able to link ucdsnmp and snmpy

2004-12-05 Thread muttu
hi there i am trying to build snmpy over ucdsnmp and i am facing the problem in linking of ucdsnmp and snmpy *.so files. i am sending the steps what i have done till now i build the ucdsnmp first in the following order a) ./configure b) make c) make install after i did all these l

The python2.4 IDLE can't be lanuched.

2004-12-05 Thread AnkyHe
I downloaded the python 2.4 final from the offical website and installed it on the WindowsXP+SP2 (Chinese version). There was not any problem in this process, but the IDLE can't be lanuched without any warnning. Is there anybody else encount this problem and how to resolve it? Thanks! --

Re: Mean, median, and mode

2004-12-05 Thread Sean McIlroy
>>> mean = lambda x: sum(x)/len(x) >>> median = lambda x: (max(x)-min(x))/2 >>> mode = lambda x: max([(x.count(y),y) for y in x])[1] "Robert Brewer" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > (now that we have a meaningful subject line) > > Alfred Canoy wrote: > > >> I'm

Policy Violation

2004-12-05 Thread SMTP-Scan_email1
The following message sent by this account has violated system policy: From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon, 06 Dec 2004 09:31:06 +0200 Subject: information about you? The following violations were detected: --- Scan information follows --- Virus Name: [EMAIL PROTECTED] File

Ptyon 2.3.5 probably coming in January; get your bugs/patches reported!

2004-12-05 Thread Brett C.
Anthony Baxter, our ever-diligent release manager, mentioned this past week that Python 2.3.5 will most likely come to fruition some time in January (this is not guaranteed date). This means that in order to have enough time to proper evaluate new patches and bugs they must be reported **now**!

[BUG] IMO, but no opinions? Uncle Tim? was: int(float(sys.maxint)) buglet ?

2004-12-05 Thread Bengt Richter
Peculiar boundary cases: >>> 2.0**31-1.0 2147483647.0 >>> int(2147483647.0) 2147483647L >>> int(2147483647L ) 2147483647 >>> >>> -2.0**31 -2147483648.0 >>> int(-2147483648.0) -2147483648L >>> int(-2147483648L ) -2147483648 some kind of one-off error? I.e., just inside extremes works:

Re: Writing class factories with the Python/C API?

2004-12-05 Thread Craig Ringer
On Sun, 2004-12-05 at 21:41, Fredrik Lundh wrote: > > So, before I throw myself too deeply into this task, does this sound > > like something that's vaguely practical? All I'll really need to do is > > add a bunch of methods on the generated subclasses, so I'm hoping so... > > Lib/exceptions.c co

Re: Time for : comp.lang.python.newbies ??

2004-12-05 Thread Doug Holton
gmduncan wrote: Maybe a time for a new discussion group along that suggested by the Subject line ? http://mail.python.org/mailman/listinfo/tutor Or is their increasing presence here a price we must pay for their belated recognition of this wonderful language ? Don't forget the price we pay for not

Re: assymetry between a == b and a.__eq__(b)

2004-12-05 Thread Mel Wilson
In article <[EMAIL PROTECTED]>, Peter Otten <[EMAIL PROTECTED]> wrote: >Tim Peters wrote: > >> See the Python (language, not library) reference manual, section 3.3.8 >> ("Coercion rules"), bullet point starting with: >> >> Exception to the previous item: if the left operand is an >> instanc

BayPIGgies: December 9, 7:30pm

2004-12-05 Thread Aahz
The next meeting of BayPIGgies will be Thurs, Dec 9 at 7:30pm. Stephen McInerney and Terry Carroll lead a discussion on how to make your employer open-source-friendly: - how to get your work published - how to package your work for distribution - how to negotiate open-source clauses in a contra

Re: Power with modulu

2004-12-05 Thread Bengt Richter
On Sun, 05 Dec 2004 12:59:40 +0200, Roie Kerstein <[EMAIL PROTECTED]> wrote: >Hello! > >I want to compute a**b%c for very long numbers. >Computing a**b and then applying modulu is not practical, since it takes >ages. >There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), >and i

Time for : comp.lang.python.newbies ??

2004-12-05 Thread gmduncan
Am I correct in detecting a greater presence of Newbies in this "Pierian Spring" aka c.l.p. ?? Seems there's more than the usual bunch of pleas for help esp. from the Newbie Windoze fraternity. And it seems the Uber-Gurus (You Know Who You ARE) have retreated a bit - most are in the NH so it can't

Re: Seeking Python + Subversion hosting.

2004-12-05 Thread Doug Holton
Tom Locke wrote: Hi, Anyone know of a good hosting company that offers both server-side Python and a subversion repository? With user-mode linux hosting you can have your own virtual root system with which you can run whatever python stuff you want as well as subversion or other server processes

Re: Python-Help ( Mean,Median & Mode)

2004-12-05 Thread Dan Bishop
"Alfred Canoy" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Hello, > > I revised my source code. It was doing great but I'm having problem listing > all the numbers that I'd input. How can I input all the numbers that I > selected? The source code and the output below: > >

python2.4 os.environ BUG

2004-12-05 Thread mahongquan
when i install moinmoin in python 2.4,windows server2000, I found it has a bug,cgiHttpServer.py set environ,but the cgi python script can not get the environ variant,such as environ['script_name'],so moin donot display correct web page. -- http://mail.python.org/mailman/listinfo/python-list

Seeking Python + Subversion hosting.

2004-12-05 Thread Tom Locke
Hi, Anyone know of a good hosting company that offers both server-side Python and a subversion repository? I know of one: www.textdrive.com - they're a bit pricey, but I s'pose you gets what you pays for - they look good. Just FYI - right now I'm with sapphiresoft.co.uk. They're cheap and in my

Re: PajamaScript

2004-12-05 Thread Roger Binns
"Jerome Chan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I wrote something called PajamaScript. Basically, it parses a text > file and looks for tags. Then it calls python to handle the > scripting. Why learn another language when you already know Python? Why write another temp

exec and global puzzle

2004-12-05 Thread Andr? Roberge
I have the following two files: #--testexec.py-- def exec_code(co): try: exec co except: print "error" #-- test.py-- import thread import testexec import time code = "def a():\n print 'a'\n\n" +\ "def c():\n a()\n\nc()" code2 = "def a():\n print 'a'\n\n" +\

Re: [Python-Help] Programming help

2004-12-05 Thread Abe Mathews
I guess I don't understand what "freq" is doing. However, you could do something like: num_list = [] while len(num_list) < count: number = input("Enter a number:") num_list.append(number) print num_list That may give you what you're looking for to print the list of input numbers. Abe

help asap

2004-12-05 Thread the_proud_family
HELP ME PLEASE!! my email is [EMAIL PROTECTED] I can't get the ball to go up right side and then I need it to turn around and keep turning until velocity=0 I have been at it for the past 2 weeks now i give up and call for help. Please if anyone can gide me through i will be so grateful!! I hav

Programming help

2004-12-05 Thread Alfred Canoy
Hello,   I'm stuck in the end of my source code. I'm trying to print all the numbers. How can I print all the list of numbers that I selected?      Source code:# compute the Mean, Median & Mode of a list of numbers:sum = 0.0print 'This program will take several numbers then average them'cou

Re: [Python-Help] Programming help

2004-12-05 Thread Alfred Canoy
Please help me out:(.. I've been trying to figure this out for 2 days now.. I don't know what to use to print all the list of numbers. I hve know idea how should I do this. I tried a lot of trial & error for the the def, dict, .list( ). have no luck. I just need to find this out then I'm good to

Re: PajamaScript

2004-12-05 Thread Eric Pederson
Jerome (aka evil tofu) advised: > I wrote something called PajamaScript. Basically, it parses a text > file and looks for tags. Then it calls python to handle the > scripting. Why learn another language when you already know Python? > > > > This is fun! > > > The Date is . > The Time is . >

Re: How is Python designed?

2004-12-05 Thread Limin Fu
> I'm > > not that type who is afraid of negative opinions > :) In fact, I was trying to say it in joking way. Unfortunately, it is not obvious due to my poor english! Limin __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn mor

Re: How is Python designed?

2004-12-05 Thread Limin Fu
Hi, > Ok, thats clearer. This whole thing sounds familiar > - the technique you > describe seems to resemble continuation passing > style. For a brief > discussion read here: > > http://www.ps.uni-sb.de/~duchier/python/continuations.html > > Python has a continuation-based interpreter > implemen

Re: Help With Hiring Python Developers

2004-12-05 Thread Paul Rubin
[EMAIL PROTECTED] (Michael Fuhr) writes: > Indeed. An acquaintance of mine advocates writing code that only > skilled programmers can maintain (he favors a language that shall > remain nameless but that has been known to resemble modem noise or > cartoon swearing). TECO? Some of the best program

Re: How is Python designed?

2004-12-05 Thread Limin Fu
Well, you are the first who really want to join to the development of Yuan, I'm quite glad. We can further discuss in detail outside of this python mailing list, since it is not the place for such discussion. Here I just mention a few things here, maybe I can also get some advices from some experie

Re: pickle and py2exe

2004-12-05 Thread Justin Straube
On 3 Dec 2004 01:46:38 -0800, johan@ (Johan Lindberg) wrote: Thanks Johan, >I'm assuming that your library.zip now has several encoding-files in >it? And more specifically that you have a file called >"string_escape.pyc" in path "encodings". Right? I had found a stupid mistake in my setup.py. I

Re: Help With Hiring Python Developers

2004-12-05 Thread Michael Fuhr
Ian Bicking <[EMAIL PROTECTED]> writes: > ...that it's easy to learn and maintain means that there's less risk > in using a highly skilled, highly productive programmer; in other > languages you risk being left with a program that only another > highly skilled programmer can maintain. Indeed. An

PajamaScript

2004-12-05 Thread Jerome Chan
I wrote something called PajamaScript. Basically, it parses a text file and looks for tags. Then it calls python to handle the scripting. Why learn another language when you already know Python? This is fun! The Date is . The Time is . PajamaScript then calls the function "zdate" in modu

Re: I need to create the table and I want to edit its content from www level.

2004-12-05 Thread Peter Hansen
Rootshell wrote: I need to create the table and I want to edit its content from www level. Here is some example: http://www.rootshell.be/~flash44 There is a table. Is there possibilty to edit the content using command? Could you show me the way how to do it? My vision is: User has its login and pa

Re: help using sockets, and OOP?

2004-12-05 Thread Peter Hansen
Dfenestr8 wrote: Basically, I'm trying to hack up an IRC bot, that joins two servers at once. I use two object instancs of the same class, both of which make connections using the socket module. Problem is, I can't seem to get both objects to connect to their constituent servers at the same time. I

Re: string slicing

2004-12-05 Thread Carlos Ribeiro
On Sun, 5 Dec 2004 17:07:47 +0100, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > a suggestion: if you really want to be productive in python, forget about > "is" for a while. good code doesn't copy stuff much, either, by the way. > python's all about objects, and things that hold references to object

VIRUS ALERT: W32/Mydoom.O@mm

2004-12-05 Thread webmaster
This is a notice from Inter-netcom Mail Server. You sent an email infected with a virus. Please take action and clean your computerReceived: (qmail 12701 invoked from network); 5 Dec 2004 21:41:05 - Received: from corporativo?16780-209.pool.etb.net.co.80.167.65.in-addr.arpa (HELO python.

Re: Linguistic challenge: name this program

2004-12-05 Thread Phil Schmidt
> A few years ago, a first implementation of "Karel the Robot" in Python > was created and called PyKarel. A second, newer implementation is > called Guido van Robot (GvR for short), and is available at > gvr.sourceforge.net. Work is currently underway by the developpers of > GvR to produce a new-a

I need to create the table and I want to edit its content from www level.

2004-12-05 Thread Rootshell
I need to create the table and I want to edit its content from www level. Here is some example: http://www.rootshell.be/~flash44 There is a table. Is there possibilty to edit the content using command? Could you show me the way how to do it? My vision is: User has its login and password. When

What's New on the Web : Today

2004-12-05 Thread etamp
What's New on the Web : Today http://www.etamp.net/ === Etamp(etamp.net) provides latest news of web sites around the globe. You can inform free of charge what is happening in your web site. To submit your releases, you must first become a

What's New on the Web : Today

2004-12-05 Thread etamp
What's New on the Web : Today http://www.etamp.net/ === Etamp(etamp.net) provides latest news of web sites around the globe. You can inform free of charge what is happening in your web site. To submit your releases, you must first become a

mod_python and the interpreter, no module _apache

2004-12-05 Thread Jeff
Ok, so I'm working on a project right now that is being done in psp through apache. This is working fine, except that in every one of my modules I had to use the mod_python function of apache.import_module for its autoreload capability. Now I cannot open or run any of my classes in the interprete

Re: Help With Hiring Python Developers

2004-12-05 Thread Ian Bicking
Yet Another Mike wrote: "Ed Leafe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Allow offsite workers and you'll have all the candidates you want. Exactly. I'm 5 hours away in Rochester, NY, and might be interested And, if they are willing to go offsite, why not go to India and sa

Re: help using sockets, and OOP?

2004-12-05 Thread Dfenestr8
On Sun, 05 Dec 2004 20:17:31 +, Jp Calderone wrote: > Your problem doesn't seem to have anything to do with "OOP" (whatever > that is). Rather, you are trying to use two blocking sockets at once. > > socket.connect() and socket.recv() are both "blocking" operations by > default - the

Re: How is Python designed?

2004-12-05 Thread Diez B. Roggisch
Hi, > First, there is no abstract syntax tree generated for > the whole program, except for arithmetic > expression(even for this, it is slightly different > from what you said, I will come back to this point). > The Yuan (the name of the interpreter I designed) > interpreter first scans the sourc

Re: why no python setup.py uninstall?

2004-12-05 Thread Colin J. Williams
Peter Hansen wrote: Alia Khouri wrote: I'm guessing that this is a non-issue for most people (-; Well, you've allowed all of about 1.5 days for replies to come, and on a weekend at that. Be patient. I would also guess it's a non-issue as well, however. A quick perusal of the archives (which I leav

Re: Audio interviews of Guido or other Python advocates?

2004-12-05 Thread Jeremy Bowers
On Sun, 05 Dec 2004 21:21:50 +0100, Fredrik Lundh wrote: > Carlos Ribeiro wrote: > >> BTW, do bots have a sense of humour? > > it depends; it's not in the standard library: > import humour > Traceback (most recent call last): > etc. Considering where the name "Python" came from, I conside

Re: import fails

2004-12-05 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: >>> Definitely. However, it would be better if the exception occurred on the >>> bad assignment (e.g. __all__ = [x]) > >> it does happen on the bad assignment (i.e. from foo import *) > > Well, the traceback isn't useful. It does not tell you the line > number not even th

Re: Help With Hiring Python Developers

2004-12-05 Thread Yet Another Mike
"Ed Leafe" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Allow offsite workers and you'll have all the candidates you want. > > Exactly. I'm 5 hours away in Rochester, NY, and might be interested And, if they are willing to go offsite, why not go to India and save lots of bucks?

Re: string slicing

2004-12-05 Thread Ishwor
I didn't mean to be extremely rude. Just a little bit..~:-). sorry. On Sun, 05 Dec 2004 12:09:22 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > [snip] > > Goodness, you got right snippy with the 'intellectual property' thing. > I'm sorry if it sounded as if I had meant "I came up with this

Re: Power with modulu

2004-12-05 Thread Mitja
On Sun, 05 Dec 2004 12:59:40 +0200, Roie Kerstein <[EMAIL PROTECTED]> wrote: Hello! I want to compute a**b%c for very long numbers. Computing a**b and then applying modulu is not practical, since it takes ages. There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), and it work

Re[2]: import fails

2004-12-05 Thread Laszlo Zsolt Nagy
Hello Fredrik, Sunday, December 5, 2004, 8:31:45 PM, you wrote: > Laszlo Zsolt Nagy wrote: >> Definitely. However, it would be better if the exception occurred on the >> bad assignment (e.g. __all__ = [x]) > it does happen on the bad assignment (i.e. from foo import *) Well, the traceback isn

Re: Audio interviews of Guido or other Python advocates?

2004-12-05 Thread Fredrik Lundh
Carlos Ribeiro wrote: > BTW, do bots have a sense of humour? it depends; it's not in the standard library: >>> import humour Traceback (most recent call last): File "", line 1, in ? ImportError: No module named humour >>> import humor Traceback (most recent call last): File "", line 1, in ?

Re: string slicing

2004-12-05 Thread Josiah Carlson
Ishwor <[EMAIL PROTECTED]> wrote: > > On Sun, 05 Dec 2004 10:31:12 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > > > a suggestion: if you really want to be productive in python, forget about > > > "is" for a while. > > I know what Fredr

Re: help using sockets, and OOP?

2004-12-05 Thread Jp Calderone
On Mon, 06 Dec 2004 06:02:40 +1000, Dfenestr8 <[EMAIL PROTECTED]> wrote: >Hi. > > I realise, that there's probably something intrinsic to OOP that I don't > understand here. Or maybe it's something to do with sockets. I'm not sure. > > Basically, I'm trying to hack up an IRC bot, that joins two s

help using sockets, and OOP?

2004-12-05 Thread Dfenestr8
Hi. I realise, that there's probably something intrinsic to OOP that I don't understand here. Or maybe it's something to do with sockets. I'm not sure. Basically, I'm trying to hack up an IRC bot, that joins two servers at once. I use two object instancs of the same class, both of which make conn

Re: Please help here: python <==> COM

2004-12-05 Thread Ishwor
heheh... this was funny in your posting. :) >The following *pythong* ( so this is what a Python wearing a thong is called .. > hmmm...) code NOT work.. On Sun, 5 Dec 2004 16:18:33 +0800, mep <[EMAIL PROTECTED]> wrote: > Resolved. Thanks anyway [snip] -- cheers, Ishwor Gurung -- http://mail.

Re: import fails

2004-12-05 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: > Definitely. However, it would be better if the exception occurred on the > bad assignment (e.g. __all__ = [x]) it does happen on the bad assignment (i.e. from foo import *) -- http://mail.python.org/mailman/listinfo/python-list

Re: rexec and bastion

2004-12-05 Thread Kay Schluehr
> is google down today? > > http://www.amk.ca/python/howto/rexec/rexec.html No, I'm down today ;) Thx. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re[2]: import fails

2004-12-05 Thread Laszlo Zsolt Nagy
> [EMAIL PROTECTED]:~$ cat foo.py > x = 10 > __all__ = [x] > [EMAIL PROTECTED]:~$ cat bar.py > x = 20 > __all__ = ['x'] > [EMAIL PROTECTED]:~$ python -c "from foo import *; print x" > Traceback (most recent call last): > File "", line 1, in ? > TypeError:

Re: why no python setup.py uninstall?

2004-12-05 Thread Peter Hansen
Alia Khouri wrote: I'm guessing that this is a non-issue for most people (-; Well, you've allowed all of about 1.5 days for replies to come, and on a weekend at that. Be patient. I would also guess it's a non-issue as well, however. A quick perusal of the archives (which I leave to you) would very

Re: string slicing

2004-12-05 Thread Ishwor
On Sun, 05 Dec 2004 10:31:12 -0800, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > a suggestion: if you really want to be productive in python, forget about > > "is" for a while. I know what Fredrik means here (Thanx Frederick :) ) but IMHO if the pa

Chrooted Python problem

2004-12-05 Thread John
Hello to all   I lately installed the python 2.3 and mod_python 2.7.10   My apache runs in a chrooted enviroment so i want to chroot pyton and mod_python as well.   I have copy the    /usr/local/apache/libexec/mod_python.so -> /chroot /usr/local/apache/libexec/mod_python.so   /usr/local/lib/

Re: import fails

2004-12-05 Thread Jp Calderone
On Sun, 5 Dec 2004 19:52:57 +0100, Laszlo Zsolt Nagy <[EMAIL PROTECTED]> wrote: >Hello all, > > Can anyone explain this: > > > C:\Python\Projects\DbDesigner>python > Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license"

import fails

2004-12-05 Thread Laszlo Zsolt Nagy
Hello all, Can anyone explain this: C:\Python\Projects\DbDesigner>python Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from Db.FieldTypes import IdentifierFieldType >>> from Db.FieldTypes

Re: Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-05 Thread Dieter Maurer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes on Sat, 04 Dec 2004 00:37:43 +0100: >... > So it appears that on your system, INET_ADDRSTRLEN is not defined, > even if it is supposed to be defined on all systems, regardless > of whether they support IPv6. I have met this problem in older Solaris vers

Re: long number multiplication

2004-12-05 Thread Jeremy Bowers
On Sun, 05 Dec 2004 09:02:18 +0530, I.V. Aprameya Rao wrote: > i have been wondering, how does python store its very long integers and > perform aritmetic on it. > > i needed to implement this myself and was thinking of storing the digits > of an integer in a list. Uh, why? What possible enviro

Re: string slicing

2004-12-05 Thread Josiah Carlson
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Ishwor wrote: > > > I am trying some interactive examples here where i have come across > > inconsistencies??? :O > > obsession with implementation artifacts is a premature optimization, > and should be avoided. [snip] > a suggestion: if you rea

Re: why no python setup.py uninstall?

2004-12-05 Thread Alia Khouri
I'm guessing that this is a non-issue for most people (-; -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-Help ( Mean,Median & Mode)

2004-12-05 Thread Cousin Stanley
| I revised my source code. It was doing great | but I'm having problem listing all the numbers | that I'd input. | | How can I input all the numbers that I selected? Alfred As a method to list the numbers that have been input and avoid having to know in advance how many numbers are need

Re: string slicing

2004-12-05 Thread Fredrik Lundh
Ishwor wrote: > I am trying some interactive examples here where i have come across > inconsistencies??? :O obsession with implementation artifacts is a premature optimization, and should be avoided. > Anyway heres whats bothering me > s = 'hello' s[0] > 'h' s[:] > 'hello' m

Re: string slicing

2004-12-05 Thread Kent Johnson
Ishwor wrote: On Sun, 05 Dec 2004 09:44:13 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: This behaviour is due to the way strings are handled. In some cases strings are 'interned' which lets the interpreter keep only a single copy of a string. If you try it with a list you get a different result

RE: Linguistic challenge: name this program

2004-12-05 Thread Robert Brewer
Andre Roberge wrote: > In 1981, Richard Pattis wrote a delightful little book titled "Karel > the Robot, a Gentle Introduction to the Art of Programming." Pattis's > "Karel the Robot" was named after the author Karel Capek, who > popularized the word "robot" in his play "Rossum's Universal Robots".

Re: some pointers for a newbie

2004-12-05 Thread Abe Mathews
On Sun, 05 Dec 2004 02:26:48 +, Jon Mercer <[EMAIL PROTECTED]> wrote: > On the matter of IDEs, I've found that Eclipse (http://www.eclipse.org) > is amazing, although I suspect that it takes a bit of learning to get > used to it and I'm nowhere near making full use of all it can do. It has > a

Re: string slicing

2004-12-05 Thread Ishwor
On Sun, 05 Dec 2004 09:44:13 -0500, Kent Johnson <[EMAIL PROTECTED]> wrote: [snip] > > This behaviour is due to the way strings are handled. In some cases strings > are 'interned' which > lets the interpreter keep only a single copy of a string. If you try it with > a list you get a > differen

Re: string slicing

2004-12-05 Thread Kent Johnson
Ishwor wrote: s = 'hello' m = s[:] m is s True I discussed the *is* operator with some of the pythoners before as well but it is somewhat different than what i intended it to do. The LP2E by Mark & David says - " m gets a *full top-level copy* of a sequence object- an object with the same value bu

string slicing

2004-12-05 Thread Ishwor
Hello all , I am trying some interactive examples here where i have come across inconsistencies??? :O Anyway heres whats bothering me >>> s = 'hello' >>> s[0] 'h' >>> s[:] 'hello' >>> m = s[:] >>> m 'hello' >>> m is s True I discussed the *is* operator with some of the pythoners before as well

Writing class factories with the Python/C API?

2004-12-05 Thread Craig Ringer
Hi folks I'm currently faced with the need to write a class factory in C using the Python/C API. It's purpose is to automatically wrap C++ objects at run-time and provide a Python object. Thanks to the magic of Qt's meta-object system, getting the information required to wrap the C++ object is the

rexec and bastion

2004-12-05 Thread Kay Schluehr
Cited from Python-doc ( v.2.3 ) [Warning: In Python 2.3 these modules have been disabled due to various known and not readily fixable security holes. The modules are still documented here to help in reading old code that uses the rexec and Bastion modules.] My question about rexec and bastion ma

Linguistic challenge: name this program

2004-12-05 Thread Andr? Roberge
In 1981, Richard Pattis wrote a delightful little book titled "Karel the Robot, a Gentle Introduction to the Art of Programming." Pattis's "Karel the Robot" was named after the author Karel Capek, who popularized the word "robot" in his play "Rossum's Universal Robots". Pattis's approach was to int

Re: rexec and bastion

2004-12-05 Thread Fredrik Lundh
Kay Schluehr wrote: > Cited from Python-doc ( v.2.3 ) > > [Warning: In Python 2.3 these modules have been disabled due to > various known and not readily fixable security holes. The modules are > still documented here to help in reading old code that uses the rexec > and Bastion modules.] > > My

Re: Writing class factories with the Python/C API?

2004-12-05 Thread Fredrik Lundh
Craig Ringer wrote: > I'm currently faced with the need to write a class factory in C using > the Python/C API. It's purpose is to automatically wrap C++ objects at > run-time and provide a Python object. Thanks to the magic of Qt's > meta-object system, getting the information required to wrap th

Re: Python-Help ( Mean,Median & Mode)

2004-12-05 Thread Alfred Canoy
Hello, I revised my source code. It was doing great but I'm having problem listing all the numbers that I'd input. How can I input all the numbers that I selected? The source code and the output below: Source code: # compute the Mean, Median & Mode of a lis

Power with modulu

2004-12-05 Thread Roie Kerstein
Hello! I want to compute a**b%c for very long numbers. Computing a**b and then applying modulu is not practical, since it takes ages. There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), and it works well. My question is: How can I write it is a form of an expression, like a**

Re: Power with modulu

2004-12-05 Thread Fredrik Lundh
Roie Kerstein wrote: > I want to compute a**b%c for very long numbers. > Computing a**b and then applying modulu is not practical, since it takes > ages. > There is a built-in optional parameter to the long.__pow__(a,b[,modulu]), > and it works well. > My question is: How can I write it is a form

Re: [Python-Help] (fwd)

2004-12-05 Thread Steven Bethard
Craig Ringer wrote: It looks to me like you'd be better off reading each input number into a list. You may also find it useful to write a generator function to read your values in: >>> def read_numbers(): ... while True: ... number = int(raw_input('Enter a number: ')) ... if n

Re: [Python-Help] (fwd)

2004-12-05 Thread Steven Bethard
Craig Ringer wrote: As you can see, it's much easier to work with data in lists. Some of the other methods, like list.sort() and list "slices" will also be useful to you, but I'll let you figure out the details ;-) . Something else that might be useful to you if you're using Python 2.4: >>> lst =

Re: [Python-Help] (fwd)

2004-12-05 Thread Bob Gailer
At 10:07 PM 12/4/2004, Alfred Canoy wrote: Hello, I'm just new to programming and would like to ask for help.. Build a module that contains three functions that do the following: a.. Compute the average of a list of numbers b.. Finds the statistical median value of a list of numbers The m

Re: [Python-Help] (fwd)

2004-12-05 Thread Craig Ringer
On Sun, 2004-12-05 at 13:07, Alfred Canoy wrote: > a.. Compute the average of a list of numbers > b.. Finds the statistical median value of a list of numbers > c.. Finds the mode of a list of numbers > > count = 0 > sum = 0 > number = 1 > > print 'Enter 0 to exit the loop' > w

Re: [Python-Dev] PEP: __source__ proposal

2004-12-05 Thread bearophile
(I answer here because I'm still not at easy on python-dev) It looks like an interesting feature. I think most LOGOs allows something similar (or better, with a cleaner syntax). The shells of many versions of this language keep a "pool" of functions defined with "to" into a kind of database, so you

Re: HTTP response code

2004-12-05 Thread Fredrik Lundh
Jonas Galvez wrote: > Hi list, here's a question about urllib. Is it possible to simply > retrieve the HTTP responde code for a given URL? I don't want to > download the body of the HTTP message. I simply want to check the > response code, like, if it is 200, 301 etc. Something like: > > if urllib

Re: Book Recommendations

2004-12-05 Thread Fredrik Lundh
Nathan Weston wrote: > I'm new to Python and am looking for a book to get me up to speed > quickly. I'm an experienced programmer and very proficient with Ruby, > so Python is coming easily to me and I don't need a gentle > introduction -- I just need a quick way to get familiar with common > Pyth

RE: Mean, median, and mode

2004-12-05 Thread Robert Brewer
(now that we have a meaningful subject line) Alfred Canoy wrote: > >> I'm just new to programming and would like to ask for help.. > >> > >> Build a module that contains three functions that do the following: > >> > >> a.. Compute the average of a list of numbers > >> b.. Finds the st

Re: Please help here: python <==> COM

2004-12-05 Thread mep
Resolved. Thanks anyway -- Best Regards, Wang Kebo http://www.huihoo.org/~mep "mep" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi,all > I'm scripting flashget (A download management tool, > http://www.amazesoft.com/) using > python win32 extension, opening a downloading

Re: Module list generation

2004-12-05 Thread Doug Kearns
In article <[EMAIL PROTECTED]>, Scott David Daniels wrote: > Doug Kearns wrote: >> Is this the best/simplest way to generate a module list? >> >> python -c 'from pydoc import help; help("modules")' >> >> Thanks, >> Doug > I am not sure if this is what you want, but how about: I'm updating the zs

Re: Importing class from file in package

2004-12-05 Thread Joe Raul
from second import class -- == best regards == "Florian Lindner" <[EMAIL PROTECTED]> news:[EMAIL PROTECTED] > Hello, > I've two files in my package. > In the first file I want to inport a class which is declared in the > second file. How can do that

Re: help using sockets, and OOP?

2004-12-05 Thread Jp Calderone
On Mon, 06 Dec 2004 07:45:34 +1000, Dfenestr8 <[EMAIL PROTECTED]> wrote: >On Sun, 05 Dec 2004 20:17:31 +, Jp Calderone wrote: > > > Your problem doesn't seem to have anything to do with "OOP" (whatever > > that is). Rather, you are trying to use two blocking sockets at once. > > > > so