Re: What is different with Python ?

2005-06-17 Thread Andrea Griffini
On Thu, 16 Jun 2005 10:30:04 -0400, Jeffrey Maitland [EMAIL PROTECTED] wrote: Also I think the fact that you think your were diteriating just goes to show how dedicated you are to detail, and making sure you give the right advice or ask the right question. [totally-OT] Not really,

Re: What is different with Python ?

2005-06-17 Thread Andrea Griffini
On Thu, 16 Jun 2005 07:36:18 -0400, Roy Smith [EMAIL PROTECTED] wrote: Andrea Griffini [EMAIL PROTECTED] wrote: That strings in python are immutable it's surely just a detail, and it's implementation specific, but this doesn't means it's not something you can ignore for a while. I disagree.

Re: Unbound names in __del__

2005-06-17 Thread Torsten Bronger
Hallchen! Terry Reedy [EMAIL PROTECTED] writes: Torsten Bronger [EMAIL PROTECTED] wrote: Is there a way to detect whether the program is being terminated? See atexit module to register cleanup functions that run *before* the interpreter starts haphazardly deleting stuff. So I could

ANN: pkpgcounter v1.50 is out

2005-06-17 Thread Jerome Alet
Hi there, I'm very pleased to announce the immediate availability of pkpgcounter v1.50

Re: Multiple instances of a python program

2005-06-17 Thread gatti
Most of the Python interpreter is a shared library, at least on Windows. The only duplication is in loaded Python code, which includes only your bot and the libraries it uses. If you have memory problems, try to do without some libraries or to edit unused parts out of them. Lorenzo Gatti --

Re: Unbound names in __del__

2005-06-17 Thread Michael Hoffman
Torsten Bronger wrote: When my __del__ methods are called because the program is being terminated, I experience difficulties in calling functions that I need for a clean shutdown of my instances. So far, there has been only one of these functions, and a class-local alias solved the problem.

pyrex problem

2005-06-17 Thread [EMAIL PROTECTED]
hi everyone i'm newbie i try to compile the pyrex module: def controlla(char *test): cdef int limitem,lunghezz,li,l2,f,ii,kk cdef char *t1 cdef char *t2 limitem=4 lunghezz=len(test) l1=lunghezz-limitem+1 l2=lunghezz-limitem+1 f=0 for ii from 0 = ii l1-1:

Re: Set of Dictionary

2005-06-17 Thread Oren Tirosh
See the frozendict recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/414283 It was written exactly for this purpose: a dictionary that can be a member in a set. Oren -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 304 Controlling Generation of Bytecode Files - patch updated

2005-06-17 Thread Thomas Heller
Skip Montanaro [EMAIL PROTECTED] writes: I updated the patch that supports PEP 304, Controlling Generation of Bytecode Files to apply cleanly against current CVS. I've tested it on Mac OS X (straight Unix build only). I'd appreciate it if some Linux, Windows and Mac framework folks could

Re: 1980's Home Computer-style Package.

2005-06-17 Thread Oren Tirosh
http://tothink.com/python/progman/ This module implements BASIC-like NEW, LOAD, RUN (sorry, no SAVE...). Oren -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-17 Thread Michele Simionato
Andrea Griffini: I also must note that I, as a fourteen, found terribly interesting the idea of programming a computer even if the only things I could do were for example turning on and off pixels (blocks?) on a screen with resolution 40x50. Probably nowdays unless you show them an

Re: What is different with Python ?

2005-06-17 Thread Claudio Grondi
I always thought about our intellect being something superior to this world made of fragile bones and stinking flesh. However I realized that there's probably no real magic in it... knowing there are pills to make you happy is sort of shocking from a philosophical point of view :-) Yes it

Re: Multiple instances of a python program

2005-06-17 Thread Daniel Dittmar
Rahul wrote: Hi. I am part of a group in my univ where we organize a programming contest. In this contest we have a UDP based server. The server simulates a game and each contestant is to develop a team of virtual players. Each team is composed of 75 similar bots...i.e. governed by the same

