Python/ASP local characters and 500 server error

2005-11-15 Thread Martin
Using Python / ASP on a IIS server with Mark Hammond's win32 extensions, i have the following problem. All occurences of local characters (fx. danish æøå) in comments or in strings result in a HTTP/1.1 500 Server Error. Is there a solution to this problem? /Martin -- http://mail.python.org/mail

Re: Default method arguments

2005-11-15 Thread Bengt Richter
On 15 Nov 2005 11:02:38 -0800, "Martin Miller" <[EMAIL PROTECTED]> wrote: >Alex Martelli wrote, in part: >> If it's crucial to you to have some default argument value evaluated at >> time X, then, by Python's simple rules, you know that you must arrange >> for the 'def' statement itself to execute

PyExcelerator - mishandling of formulas?

2005-11-15 Thread Marco Aschwanden
Hi, Yesterday I placed a bug report on PyExcelerators-Sourceforge-page... but I am not so sure anymore, whether this is really a bug - I could imagine that I missed something, but I don't see what. Please confirm that my bug is due to mishandling and I will gladly retreat my bug report. In

Re: So what are __slots__ and when should I use them?

2005-11-15 Thread MrJean1
Here is an example of the difference between a class with __slots__ and __dict__ /Jean Brouwers -- http://mail.python.org/mailman/listinfo/python-list

Re: how to bypass firewall

2005-11-15 Thread Gregory Bond
Parth wrote: > I need some help regrading byassing firewalls.My college has internet > aces but it prevents us from dowloading music(*.mp3,*.mid,etc.)from the > net. Hello everyone, I need help getting my college degree. I downloaded a hack to bypass the college internet firewall and the colleg

pySonic - writing a sample to a file