strxfrm works with unicode string ?

2005-06-17 Thread nicolas . riesch
I am trying to use strxfm with unicode strings, but it does not work. This is what I did: import locale s=u'\u00e9' print s locale.setlocale(locale.LC_ALL, '') 'French_Switzerland.1252' locale.strxfrm(s) Traceback (most recent call last): File pyshell#20, line 1, in -toplevel-

How to right align IPaddress?

2005-06-17 Thread praba kar
Dear all, Is it possible to right align the Ipaddress? Normally we can right align the list of numbers by %3u or %7u. How we can right align the Ipaddress? I expects below format output eg 203.199.200.0 203.33.20.0 with regards, Prabahar

Re: strxfrm works with unicode string ?

2005-06-17 Thread Gerald Klix
How about: import locale s=u'\u00e9' print s locale.setlocale(locale.LC_ALL, '') locale.strxfrm( s.encode( latin-1 ) ) --- HTH, Gerald [EMAIL PROTECTED] schrieb: I am trying to use strxfm with unicode strings, but it does not work. This is what I did: import locale s=u'\u00e9' print s

Re: How to right align IPaddress?

2005-06-17 Thread qwweeeit
IPnumber.rjust(15) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to right align IPaddress?

2005-06-17 Thread Denis S. Otkidach
On Fri, 17 Jun 2005 09:46:52 +0100 (BST) praba kar [EMAIL PROTECTED] wrote: Is it possible to right align the Ipaddress? Normally we can right align the list of numbers by %3u or %7u. How we can right align the Ipaddress? I expects below format output eg 203.199.200.0

Re: pyrex problem

2005-06-17 Thread Andreas Kostyrka
On Fri, Jun 17, 2005 at 01:03:14AM -0700, [EMAIL PROTECTED] wrote: hi everyone i'm newbie i try to compile the pyrex module: def controlla(char *test): You cannot have a C datatype in a Python like that. Much better to use def controlla(test): Andreas --

Re: utf8 and ftplib

2005-06-17 Thread Richard Lewis
On Thu, 16 Jun 2005 12:06:50 -0600, John Roth [EMAIL PROTECTED] said: Richard Lewis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I'm having a problem with unicode files and ftplib (using Python 2.3.5). I've got this code: xml_source = codecs.open(foo.xml,

Re: How to right align IPaddress?

2005-06-17 Thread qwweeeit
Hi, the solution is a little more involved, if you want to right justify each of the four components of IP number: import sys try: .sIPnumber=sys.argv[1] except: . sys.exit(-1) list_lPcomponents=sIPnumber.split('.') sRJ='' for n in list_IPcomponents: . sRJ+=n.rjust(3)+'.' print sRJ[:-1]

Re: strxfrm works with unicode string ?

2005-06-17 Thread nicolas . riesch
Gruzi, Gerald ;-) Well, ok, but I don't understand why I should first convert a pure unicode string into a byte string. The encoding ( here, latin-1) seems an arbitrary choice. Your solution works, but is it a workaround or the real way to use strxfrm ? It seems a little artificial to me, but

Re: whos -- a function listing objects

2005-06-17 Thread Piet van Oostrum
[EMAIL PROTECTED] (b) wrote: b I have been a long time Matlab user. I Python, I miss Matlab's whos b command. b So I have written a little utility whos.py, which can be downloaded b here: b http://beluga.eos.ubc.ca/~tang/softwares/python/ b Here is the doc string: b # Before using whos, do: b

Re: How to right align IPaddress?

2005-06-17 Thread Piet van Oostrum
praba kar [EMAIL PROTECTED] (pk) wrote: pk Dear all, pk Is it possible to right align pk the Ipaddress? Normally we can pk right align the list of numbers pk by %3u or %7u. How we can right pk align the Ipaddress? pk I expects below format output pk eg 203.199.200.0 pk 203.33.20.0

Re: Python firewall control (Win32)

2005-06-17 Thread Tim Williams
On Thu, 16 Jun 2005, Tim Williams wrote: Does anyone know of (personal/desktop) firewall that can be controlled via Python, or a Python Firewall package, or even something like DAXFi but not dormant ? http://wipfw.sourceforge.net/ import os def deny(src, dst, proto=all): cmd = ipfw add

Re: log in to a website

2005-06-17 Thread Fuzzyman
[EMAIL PROTECTED] wrote: I'm learning python, and my goal is to write a script that will log into a website for me. The site uses HTTPS, the form uses the POST method. From what I've been able to find so far, it looks like i need to use the urllib2 module...does anyone know where I can

Re: PEP 304 Controlling Generation of Bytecode Files - patch updated

2005-06-17 Thread Skip Montanaro
Skip http://python.org/sf/677103 Thomas There's no patch attached. *sigh* Thanks for noticing the problem. Apparently, since I last updated the patch, SF implemented a 250kbyte limit on file uploads. This one is big because it includes a suitably modified configure script that was

Re: Using httplib to read a file online

2005-06-17 Thread Fuzzyman
Why are you using httplib rather than urllib2 ? Best Regards, Fuzzy http://www.voidspace.org.uk/python -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-17 Thread Andrea Griffini
On 17 Jun 2005 01:25:29 -0700, Michele Simionato [EMAIL PROTECTED] wrote: I don't think anything significant changed in the percentages. Then why starting from print Hello world that can't be explained (to say better it can't be *really* understood) without introducing a huge amount of

Re: strxfrm works with unicode string ?

2005-06-17 Thread Gerald Klix
Sali Nicolas :)), please see below for my answers. [EMAIL PROTECTED] schrieb: Gruzi, Gerald ;-) Well, ok, but I don't understand why I should first convert a pure unicode string into a byte string. The encoding ( here, latin-1) seems an arbitrary choice. Well latin-1 is only encoding, about

Re: Python firewall control (Win32)

2005-06-17 Thread Tom Anderson
On Fri, 17 Jun 2005, Tim Williams wrote: On Thu, 16 Jun 2005, Tom Anderson wrote: On Thu, 16 Jun 2005, Tim Williams wrote: Does anyone know of (personal/desktop) firewall that can be controlled via Python http://wipfw.sourceforge.net/ Tom, many thanks for that. I'm actually

Re: What is different with Python ?

2005-06-17 Thread Michele Simionato
I fail to see the relationship between your reply and my original message. I was complaining about the illusion that in the old time people were more interested in programming than now. Instead your reply is about low level languages being more suitable for beginners than high level languages. I

Re: Python firewall control (Win32)

2005-06-17 Thread accenture_travel
- Original Message - From: Tom Anderson [EMAIL PROTECTED] On Fri, 17 Jun 2005, Tim Williams wrote: On Thu, 16 Jun 2005, Tom Anderson wrote: On Thu, 16 Jun 2005, Tim Williams wrote: Does anyone know of (personal/desktop) firewall that can be controlled via Python

Re: ElementTree Namespace Prefixes

2005-06-17 Thread Martijn Faassen
Jarek Zgoda wrote: [snip] It's a shame the default ns behavior in Elementtree is in such a poort staten. I'm surprised no one's forked Elementtree solely to fix this issue. There is at least one ElementTree API implementation that retains prefixes, lxml.ETree. Go google for it. Just to

Re: What is different with Python ?

2005-06-17 Thread Peter Hansen
Andrea Griffini wrote: Is C++ a good first programming language ? BWHAHAHAHAHAHAHAHA :D But apparently some guru I greatly respect thinks so (I'm not kidding, http://www.spellen.org/youcandoit/). With respect to the author, and an understanding that there is probably much that didn't go

Re: Unbound names in __del__

2005-06-17 Thread Peter Hansen
Torsten Bronger wrote: However, all of this is not pretty pythonic in my opinion. Is it that exotic to want to call functions from within __del__? Yes, I think it probably is. In the few hundred thousand lines of Python code I've played a role in developing, we've used __del__ once, to my

Re: Is Python Suitable for Large Find Replace Operations?

2005-06-17 Thread rbt
On Fri, 2005-06-17 at 12:33 +1000, John Machin wrote: OK then, let's ignore the fact that the data is in a collection of Word Excel files, and let's ignore the scale for the moment. Let's assume there are only 100 very plain text files to process, and only 1000 SSNs in your map, so it

Re: What is different with Python ?

2005-06-17 Thread Claudio Grondi
there is a 1% of people extremely interested in turning on or off a pixel I taught adults aged from 16 to 86 for some years a course Introduction to data processing, where I had tried to teach the basics beginning with switching light on and off. Having around twenty participants I experienced

Re: New WYSIWYG Python IDE in the works

2005-06-17 Thread Colin J. Williams
Steve Holden wrote: Cappy2112 wrote: This is great, but it might be worth finding out what the other IDE's can do first, as well as their weaknesses. Eric3 seems to be the most popular powerfull. Uop until recentluy, it onluy works on Linux, but has been compiled runnin on Windows, to

Re: Is Python Suitable for Large Find Replace Operations?

2005-06-17 Thread Peter Hansen
rbt wrote: The script is too long to post in its entirety. In short, I open the files, do a binary read (in 1MB chunks for ease of memory usage) on them before placing that read into a variable and that in turn into a list that I then apply the following re to ss =

Re: thread.start_new_thread question

2005-06-17 Thread Konstantin Veretennicov
On 6/17/05, Brian [EMAIL PROTECTED] wrote: Hi KV, Here's a site that provides an easy, beginners example of how to do threading. You might find this useful too... :-) http://www.codesampler.com/python.htm (Look for the Spawning Threads section.) Thank you, but that doesn't answer my

Re: Unbound names in __del__

2005-06-17 Thread Torsten Bronger
Hallchen! Peter Hansen [EMAIL PROTECTED] writes: [...] What's your use case for del? Every instance represents a session to a measurement instrument. After the instance is deleted, the session should be closed to free resources. If the program exists, this is actually not necessary, because

Back to the future - python to C++ advice wanted

2005-06-17 Thread George Sakkis
During the last 18 months or so I have indulged in the joy of learning and using python for almost everything, but I may have to go back to C/C++ at work. Suddenly I found myself transliterating (or translating at least) common python idioms and patterns, looking for libraries to replace python's

Re: What is different with Python ?

2005-06-17 Thread Michele Simionato
Claudio Grondi: I am personally biased towards trying to understand anything as deep as possible and in the past was quite certain, that one can not achieve good results without a deep insight into the underlying details. I have now to admit, that I was just wrong. From my overall experience I

Re: utf8 and ftplib

2005-06-17 Thread John Roth
Richard Lewis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Thu, 16 Jun 2005 12:06:50 -0600, John Roth [EMAIL PROTECTED] said: Richard Lewis [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I'm having a problem with unicode files and ftplib (using

Re: Python firewall control (Win32)

2005-06-17 Thread Tim Williams
- Original Message - From: Tom Anderson [EMAIL PROTECTED] AIUI, you won't be stopping and restarting ipfw - the ipfw command just modifies the ruleset being used by a continuously-running instance of the ipfw kernel module or daemon or whatever. How long it takes from starting

Re: Multiple instances of a python program

2005-06-17 Thread Rahul
Daniel Dittmar wrote: Rahul wrote: Hi. I am part of a group in my univ where we organize a programming contest. In this contest we have a UDP based server. The server simulates a game and each contestant is to develop a team of virtual players. Each team is composed of 75 similar

Re: How should threads be terminated? (related to 'Help with thread related tracebacks')

2005-06-17 Thread Maxwell Hammer
On Thu, 16 Jun 2005 16:20:23 -0400, Peter Hansen wrote: Maxwell Hammer wrote: This is related to an earlier post 'Help with thread related tracebacks'...for which I have had no feedback yet :-( If the question was well formulated, and it's been more than a couple of days, you should

Embedding Python

2005-06-17 Thread =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
Hi, Imagine that you have a PyObject pointer 'object' pointing to a Python integer ... let's say 42. How would do you attach the variable answer to it so that the code PyRun_SimpleString(print answer); works as expected ? My current solution is: __main__ = PyImport_ImportModule(__main__);

Re: How should threads be terminated? (related to 'Help with thread related tracebacks')

2005-06-17 Thread Maxwell Hammer
Thanks Brian Martin for the links. I actually found another good one: http://linuxgazette.net/107/pai.html Cheers. -- http://mail.python.org/mailman/listinfo/python-list

Re: Back to the future - python to C++ advice wanted

2005-06-17 Thread bruno modulix
George Sakkis wrote: During the last 18 months or so I have indulged in the joy of learning and using python for almost everything, but I may have to go back to C/C++ at work. (snip) So, I wonder what have others who have gone the same path done and learned in similar situations. How one can

Help implementing an idea

2005-06-17 Thread Nicholas . Vaidyanathan
Well, I'm a total python n00b, but I was playing around with exception handling yesterday, and was stricken by how incredibly easy it is to use the op system to create nice scripts... I did the following: import sys lines = sys.stdin.readlines() lines.sort() for stuff in lines: print stuff

Re: Dealing with marketing types...

2005-06-17 Thread Cameron Laird
In article [EMAIL PROTECTED], Kay Schluehr [EMAIL PROTECTED] wrote: Sorry, Cameron, if I twist meanings. Thomas argues that Python programmers are more expensive than Java ones. But if one needs more Java programmers to fit into the project plan one needs probably more managenment/admistration

Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread kj
I'm a Perlhead (there, I said it). Years ago I made a genuine attempt to learn Python, but my intense disappointed with the way Python deals with scopes ultimately sapped my enthusiasm. I couldn't live without closures and without the fine control over scopes that Perl provides. I've been

Re: UML to Python/Java code generation

2005-06-17 Thread Peter Dembinski
Grigoris Tsolakidis [EMAIL PROTECTED] writes: There is tool to generate UML from Python Code... The best is human brain. -- http://mail.python.org/mailman/listinfo/python-list

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Hughes, Chad O
I am very familiar with Python, but I don't know Pearl. In order to answer your question, you will have to tell me about your statement, I couldn't live without closures and without the fine control over scopes that Pearl provides. I don't know what these things are to Pearl. If you tell me what

Re: Multiple instances of a python program

2005-06-17 Thread Steven D'Aprano
On Thu, 16 Jun 2005 11:47:10 -0700, Rahul wrote: Hi. I am part of a group in my univ where we organize a programming contest. In this contest we have a UDP based server. The server simulates a game and each contestant is to develop a team of virtual players. Each team is composed of 75

Re: Multiple instances of a python program

2005-06-17 Thread Jeremy Sanders
On Thu, 16 Jun 2005 11:47:10 -0700, Rahul wrote: If you have a python script and you want that 75 copies of the script be run simultaneously how will you do it? Is there anyway to do so without running 75 copies of the python interpreter simultaneously? If you're running on Linux (and other

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Kent Johnson
kj wrote: I'm a Perlhead (there, I said it). Years ago I made a genuine attempt to learn Python, but my intense disappointed with the way Python deals with scopes ultimately sapped my enthusiasm. I couldn't live without closures and without the fine control over scopes that Perl provides.

Re: Back to the future - python to C++ advice wanted

2005-06-17 Thread Cameron Laird
In article [EMAIL PROTECTED], bruno modulix [EMAIL PROTECTED] wrote: George Sakkis wrote: . . . learned in similar situations. How one can avoid the frustration of having to work with a low level language once he has seen

pysqlite - Checking the existance of a table

2005-06-17 Thread rh0dium
Hi all, I am starting to play with pysqlite, and would like to know if there is a function to determine if a table exists or not. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Programmatically bring a window to front

2005-06-17 Thread zren
Hi, I wonder if anyone knows how to programmatically make a python window get focus and bring it to front. Here a python window means the Tkinter Toplevel widget. Thanks. Zhen -- http://mail.python.org/mailman/listinfo/python-list

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Hughes, Chad O
Are you sure about the lower-case thing. The original post states Perlhead and there are many instances at www.Perl.com where O'REILLY spells perl as Perl. Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven D'Aprano Sent: Friday, June 17, 2005

Re: Help implementing an idea

2005-06-17 Thread utabintarbo
Take a look at: http://dirssync.sourceforge.net/ See if that gives you any direction. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help implementing an idea

2005-06-17 Thread rh0dium
Try this.. #!/usr/bin/env python # Upload a file to a FTP server from sys import argv, exit from ftplib import FTP if len(argv) != 6: print 'Incorrect number of parameters' print 'USAGE: upload.py server username password local file remote file' exit(0) server = argv[1]

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Steven D'Aprano
On Fri, 17 Jun 2005 10:22:05 -0700, Hughes, Chad O wrote: Are you sure about the lower-case thing. The original post states Perlhead and there are many instances at www.Perl.com where O'REILLY spells perl as Perl. I did say usually :-) But in fact it seems that the creator of Perl/perl,

Re: whos -- a function listing objects

2005-06-17 Thread Fernando Perez
[EMAIL PROTECTED] wrote: I have been a long time Matlab user. I Python, I miss Matlab's whos command. plug you might want to look at ipython. whos, and a bit more come for free: planck[~] ipython -pylab Python 2.3.4 (#1, Feb 2 2005, 12:11:53) Type copyright, credits or license for more

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Hughes, Chad O
Thanks, I will keep that in mind. Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven D'Aprano Sent: Friday, June 17, 2005 11:06 AM To: python-list@python.org Subject: RE: Overcoming herpetophobia (or what's up w/ Python scopes)? On Fri, 17 Jun

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Steve M
This link seems to be about Closures in Python, but I am not feeling sharp enough at the moment to evaluate the correctness of the discussion. http://en.wikipedia.org/wiki/Python_programming_language#Closures As others have said, you might get more useful responses if you can elaborate upon what

how to operate the excel by python?

2005-06-17 Thread Kevin P. Coffey
Question please: In the post, "How to operate the excel by python," where did you find the codes for HorizontalAlignment and VerticalAlignment (Center = -4108 and Bottom = -4107)? I need the code for HorizontalAlignment = xlRight. Is there a table somewhere that shows these codes? Thanks

add new modules?

2005-06-17 Thread Dennis Clark
This is a total newb question, you have been warned... I've been all over the www.python.org site and googled, but I've not found just how to add new modules. I've tried setting PYTHONPATH, I've tried putting the new module directories into the site-packages directory, I've tried creating the

Re: Shortcut to initialize variables

2005-06-17 Thread Kent Johnson
Andrew wrote: Newb here... For one of my programs I want to initialize a variable for each letter of the alphabet. For example, a,b,c = 0,0,0. I don't think this works, but I'm wondering if I can do something similar to this: from string import ascii_lowercase class Blah: def

RE: how to operate the excel by python?

2005-06-17 Thread Hughes, Chad O
Title: Message Ihave posed a more complete answer to your question, however, it is quite a large and It is awaiting approval. For now, xlRight = -4152. You can find this out by opening up Excel and typing the ALT-F11 combination. From there use the ObjectBrowser. For example if you type in

Re: add new modules?

2005-06-17 Thread Kent Johnson
Dennis Clark wrote: This is a total newb question, you have been warned... I've been all over the www.python.org site and googled, but I've not found just how to add new modules. I've tried setting PYTHONPATH, I've tried putting the new module directories into the site-packages directory,

Re: Shortcut to initialize variables

2005-06-17 Thread Steven Bethard
Andrew wrote: Newb here... For one of my programs I want to initialize a variable for each letter of the alphabet. For example, a,b,c = 0,0,0. Why do you want to do this? This looks like a particularly bad idea to me. Can't you just use a dict of the variables, e.g.: py d =

smtplib and TLS

2005-06-17 Thread Matthias Kluwe
Hi! After getting a @gmail.com address, I recognized I had to use TLS in my python scripts using smtplib in order to get mail to the smtp.gmail.com server. Things work well so far, apart from an unexpected error. Here's my sample code: import smtplib server = smtplib.SMTP('smtp.gmail.com',

Re: add new modules?

2005-06-17 Thread Robert Kern
Dennis Clark wrote: This is a total newb question, you have been warned... I've been all over the www.python.org site and googled, but I've not found just how to add new modules. I've tried setting PYTHONPATH, I've tried putting the new module directories into the site-packages directory,

Re: Shortcut to initialize variables

2005-06-17 Thread Andrew
Oops, I probably should have tried searching the list first. My background is strictly academic. I was switching languages so often I never got really familiar with any of them. Maybe C for a while, but I've forgotten alot. I'm hoping python will be the last language I ever need. :) I don't know

Re: pysqlite - Checking the existance of a table

2005-06-17 Thread Matthias Kluwe
Simply use the internal table SQLite_Master: select name from SQLite_Master will return all existing tables. Regards, Matthias -- http://mail.python.org/mailman/listinfo/python-list

Please help me understand this code....

2005-06-17 Thread randy
Hello, I am a programmer, but not a python guy. So I am a little confused with the following python code. Specifically what does the : do in the array arithmetic? new_page = map[opage] old_page = map[opage^1] center = new_page[1:-1,1:-1] origcenter = array(center) center[:]

Re: add new modules?

2005-06-17 Thread Dennis Clark
Thanks all, My problem came when I set PYTHONHOME, apparently that is a bad thing (in this case). I know that I set it to the directory that python was in, but something about that was bad. now everything works. DLC Robert Kern [EMAIL PROTECTED] wrote: : Dennis Clark wrote: : This is a

Re: smtplib and TLS

2005-06-17 Thread Paul Rubin
Matthias Kluwe [EMAIL PROTECTED] writes: The server accepts and delivers my messages, but the last command raises socket.sslerror: (8, 'EOF occurred in violation of protocol') Did I miss something? Any hint is welcome. Looks like the module didn't send an TLS Close Notify message before

Re: case/switch statement?

2005-06-17 Thread D H
Peter Hansen wrote: D H wrote: Peter Hansen wrote: With a case statement, on the other hand, you *know* that it must be just simple conditionals (a series of x == some_constant tests), so you don't need to look at all the cases, just the one that interests you. Since you and Steve

Re: Back to the future - python to C++ advice wanted

2005-06-17 Thread Bill McClain
On 2005-06-17, George Sakkis [EMAIL PROTECTED] wrote: So, I wonder what have others who have gone the same path done and learned in similar situations. How one can avoid the frustration of having to work with a low level language once he has seen the Light ? This project:

Re: What is different with Python ?

2005-06-17 Thread D H
Peter Hansen wrote: But apparently some guru I greatly respect thinks so (I'm not kidding, http://www.spellen.org/youcandoit/). With respect to the author, and an understanding that there is probably much that didn't go into his self-description (add about.htm to the above URL), it

ANN: IssueTrackerProduct 0.6.9 with AJAX and Reports

2005-06-17 Thread [EMAIL PROTECTED]
(I don't know if this is the right place to make an announcement but I've seen other projects doing it so I thought why not?) I've now released version 0.6.9 of the IssueTrackerProduct http://www.issuetrackerproduct.com/News/0.6.9 It's a issue/bug tracker built on top of Zope (Python) that is

Re: whos -- a function listing objects

2005-06-17 Thread benyang22
whos.py as a module would not work for global scope, as it hides the function whos in the module scope. I have fixed the string bug. -- http://mail.python.org/mailman/listinfo/python-list

Re: Back to the future - python to C++ advice wanted

2005-06-17 Thread D H
George Sakkis wrote: During the last 18 months or so I have indulged in the joy of learning and using python for almost everything, but I may have to go back to C/C++ at work. Suddenly I found myself transliterating (or translating at least) common python idioms and patterns, looking for

Why is there no instancemethod builtin?

2005-06-17 Thread John Reese
Why hello there ha ha. I have got in the habit of testing the types of variables with isinstance and the builtin type names instead of using the types module, as was the style back around Python 2.1. That is, rather than if type(x) == types.ListType: I now do: if isinstance(x, list):

Re: whos -- a function listing objects

2005-06-17 Thread benyang22
That is nice. I didn't know iPython can do whos. Will try it. iPython seems to infinitely configurable. Hope it will not suck too much of my time into it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple instances of a python program

2005-06-17 Thread Rahul
Hi. I will look into it..thanks rahul Jeremy Sanders wrote: On Thu, 16 Jun 2005 11:47:10 -0700, Rahul wrote: If you have a python script and you want that 75 copies of the script be run simultaneously how will you do it? Is there anyway to do so without running 75 copies of the python

Re: Please help me understand this code....

2005-06-17 Thread Jordan Rastrick
The : is used in Python for slice notation, which is explained pretty thoroughly in the Python tutorial, specifically at: http://www.python.org/doc/2.4/tut/node5.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple instances of a python program

2005-06-17 Thread Rahul
Steven D'Aprano wrote: On Thu, 16 Jun 2005 11:47:10 -0700, Rahul wrote: Hi. I am part of a group in my univ where we organize a programming contest. In this contest we have a UDP based server. The server simulates a game and each contestant is to develop a team of virtual players. Each

Re: What is different with Python ?

2005-06-17 Thread Andrea Griffini
On 17 Jun 2005 05:30:25 -0700, Michele Simionato [EMAIL PROTECTED] wrote: I fail to see the relationship between your reply and my original message. I was complaining about the illusion that in the old time people were more interested in programming than now. Instead your reply is about low level

ISO authoritative Python ref

2005-06-17 Thread bill
I have to learn Python in a hurry. I learn fastest by reading the specs/reference manual, or something like it (e.g. C: A Reference Manual, by Harbison and Steel). Is there a Python book that fits this description? Many thanks in advance, bill P.S. I avoid tutorials like the plague, and I

Re: Is Python Suitable for Large Find Replace Operations?

2005-06-17 Thread John Machin
rbt wrote: On Fri, 2005-06-17 at 09:18 -0400, Peter Hansen wrote: rbt wrote: The script is too long to post in its entirety. In short, I open the files, do a binary read (in 1MB chunks for ease of memory usage) on them *ONE* MB? What are the higher-ups constraining you to run this on? My

Re: ISO authoritative Python ref

2005-06-17 Thread Paul Rubin
bill [EMAIL PROTECTED] writes: I have to learn Python in a hurry. I learn fastest by reading the specs/reference manual, or something like it (e.g. C: A Reference Manual, by Harbison and Steel). Is there a Python book that fits this description? The official reference manual is at:

Re: ISO authoritative Python ref

2005-06-17 Thread bill
In [EMAIL PROTECTED] bill [EMAIL PROTECTED] writes: I have to learn Python in a hurry. My apologies. I found what I needed. I don't understand it how I missed it in my first round of searching. Thanks, bill -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no instancemethod builtin?

2005-06-17 Thread John Machin
John Reese wrote: Why hello there ha ha. [snip] Just looking through the types declared in types, the following are builtins: [snip] ... NoneType, NotImplementedType And the following are not: [snip] ... NoneType, NotImplementedType So for any in the latter batch, I have to import

Re: What is different with Python ?

2005-06-17 Thread Andrea Griffini
On Fri, 17 Jun 2005 08:40:47 -0400, Peter Hansen [EMAIL PROTECTED] wrote: And the fact that he's teaching C++ instead of just C seems to go against your own theories anyway... (though I realize you weren't necessarily putting him forth as a support for your position). He's strongly advocating

  1   2   >