2005-11-15 Thread netspeed.com.au
Hi all: Hopefully a simple question. I have been putting together an application using pySonic. I find the documentaion fine with plenty of examples but I cant see how to save a sample (or any recorded audio) to a file. Am I missing something obvious? Thanks, Andy -- http://mail.python.or

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread Neal Norwitz
Alex Martelli wrote: > matt <[EMAIL PROTECTED]> wrote: > > > Perhaps you could extend Valgrind (http://www.valgrind.org) so it works > > with python C extensions? (x86 only) > > Alas, if it's x86 only I won't even look into the task (which does sound > quite daunting as the way to solve the appare

Do you have PERL and SQL programming experience?

2005-11-15 Thread Frank Odia
If the answer is yes I want to talk to you. My name is Frank Odia and I am a recruiter with High Tech Staffing, an IT placement firm in Portland. I came across your name while searching for PERL programmer with relational database background (Postgress or Oracle) for a client here in Portland. Hone

Re: Is there any Iterator type example?

2005-11-15 Thread Thomas Moore
Hi: Nice example too! But what I really want to know is how to use __iter()__ and next() in a class with an example. >> How about this one: >>.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-15 Thread Nathan Pinno
It worked, but unfornately I can't use this line as it brings up errors: from Tkinter (or pygame) import * Anyway around this little bug? -- For great sites go to: http://www.the-web-surfers-store.com MSN Messenger: [EMAIL PROTECTED],com Yahoo! Messenger: spam_swatter31 ICQ: 199020705 AIM: f3mi

RE: Can anyone tell me if pygame and Tkinter can work together?

2005-11-15 Thread Nathan Pinno
Sounds good, I'll give it a try and see what happens, and report back about my results. Nathan Pinno, Owner/operator of The Web Surfer's Store. http://www.the-web-surfers-store.com/ MSN Messenger: [EMAIL PROTECTED] Yahoo! Messenger: spam_swatter31 AIM: f3mighty ICQ: 199020705 -Original Me

Re: Newb ?

2005-11-15 Thread Mike Meyer
"Chad Everett" <[EMAIL PROTECTED]> writes: > print "\n\nWelcome to the Backwards Message Display." > print > message = raw_input("\nPlease Enter a Message.") Since you said it wasn't a school assignment, and I'm a trusting soul, the next line could be: print message[::-1]

Re: Newb ?

2005-11-15 Thread Scott David Daniels
Chad Everett wrote: > "Paul Watson" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Chad Everett wrote: >>>high = len(message) >>>low = -len(message) >>>print >>>print message[high:low] >>>print >>>print raw_input("Please Press Enter to Exit") >> >>Are you sure that this is not

Re: So what are __slots__ and when should I use them?

2005-11-15 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > I see some programs declaring the names of class variables in > "__slots__". I've looked this up and the docs say something about old > and new style classes, whatever that means. Can someone give me a > simple, brief explanation of what __slots__ are and when I should

Re: Newb ?

2005-11-15 Thread Ben Finney
Chad Everett <[EMAIL PROTECTED]> wrote: > I searched the group for the term backwards but I did not get any > results. You might have better results searching for 'reverse'. -- \ "For certain people, after fifty, litigation takes the place of | `\

Re: Newb ?

2005-11-15 Thread Chad Everett
"Paul Watson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Chad Everett wrote: >> Hello all, >> >> Have a problem here with a challenge from a book I am reading. >> Any help is much appreciated. >> >> I am trying to run a program that asks the user for a statement and then >> pr

Tkinter: scrollbar in grid-managed frame

2005-11-15 Thread anx
I've got a grid-managed frame, containing a column of Labels, and a corresponding column of Entry widgets. I'd like to be able to display dozens, or even hundreds of rows, and use a vertical scrollbar to scroll through them in the frame. So far i can get a scrollbar to display, but it won't scroll

Re: Newb ?

2005-11-15 Thread Paul Watson
Chad Everett wrote: > Hello all, > > Have a problem here with a challenge from a book I am reading. > Any help is much appreciated. > > I am trying to run a program that asks the user for a statement and then > prints it out backwards. > this is what I have. > It does not print anything out. I

Newb ?

2005-11-15 Thread Chad Everett
Hello all, Have a problem here with a challenge from a book I am reading. Any help is much appreciated. I am trying to run a program that asks the user for a statement and then prints it out backwards. this is what I have. It does not print anything out. I assume that I have something out of wh

Re: Function - Empty list as default parameter - not acting local?

2005-11-15 Thread Micah Elliott
On Nov 15, Gregory Piñero wrote: >Hey guys, could anyone explain this behavior to me. It doesn't >seem right :-( >def testfunc(parm1,parm2={}): >print 'parm2',parm2 >parm2['key1']=5 >>>testfunc('greg') >parm2 {} >>>testfunc('greg') >parm2 {'key1': 5} ht

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-15 Thread jepler
On Tue, Nov 15, 2005 at 06:33:40PM -0700, Nathan Pinno wrote: > Thanks. I was going to use TKInter to pop up a message box, then use pygame > to run the game and display the score on the playing surface. Is this still > possible (I'm using Python 2.4.1 and Pygame 1.7.0 on WinXP with Service Pack >

Function - Empty list as default parameter - not acting local?

2005-11-15 Thread Gregory Piñero
Hey guys, could anyone explain this behavior to me.  It doesn't seem right :-( def testfunc(parm1,parm2={}):     print 'parm2',parm2     parm2['key1']=5 >>testfunc('greg') parm2 {} >>testfunc('greg') parm2 {'key1': 5} def testfunc2(parm1,parm2=[]):     print 'parm2',parm2     parm2.append(5) >>

So what are __slots__ and when should I use them?

2005-11-15 Thread dan . j . weber
I see some programs declaring the names of class variables in "__slots__". I've looked this up and the docs say something about old and new style classes, whatever that means. Can someone give me a simple, brief explanation of what __slots__ are and when I should use them? Thanks. -- http://mail.

Re: is parameter an iterable?

2005-11-15 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > try: > for item in obj: > do_stuff(item) > except TypeError, msg: > if msg == "iteration over non-sequence": > handle_non_iterator() > else: > # re-raise the exception >

Re: Default method arguments

2005-11-15 Thread Bengt Richter
On Tue, 15 Nov 2005 23:51:18 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: > >>> Another solution to this is the use of a 'marker' object and identity test: >>> >>> _marker = [] >>> class A(object): >>> def __init__(self, n): >>> self.data =n >>> def f(s

Re: is parameter an iterable?

2005-11-15 Thread Dan Sommers
On Wed, 16 Nov 2005 13:12:38 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > try: > for item in obj: > do_stuff(item) > except TypeError, msg: > if msg == "iteration over non-sequence": > handle_non_iterator() > else: > # re-raise the exception >

Re: is parameter an iterable?

2005-11-15 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: > Maybe this helps: Unfortunately, it doesn't. If you read the sample code the original poster first gave, you will see that Py's example is virtually the same as yours: [original code] def foo(inputVal): if isinstance(inputVal, (list, tuple)): for val in

Re: how to bypass firewall

2005-11-15 Thread Lars Kellogg-Stedman
> I need some help regrading byassing firewalls. You'll need to go to comp.lang.perl for help with that problem. -- Lars -- Lars Kellogg-Stedman <[EMAIL PROTECTED]> This email address will expire on 2005-11-22. -- http://mail.python.org/mailman/listinfo/python-list

Re: is parameter an iterable?

2005-11-15 Thread Steven D'Aprano
Roy Smith wrote: > You can't tell the difference between: > > try: > for i in 5: > print i + 1 > except TypeError: > print "non-iterable" > > and > > try: > for i in ["one", "two", "three"]: > print i + 1 > except TypeError: > print "can't add string and integer" try: for

how to bypass firewall

2005-11-15 Thread Parth
Hello everyone, I need some help regrading byassing firewalls.My college has internet aces but it prevents us from dowloading music(*.mp3,*.mid,etc.)from the net.I use a win xp sp2 and browse using ie 6. Is there any way how i can dowload music on my computer using this connection. (We have a proxy

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 16)

2005-11-15 Thread Cameron Laird
QOTW: "You can tell everything is well in the world of dynamic languages when someone posts a question with nuclear flame war potential like 'python vs. ruby' and after a while people go off singing hymns about the beauty of Scheme..." - vdrab "ctypes completely rocks." - Grant Edwards Mich

Re: Python obfuscation

2005-11-15 Thread Steven D'Aprano
Bruno Desthuilliers wrote: > The Eternal Squire a écrit : > >> Without copyright, how could one possibly earn a living writing a >> novel? > > > Without copyright, how could one possibly earn a living writing programs?-) I'm not sure if that is meant to be a rhetorical question or not, but s

Re: Data Transmission Crash Course Required

2005-11-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hello, everyone! > > I am a Python enthusiast, also trying to learn basic Linux skills in > order to rid myself of the Windows plague (off-topic rant). I was > considering doing a Battleships game that runs in text mode and has the > capacity to connect players via netwo

Re: It looks like my mails to @python.org are all blocked

2005-11-15 Thread skip
Thomas> What's wrong with this? The python-anounce tells me that my Thomas> message has a suspicious header? Nothing wrong. Just flagged by the spam filters as undecidable. A human moderator will review it. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: compare list

2005-11-15 Thread Bengt Richter
On 15 Nov 2005 04:51:05 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >Simon Brunning wrote: >> On 15/11/05, Ben Bush <[EMAIL PROTECTED]> wrote: >> > I found I named the following python file as sets.py, which brought the >> > problem (is that right?). i changed it to other name and it w

Re: generate HTML

2005-11-15 Thread s99999999s2003
thanks i will check out the example you have given.actually my html output is a bit dynamic in the sense that i may have different number of rows depending on some inputs. so i am putting everything into a list and using 'extend' to append to that list for every dynamically generated rows using for

RE: Can anyone tell me if pygame and Tkinter can work together?

2005-11-15 Thread Nathan Pinno
Thanks. I was going to use TKInter to pop up a message box, then use pygame to run the game and display the score on the playing surface. Is this still possible (I'm using Python 2.4.1 and Pygame 1.7.0 on WinXP with Service Pack 2)? Nathan Pinno Nathan Pinno, Owner/operator of The Web Surfer's

Re: HTTP Keep-Alive with urllib2

2005-11-15 Thread Steve Holden
David Rasmussen wrote: > Someone once asked about this an got no answer: > > http://groups.google.dk/group/comp.lang.python/browse_frm/thread/c3cc0b8d7e9cbc2/ff11efce3b1776cf?lnk=st&q=python+http+%22keep+alive%22&rnum=84&hl=da#ff11efce3b1776cf > > Maybe I am luckier :) > > Does anyone know how t

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-15 Thread jepler
It's likely to be a challenge; each one has its own "event loop", and the exact pitfalls of trying to use both at the same time probably depend on the operating system too. For instance, on X, Tk and SDL probably both expect full control of the handlers registered with XSetErrorHandler and XSetIOE

Re: Sending an event from a python COM server to a VB COM client

2005-11-15 Thread Stephen Prinster
Gary Kshepitzki wrote: > Hello > I am trying to send an event from a Python COM server to a VB (or VB.NET) > COM client. > I am a newbie both in VB and in python. > Can anyone give me a simple (but complete) code example both of the Python > server side and the VB client side for raising a single

Re: Python obfuscation

2005-11-15 Thread Mike Meyer
Erik Max Francis <[EMAIL PROTECTED]> writes: > Chris Mellon wrote: >> I don't know about you, but I own the copyright to almost nothing that >> I have written and been paid for, and further, none of has it's >> copyright exploited to make money for the entity that does own the >> copyright. > But t

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-15 Thread Stephen Prinster
Roger Erens wrote: > > I'm asking because of all the AJAX hype going on. I'd like rather not > delve too deep into JavaScript and use Python instead. > > Any insights to be shared? > > Cheers, > Roger In addition to the others already mentioned, you might want to check out Nevow. Quoting from

ANN: ActivePython 2.4.2 is now available

2005-11-15 Thread TrentM
I'm happy to announce that ActivePython 2.4.2 is now available for free download from: http://www.ActiveState.com/Products/ActivePython/ This release updates ActivePython to version 2.4.2, that was finalized a few weeks ago. My apologies for the tardiness. If you'll believe it, I've been busy impl

Reinvent no more forever

2005-11-15 Thread Ben Finney
Howdy all, On dirtSimple.org[0], PJE wrote: "Why is Python "blessed" with so much reinvention? Because it's often cheaper to rewrite than to reuse. Python code is easy to write, but hard to depend on. You pretty much have to: 1. limit yourself to platforms with a suitable pac

Re: Parse file into array

2005-11-15 Thread Bengt Richter
On 14 Nov 2005 13:48:45 -0800, "amfr" <[EMAIL PROTECTED]> wrote: >I was wondering how i could parse the contents of a file into an array. > the file would look something like this: > >gif:image/gif >html:text/html >jpg:image/jpeg >... > >As you can see, it contains the mime type and the file exten

Can anyone tell me if pygame and Tkinter can work together?

2005-11-15 Thread Nathan Pinno
Hi, Can anyone tell me if pygame and Tkinter can work together in the same application? I thought I'd better ask before trying it, since both use widgets. Thanks, Nathan Pinno -- For great sites go to: http://www.the-web-surfers-store.com MSN Messenger: [EMAIL PROTECTED],com Yahoo! Messenger:

Re: Python obfuscation

2005-11-15 Thread Erik Max Francis
Chris Mellon wrote: > I don't know about you, but I own the copyright to almost nothing that > I have written and been paid for, and further, none of has it's > copyright exploited to make money for the entity that does own the > copyright. But they wouldn't have paid you if you didn't (implicitl

Re: is parameter an iterable?

2005-11-15 Thread Alex Martelli
Roy Smith <[EMAIL PROTECTED]> wrote: ... > TypeError: iteration over non-sequence > > I was kind of hoping for a more specific exception than TypeError. > You can't tell the difference between: > > try: > for i in 5: > print i + 1 > except TypeError: > print "non-iterable" > > and >

Re: Python obfuscation

2005-11-15 Thread Chris Mellon
On 11/15/05, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > The Eternal Squire a écrit : > > Without copyright, how could one possibly earn a living writing a > > novel? > > Without copyright, how could one possibly earn a living writing programs?-) > -- I don't know about you, but I own the cop

Re: replacing multiple instances of commas beginning at specific position

2005-11-15 Thread Bengt Richter
On Tue, 15 Nov 2005 08:26:22 GMT, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >On 14 Nov 2005 09:43:57 -0800, "striker" <[EMAIL PROTECTED]> declaimed >the following in comp.lang.python: > >> >> What would be the best approach to replace all instances of multiple >> commas with just one comma, ex

Re: Python obfuscation

2005-11-15 Thread The Eternal Squire
My point exactly. A good application of moderate to large size (100K lines of code) is about as large as a single person can write without automation, hence it is of an effort comparable in scope and creativity to a novel. -- http://mail.python.org/mailman/listinfo/python-list

Re: Shutdown hook

2005-11-15 Thread Lawrence Oluyede
Il 2005-11-15, Ben Finney <[EMAIL PROTECTED]> ha scritto: > Steve <[EMAIL PROTECTED]> wrote: >> Does any one know if python has the ability to run a shutdown hook. > > When the Python runtime system wants to exit, it raises a SystemExit > exception. > > Catch that exception at the top level of your

Re: Python obfuscation

2005-11-15 Thread The Eternal Squire
>In my case, providing a free download of any lost executables or data upon >presentation of a legitimate license key should be adequate. Excellent compromise! The Eternal Squire -- http://mail.python.org/mailman/listinfo/python-list

Re: Shutdown hook

2005-11-15 Thread Steve
Thanks do appreciate it -- Lisp Programming - You don't know what your missing ... == Help Send Laurie to Veterinary School http://www.sendlaurietovetschool.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Shutdown hook

2005-11-15 Thread Ben Finney
Steve <[EMAIL PROTECTED]> wrote: > Does any one know if python has the ability to run a shutdown hook. When the Python runtime system wants to exit, it raises a SystemExit exception. Catch that exception at the top level of your code, and do whatever you like. (It might be polite to actually exit

Re: is parameter an iterable?

2005-11-15 Thread Steven D'Aprano
On Tue, 15 Nov 2005 11:26:23 -0800, py wrote: > Dan Sommers wrote: >> Just do it. If one of foo's callers passes in a non-iterable, foo will >> raise an exception, and you'll catch it during testing > > That's exactly what I don't want. I don't want an exception, instead I > want to check to se

Re: Configure failing why?

2005-11-15 Thread Samuel M. Smith
cat > foo.cpp int main(){return 0;} c++ foo.cpp ll a.out -rwxr-xr-x 1 root tsarm 12124 Nov 15 15:54 a.out ./a.out but if I gcc foo.cpp ll a.out -rw-r--r-- 1 root tsarm 12060 Nov 15 15:55 a.out but if I do it again # gcc foo.cpp ll a.out -rwxr-xr-x 1 root tsarm 12060 Nov 15 15:58 a.out On

Re: Default method arguments

2005-11-15 Thread Fredrik Lundh
Steven D'Aprano wrote: >> Another solution to this is the use of a 'marker' object and identity test: >> >> _marker = [] >> class A(object): >> def __init__(self, n): >> self.data =n >> def f(self, x = _marker): >> if x is _marker: >> x = self.data >> pr

Re: Self terminate a python program

2005-11-15 Thread Ben Finney
Ernesto <[EMAIL PROTECTED]> wrote: > how do you self terminate a python program from within the code? > something similar to exit(0) in C. Inspection and control of the Python runtime system is mostly within the 'sys' module. http://docs.python.org/lib/module-sys.html> In this case, 'import

Re: is parameter an iterable?

2005-11-15 Thread Ben Finney
[EMAIL PROTECTED] wrote: > Maybe this helps: > > >>> import types > >>> def foo(inputVal): > inValType = type(inputVal) > if inValType==types.ListType or inValType==types.TupleType: And what of user-created types that are iterable? What of user-created iterable types that don't inher

Re: is parameter an iterable?

2005-11-15 Thread DonQuixoteVonLaMancha
How about hasattr("__iter__")? Regards, Karsten. -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen - terminate

2005-11-15 Thread Ernesto
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347462 Also try searching this group for "subprocess kill" -- http://mail.python.org/mailman/listinfo/python-list

Shutdown hook

2005-11-15 Thread Steve
Does any one know if python has the ability to run a shutdown hook. For example you set a method to run when the python process is shutting down, like it recieved a kill signal? Basically looking for an effect like the following java code. Runtime.getRuntime().addShutdownHook(new Thread(this));

Re: Is there any Iterator type example?

2005-11-15 Thread DonQuixoteVonLaMancha
How about this one: import os from os.path import join def py_files(dir): for root, dirs, files in os.walk(dir): for name in files: if name.lower().endswith(".py"): yield join(root,name ) if __name__=="__main__": dir= "C:\\Python23\\" for f in py_files(dir): print f

Self terminate a python program

2005-11-15 Thread Ernesto
how do you self terminate a python program from within the code? something similar to exit(0) in C. I think the problem is that I'm using subprocess and popen to launch a '.exe' file and python is "waiting" on the .exe file to finish. since it never does, the python program won't end. how can I

Re: Configure failing why?

2005-11-15 Thread Fredrik Lundh
Samuel M. Smith wrote: >I am trying to build python2.4.2 on an arm 9 running Debian 3 Sarge > configure:1842: ./a.out > ./configure: line 1: ./a.out: Permission denied > configure:1845: $? = 126 > configure:1854: error: cannot run C++ compiled programs. > If you meant to cross compile, use `--hos

Re: is parameter an iterable?

2005-11-15 Thread Steven D'Aprano
On Tue, 15 Nov 2005 14:06:45 -0500, Dan Sommers wrote: > On 15 Nov 2005 11:01:48 -0800, > "py" <[EMAIL PROTECTED]> wrote: > >> I have function which takes an argument. My code needs that argument >> to be an iterable (something i can loop over)...so I dont care if its a >> list, tuple, etc. So

Re: 3-dimensional plot in Python?

2005-11-15 Thread Robert Kern
Frithiof Andreas Jensen wrote: > "Robert Kern" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Those interfaces are long since deprecated. Please use matplotlib instead. >> >>http://matplotlib.sf.net > > "Long since" being When? > > I recently installed SciPy and it did no

Re: Default method arguments

2005-11-15 Thread Steven D'Aprano
On Tue, 15 Nov 2005 18:44:23 +0100, bruno at modulix wrote: > Another solution to this is the use of a 'marker' object and identity test: > > _marker = [] > class A(object): > def __init__(self, n): > self.data =n > def f(self, x = _marker): > if x is _marker: >

Re: Proposal for adding symbols within Python

2005-11-15 Thread Bengt Richter
On Tue, 15 Nov 2005 21:53:23 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote: [...] >It isn't always appropriate or necessary to define "constants" (and I >sometimes wish that Python would enforce assign-once names), but they can >help avoid some silly mistakes. (As I'm sure you know) you can have

Configure failing why?

2005-11-15 Thread Samuel M. Smith
I am trying to build python2.4.2 on an arm 9 running Debian 3 Sarge when I run ./configure it fails with ./configure checking MACHDEP... linux2 checking EXTRAPLATDIR... checking for --without-gcc... no checking for --with-cxx=... no checking for c++... c++ checking for C++ compiler default output

Is there any Iterator type example?

2005-11-15 Thread Thomas Moore
Hi: Is there any example about how to use Iterator type? --Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie - How do I import automatically?

2005-11-15 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I've tried as you said but it doesn't work. I'm working with Windows > XP. I right click at my computer go to Advanced, choose Environment > Variables and set PYTHONSTARTUP variable to C:\Python24\binit.py. It > looks like this > > # binit.py > from btools import * > > I

Re: is parameter an iterable?

2005-11-15 Thread lmaycotte
Maybe this helps: >>> import types >>> def foo(inputVal): inValType = type(inputVal) if inValType==types.ListType or inValType==types.TupleType: for val in inputVal: print val else: print 'Wrong input Type' >>> list = [1,2,3,4] >>> foo(list) 1 2 3 4 >>

Re: newbie - How do I import automatically?

2005-11-15 Thread bobueland
I also checked in command prompt, and there it works!, but not in IDLE. And it's in IDLE that I work all the time. Can anything be done to get it to work there? Bob -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread Alex Martelli
MrJean1 <[EMAIL PROTECTED]> wrote: > This may work on MacOS X. An initial, simple test does yield credible > values. Definitely looks promising, thanks for the pointer. > However, I am not a MacOS X expert. It is unclear which field of the > malloc_statistics_t struct to use and how malloc_zon

It looks like my mails to @python.org are all blocked

2005-11-15 Thread Thomas Moore
Hi: What's wrong with this? The python-anounce tells me that my message has a suspicious header? --Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-15 Thread Bruno Desthuilliers
The Eternal Squire a écrit : > Without copyright, how could one possibly earn a living writing a > novel? Without copyright, how could one possibly earn a living writing programs?-) -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie - How do I import automatically?

2005-11-15 Thread bobueland
I've tried as you said but it doesn't work. I'm working with Windows XP. I right click at my computer go to Advanced, choose Environment Variables and set PYTHONSTARTUP variable to C:\Python24\binit.py. It looks like this # binit.py from btools import * I've restarted the computer and started IDL

Data Transmission Crash Course Required

2005-11-15 Thread dndfan
Hello, everyone! I am a Python enthusiast, also trying to learn basic Linux skills in order to rid myself of the Windows plague (off-topic rant). I was considering doing a Battleships game that runs in text mode and has the capacity to connect players via networking. Trouble is I have minimal expe

Re: Default method arguments

2005-11-15 Thread Gregory Petrosyan
Thanks a lot, I understood the rule. Let's don't discuss this (containers etc.) anymore, or it'll be offtopic. -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance in nested classes

2005-11-15 Thread gmilas
"I'm using the Active Server Pages integration in the win32 extensions, does anyone have good/bad experiences using this interface?" What is it you are trying to do? I'm using python2.4 with win32 and IIS/python ASP and find it ok. There were at some point some session overlappings but I'm not su

Re: Default method arguments

2005-11-15 Thread Mike Meyer
"Gregory Petrosyan" <[EMAIL PROTECTED]> writes: > I'm not very familiar with Python, so please explain me why should > containers be used? > For example in one of Paul Graham's essays there's an example of > 'generator of accumulators' in Python: > > def foo(n): > s = [n] > def bar(i): >

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-15 Thread MrJean1
This may work on MacOS X. An initial, simple test does yield credible values. However, I am not a MacOS X expert. It is unclear which field of the malloc_statistics_t struct to use and how malloc_zone_statistics with zone NULL accumulates the stats for all zones. /Jean Brouwers #if _MACOSX #in

Re: newbie - How do I import automatically?

2005-11-15 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I have written some functions in a file called btools.py. I would like > to import them automatically when I start up Python shell. Today I must > do it by hand like this > from btools import * dir() > ['__builtins__', '__doc__', '__name__', 'func1', 'func2',

Re: Default method arguments

2005-11-15 Thread Gregory Petrosyan
I'm not very familiar with Python, so please explain me why should containers be used? For example in one of Paul Graham's essays there's an example of 'generator of accumulators' in Python: def foo(n): s = [n] def bar(i): s[0] += i return s[0] return bar 1) So, why

Re: Default method arguments

2005-11-15 Thread Mike Meyer
Benji York <[EMAIL PROTECTED]> writes: > I'll add my 2 cents to the mix: > > default = object() > > class A(object): > def __init__(self, n): > self.data = n > > def f(self, x=default): > if x is default: > x = self.data > print x There were a lot

Re: Default method arguments

2005-11-15 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hello everybody! > I have little problem: > > class A: > def __init__(self, n): > self.data = n > def f(self, x = ) > print x > > All I want is to make self.data the default argument for self.f(). (I > want to use 'A' class as following : St

Re: 3-dimensional plot in Python?

2005-11-15 Thread Lonnie Princehouse
Google for "MayaVi" It's overkill for what you've described (it doesn't even make 2D graphs afaik), but it could draw your function as a 3D surface. And besides, it's way cool. -- http://mail.python.org/mailman/listinfo/python-list

Python training information - now on the wiki

2005-11-15 Thread Steve
I've added a page listing Python training resources to the wiki http://wiki.python.org/moin/PythonTraining -- http://mail.python.org/mailman/listinfo/python-list

Re: is parameter an iterable?

2005-11-15 Thread Dave Hansen
On 15 Nov 2005 11:26:23 -0800 in comp.lang.python, "py" <[EMAIL PROTECTED]> wrote: >Dan Sommers wrote: >> Just do it. If one of foo's callers passes in a non-iterable, foo will >> raise an exception, and you'll catch it during testing > >That's exactly what I don't want. I don't want an exceptio

Re: newbie - How do I import automatically?

2005-11-15 Thread Brett Hoerner
> I have written some functions in a file called btools.py. I would like > to import them automatically when I start up Python shell. Today I must > do it by hand like this > > >>> from btools import * > >>> dir() > ['__builtins__', '__doc__', '__name__', 'func1', 'func2', 'func3'] > >>> > > Is the

Re: Proposal for adding symbols within Python

2005-11-15 Thread Rocco Moretti
Björn Lindström wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > >>Why does the byte string "\x6f\x70\x65\x6e\x65\x64" have intrinsic >>meaning when the int 0 doesn't? It certainly doesn't mean anything to >>non-English speakers. >> >>If all you want is human readable byte strings, then j

Re: is parameter an iterable?

2005-11-15 Thread Grant Edwards
On 2005-11-15, py <[EMAIL PROTECTED]> wrote: > Dan Sommers wrote: >> Just do it. If one of foo's callers passes in a non-iterable, foo will >> raise an exception, and you'll catch it during testing > > That's exactly what I don't want. I don't want an exception, instead I > want to check to see i

newbie - How do I import automatically?

2005-11-15 Thread bobueland
When I start Python Shell I can see that some names or loaded automatically, ready for me to use >>> dir() ['__builtins__', '__doc__', '__name__'] I have written some functions in a file called btools.py. I would like to import them automatically when I start up Python shell. Today I must do it b

Re: Python obfuscation

2005-11-15 Thread Mike Meyer
"Ben Sizer" <[EMAIL PROTECTED]> writes: >> But we can be >> explicit if you want: How do you do that without requiring that your >> software be given special consideration in the distaster recovery and >> preparedness planning? > I should state that I am not at all claiming a "one size fits all" >

Re: Where can I find an example that uses FTP standard library?

2005-11-15 Thread cosmo
QuadriKev wrote: >I would like to see examples of programs written. http://python.codefetch.com lets you search published books for Python example source code. > I am also interested in using Telnet to check services and things on > the Linux server. a search for "telnet" on codefetch brought u

Re: is parameter an iterable?

2005-11-15 Thread Roy Smith
In article <[EMAIL PROTECTED]>, py <[EMAIL PROTECTED]> wrote: >I have function which takes an argument. My code needs that argument >to be an iterable (something i can loop over)...so I dont care if its a >list, tuple, etc. My first thought was to just write your loop inside a try block and catch

Re: 3-dimensional plot in Python?

2005-11-15 Thread Frithiof Andreas Jensen
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Those interfaces are long since deprecated. Please use matplotlib instead. > > http://matplotlib.sf.net "Long since" being When? I recently installed SciPy and it did not say anything about "deprecated"! -- http

Re: is parameter an iterable?

2005-11-15 Thread py
Thanks for the replies. I agree with Jean-Paul Calderone's suggestion...let the exception be raised. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >