Tkinter based libraries Runtime Library 3.0 and Gestalt Items 1.1

2009-11-07 Thread Arndt Roger Schneider
Hi Python commuters, It is my distinct pleasure to announce the availability of Runtime Library 3.0 and Gestalt Items 1.1 for Tkinter and Python. Both libraries are written in Tcl/Tk = version 8.4. Tkinter based Python Wrapper classes are part of the libraries, making them accesible from

ANN: eGenix mxODBC - Python ODBC Database Interface 3.0.4

2009-11-07 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC - Python ODBC Database Interface Version 3.0.4 mxODBC is our commercially supported Python extension providing ODBC database connectivity to

[ANN] yappi v0.2

2009-11-07 Thread k3xji
yappi(Yet Another Python Profiler) v0.2 released. Documentation is updated. Features: * very efficient multi-threading profiling. * profiler pollution effect (the overhead that the profiler put on an application) can be viewed from the statistic results. * may help to avoid deadlocks.

[ANN] yappi v0.2 - link

2009-11-07 Thread k3xji
Forgot to give the link: http://code.google.com/p/yappi/ Twitter: http://twitter.com/sumercip Thanks, -- Sumer Cip -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/

ErrorHandler 1.1.0 Released!

2009-11-07 Thread Chris Withers
I'm pleased to announce a new release of ErrorHandler. This is a handler for the python standard logging framework that can be used to tell whether messages have been logged at or above a certain level. The only change for this release is that there is now a full set of documentation available

Re: Pyfora, a place for python

2009-11-07 Thread Saketh
On Nov 4, 5:28 pm, Alan Franzoni doesnotex...@franzoni.invalid wrote: On 11/2/09 3:44 PM, Diez B. Roggisch wrote: Being from germany, I can say that we *have* this fragmentation, and frankly: I don't like it. I prefer my communication via NNTP/ML, and not with those visually rather noisy

extracting info from media files

2009-11-07 Thread Michele Simionato
I would like to extract some simple info from media files, such as size, resolution, duration, codec. What's the simplest way to do it? Once in a time there was pymedia but I see the latest release is of February 2006. The solution should work on Linux and provide support for a large set of video

Re: Editing PDF files usig Python

2009-11-07 Thread David Williams
Maybe try ReportLab, its pretty much the most advanced Python PDF toolkit I know of: http://www.reportlab.org/ Hi All, Greetings, I am a newbie in Python, i have a requirement to develop a component in python that can text water mark the PDF file both digitallly and visibly. I have

Re: imputil.py, is this a bug ?

2009-11-07 Thread Stef Mientki
Gabriel Genellina wrote: En Fri, 06 Nov 2009 18:33:37 -0300, Stef Mientki stef.mien...@gmail.com escribió: I get an error compiling with pyjamas, in the standard module imputil, _import_top_module Note that imputil is undocumented in 2.5, deprecated in 2.6 and definitively gone in 3.0

Re: imputil.py, is this a bug ?

2009-11-07 Thread lkcl
On Nov 7, 2:20 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Yes, seems to be a bug. But given the current status of imputil, it's not likely to be fixed; certainly not in 2.5 which only gets security fixes now. well, that bug's not the only one. the other one that i found, which i

Re: Using logging module for conditional nested logs

2009-11-07 Thread Vinay Sajip
On Nov 4, 11:14 pm, Reckoner recko...@gmail.com wrote: Thanks again. You're welcome. You asked (on a Logging 101 blog comment) for a tutorial on how to use Filters. I can point you this Stack Overflow question:

What is the correct way to port codecs.open to python 3.1?

2009-11-07 Thread Baptiste Lepilleur
After applying 2to3.py to port a 2.6 script to 3.1, I get the following error when running my script: File purekeyworddbtest.py, line 143, in __init__ f = codecs.open(EXCLUDED_KEYWORDS_FILE, 'rt', 'utf-8') File c:\Python31\lib\codecs.py, line 870, in open file = builtins.open(filename,

ErrorHandler 1.1.0 Released!

2009-11-07 Thread Chris Withers
I'm pleased to announce a new release of ErrorHandler. This is a handler for the python standard logging framework that can be used to tell whether messages have been logged at or above a certain level. The only change for this release is that there is now a full set of documentation available

Nov 7 TODAY Nov 22 - Join Global FreeSW Python GNU(Linux) HW Culture meeting via VOIP - BerkeleyTIP GlobalTIP - For Forwarding

2009-11-07 Thread john_re
Guido Van Rossum SciPy talk this month! CONTENTS: Meeting days/times Howto - Mark your calendar's dates; Videos; Hot topics; Opportunities; Announcement Flyers; New webpages = Come join in with the Global Free SW HW Culture community at the BerkeleyTIP/GlobalTIP meeting, via VOIP. Two

Re: What is the correct way to port codecs.open to python 3.1?

2009-11-07 Thread MRAB
Baptiste Lepilleur wrote: After applying 2to3.py to port a 2.6 script to 3.1, I get the following error when running my script: File purekeyworddbtest.py, line 143, in __init__ f = codecs.open(EXCLUDED_KEYWORDS_FILE, 'rt', 'utf-8') File c:\Python31\lib\codecs.py, line 870, in open

ANN: esky 0.2.1

2009-11-07 Thread Ryan Kelly
I'm pleased to announce the latest release of esky, a tool for keeping your frozen apps fresh: Downloads:http://pypi.python.org/pypi/esky/ Latest Version: 0.2.1 License: BSD Esky is an auto-update framework for frozen python apps, built on top of bbfreeze. It provides

Serious Privileges Problem: Please Help

2009-11-07 Thread Victor Subervi
I have a serious privileges problem that is making it impossible to serve python pages on a CentOS server. It appears that nobody on the CentOS discussion list has a solution to this problem. I'm desperate and hoping someone on this list can help. [Fri Nov 06 11:50:40 2009] [error] [client

Program to compute and print 1000th prime number

2009-11-07 Thread Ray Holt
I am taking the MIT online course Introduction to Computer Science and Programming. I have a assignment to write a program to compute and print the 1000th. prime number. Can someone give me some leads on the correct code? Thanks, Ray -- http://mail.python.org/mailman/listinfo/python-list

Re: Program to compute and print 1000th prime number

2009-11-07 Thread sstein...@gmail.com
On Nov 7, 2009, at 9:44 AM, Ray Holt wrote: I am taking the MIT online course Introduction to Computer Science and Programming. I have a assignment to write a program to compute and print the 1000th. prime number. Can someone give me some leads on the correct code? Thanks, Ray Copying

Re: Docs Typo

2009-11-07 Thread Steven D'Aprano
On Sat, 07 Nov 2009 01:09:51 +1300, Lawrence D'Oliveiro wrote: In message 87eioghrsk@benfinney.id.au, Ben Finney wrote: Lawrence D'Oliveiro l...@geek-central.gen.new_zealand writes: http://docs.python.org/library/turtle.html -- “ScrolledCavas” should be “ScrolledCanvas”. Thanks for

Re: is None or == None ?

2009-11-07 Thread Steven D'Aprano
On Fri, 06 Nov 2009 16:51:18 +0100, Marco Mariani wrote: Using x is y with integers makes no sense and has no guaranteed behaviour AFAIK Of course it makes sense. `x is y` means *exactly the same thing* for ints as it does with any other object: it tests for object identity. That's all it

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Steven D'Aprano
On Fri, 06 Nov 2009 18:46:33 -0800, gil_johnson wrote: I don't have the code with me, but for huge arrays, I have used something like: arr[0] = initializer for i in range N: arr.extend(arr) This doubles the array every time through the loop, and you can add the powers of 2 to get

Re: Defining re pattern for matching list of numbers

2009-11-07 Thread Steven D'Aprano
On Fri, 06 Nov 2009 10:16:31 -0800, Chris Rebert wrote: Your format seems so simple I have to ask why you're using regexes in the first place. Raymond Hettinger has described some computing techniques as code prions -- programming advice or techniques which are sometimes useful but often

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, sstein...@gmail.com wrote: On Nov 7, 2009, at 9:44 AM, Ray Holt wrote: I am taking the MIT online course Introduction to Computer Science and Programming. I have a assignment to write a program to compute and print the 1000th. prime number. Can someone

Re: Pyfora, a place for python

2009-11-07 Thread Aneesh Kulkarni
Imagine if no one ever created anything new out of fear of fragmenting the community. Should we hurl the same accusation at Guido for fragmenting the programmer community and creating Python, when perfectly fine languages like Perl, Lisp Smalltalk already existed? Creating new things is a part

Re: PyQt processEvents not processing

2009-11-07 Thread David Boddie
On Saturday 07 November 2009 05:12, DarkBlue wrote: qt 4.5.3 pyqt 4.6.1 python 2.6 I have this QtTable widget which I want to refresh once about every 2 seconds with new data. so I do : def updateSchedule(self): for j in range(0,10): doUpdate()

Re: What is the best way to delete strings in a string list that that match certain pattern?

2009-11-07 Thread Peng Yu
On Sat, Nov 7, 2009 at 8:54 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 06 Nov 2009 10:16:58 -0600, Peng Yu wrote: What is a list-comprehension? Time for you to Read The Fine Manual. http://docs.python.org/tutorial/index.html I tried the following code. The

Re: What is the best way to delete strings in a string list that that match certain pattern?

2009-11-07 Thread Peng Yu
On Fri, Nov 6, 2009 at 5:57 PM, Dave Angel da...@ieee.org wrote: Peng Yu wrote: On Fri, Nov 6, 2009 at 10:42 AM, Robert P. J. Day rpj...@crashcourse.ca wrote: On Fri, 6 Nov 2009, Peng Yu wrote: On Fri, Nov 6, 2009 at 3:05 AM, Diez B. Roggisch de...@nospam.web.de wrote: Peng Yu

Can't Find Module

2009-11-07 Thread Victor Subervi
Hi; I'm getting this error: Mod_python error: PythonHandler mod_python.publisher Traceback (most recent call last): File /usr/lib64/python2.4/site-packages/mod_python/apache.py, line 299, in HandlerDispatch result = object(req) File

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Raymond Hettinger
On Nov 7, 2009, at 9:44 AM, Ray Holt wrote:       I am taking the MIT online course Introduction to Computer Science and       Programming. I have a assignment to write a program to compute and print       the 1000th. prime number. Can someone give me some leads on the correct    

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, Raymond Hettinger wrote: On Nov 7, 2009, at 9:44 AM, Ray Holt wrote:       I am taking the MIT online course Introduction to Computer Science and       Programming. I have a assignment to write a program to compute and print       the 1000th. prime number. Can

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Xavier Ho
On Sun, Nov 8, 2009 at 12:44 AM, Ray Holt mrhol...@sbcglobal.net wrote: I have a assignment to write a program to compute and print the 1000th. prime number. Can someone give me some leads on the correct code? Ray, if you really want an answer out of this list, you'll have to at least show

Re: extracting info from media files

2009-11-07 Thread Sean DiZazzo
MediaInfo is your best bet. http://mediainfo.sourceforge.net/en ~Sean On Nov 6, 11:59 pm, Michele Simionato michele.simion...@gmail.com wrote: I would like to extract some simple info from media files, such as size, resolution, duration, codec. What's the simplest way to do it? Once in a

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Mensanator
On Nov 7, 11:23 am, Raymond Hettinger pyt...@rcn.com wrote: On Nov 7, 2009, at 9:44 AM, Ray Holt wrote:       I am taking the MIT online course Introduction to Computer Science and       Programming. I have a assignment to write a program to compute and print       the 1000th.

exception due to NoneType

2009-11-07 Thread asit
In my program I want to catch exception which is caused by accessing NoneType object. Can anyone suggest me how this can be done ?? -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the correct way to port codecs.open to python 3.1?

2009-11-07 Thread Antoine Pitrou
Le Sat, 07 Nov 2009 12:56:54 +0100, Baptiste Lepilleur a écrit : After applying 2to3.py to port a 2.6 script to 3.1, I get the following error when running my script: File purekeyworddbtest.py, line 143, in __init__ f = codecs.open(EXCLUDED_KEYWORDS_FILE, 'rt', 'utf-8') File

how to display the return type of an os method?

2009-11-07 Thread Robert P. J. Day
once again, a thoroughly newbie question but what's the quickest way to display the return type of, say, os.stat()? i can obviously do this in two steps: x=os.stat('/etc/passwd') type(x) class 'posix.stat_result' i'd just like to see that os.stat() returns a posix.stat_result object in

Re: Program to compute and print 1000th prime number

2009-11-07 Thread John Posner
Robert P. J. Day said: the ubiquitous sieve of eratosthenes requires you to pre-specify your maximum value, after which -- once the sieve completes -- all you know is that you have all of the prime numbers up to n. whether you'll have 1000 of them isn't clear, which means that you might have

Re: What is the best way to delete strings in a string list that that match certain pattern?

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, Peng Yu wrote: On Fri, Nov 6, 2009 at 5:57 PM, Dave Angel da...@ieee.org wrote: But if you have an expression you want to match each dir against, the list comprehension is the best answer.  And the trick to stuffing that new list into the original list object is to use

Re: how to display the return type of an os method?

2009-11-07 Thread Bruno Desthuilliers
Robert P. J. Day a écrit : once again, a thoroughly newbie question but what's the quickest way to display the return type of, say, os.stat()? i can obviously do this in two steps: x=os.stat('/etc/passwd') type(x) class 'posix.stat_result' i'd just like to see that os.stat()

Re: exception due to NoneType

2009-11-07 Thread Bruno Desthuilliers
asit a écrit : In my program I want to catch exception which is caused by accessing NoneType object. Can anyone suggest me how this can be done ?? Not without the minimal working code exposing your problem, or the full traceback you got. Merely accessing NoneType object doesn't by itself

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Andre Engels
On Sat, Nov 7, 2009 at 6:40 PM, Mensanator mensana...@aol.com wrote: Tongue in cheek solution: import urllib2 url = 'http://primes.utm.edu/lists/small/1.txt' primes = [] for line in urllib2.urlopen(url).read().splitlines():     values = line.split()     if len(values) == 10:        

Re: Microsoft research on code quality

2009-11-07 Thread Bruno Desthuilliers
Aahz a écrit : http://research.microsoft.com/en-us/news/features/nagappan-100609.aspx An interesting reading. Thanks for the link. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to delete strings in a string list that that match certain pattern?

2009-11-07 Thread Peter Otten
Robert P. J. Day wrote: On Sat, 7 Nov 2009, Peng Yu wrote: On Fri, Nov 6, 2009 at 5:57 PM, Dave Angel da...@ieee.org wrote: But if you have an expression you want to match each dir against, the list comprehension is the best answer. And the trick to stuffing that new list into the

Re: how to display the return type of an os method?

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, Bruno Desthuilliers wrote: Robert P. J. Day a écrit : once again, a thoroughly newbie question but what's the quickest way to display the return type of, say, os.stat()? i can obviously do this in two steps: x=os.stat('/etc/passwd') type(x) class

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Bruno Desthuilliers
kj a écrit : As I said, this is considered an optimization, at least in Perl, because it lets the interpreter allocate all the required memory in one fell swoop, instead of having to reallocate it repeatedly as the array grows. IIRC, CPython has it's own way to optimize list growth. (Of

Re: exception due to NoneType

2009-11-07 Thread asit
On Nov 7, 10:36 pm, Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr wrote: asit a écrit : In my program I want to catch exception which is caused by accessing NoneType object. Can anyone suggest me how this can be done ?? Not without the minimal working code exposing your

database handling

2009-11-07 Thread asit
I need some tutorial about python-mysql connectivity(database handling). Somebody please help me !! -- http://mail.python.org/mailman/listinfo/python-list

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Luis Alberto Zarrabeitia Gomez
Quoting Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr: Another situation where one may want to do this is if one needs to initialize a non-sparse array in a non-sequential order, Then use a dict. Ok, he has a dict. Now what? He needs a non-sparse array. -- Luis

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Andre Engels
On Sat, Nov 7, 2009 at 8:25 PM, Luis Alberto Zarrabeitia Gomez ky...@uh.cu wrote: Quoting Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr: Another situation where one may want to do this is if one needs to initialize a non-sparse array in a non-sequential order, Then use a

Re: is None or == None ?

2009-11-07 Thread Terry Reedy
Steven D'Aprano wrote: On Fri, 06 Nov 2009 16:51:18 +0100, Marco Mariani wrote: Using x is y with integers makes no sense and has no guaranteed behaviour AFAIK Of course it makes sense. `x is y` means *exactly the same thing* for ints as it does with any other object: it tests for object

Re: Pyfora, a place for python

2009-11-07 Thread Terry Reedy
Saketh wrote: On Nov 4, 5:28 pm, Alan Franzoni doesnotex...@franzoni.invalid My small effort to create a place for discussing Python seems to have sparked a larger discussion than I had anticipated. My intent in creating Pyfora is not to splinter the community or encroach upon

Re: imputil.py, is this a bug ?

2009-11-07 Thread Terry Reedy
Stef Mientki wrote: Gabriel Genellina wrote: En Fri, 06 Nov 2009 18:33:37 -0300, Stef Mientki stef.mien...@gmail.com escribió: I get an error compiling with pyjamas, in the standard module imputil, _import_top_module Note that imputil is undocumented in 2.5, deprecated in 2.6 and

Re: Serious Privileges Problem: Please Help

2009-11-07 Thread Rami Chowdhury
On Saturday 07 November 2009 06:13:11 Victor Subervi wrote: I have a serious privileges problem that is making it impossible to serve python pages on a CentOS server. It appears that nobody on the CentOS discussion list has a solution to this problem. I'm desperate and hoping someone on this

Re: imputil.py, is this a bug ?

2009-11-07 Thread Terry Reedy
lkcl wrote: On Nov 7, 2:20 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: Yes, seems to be a bug. But given the current status of imputil, it's not likely to be fixed; certainly not in 2.5 which only gets security fixes now. well, that bug's not the only one. the other one that i

My own accounting python euler problem

2009-11-07 Thread vsoler
In the accounting department I am working for we are from time to time confronted to the following problem: A customer sends us a check for a given amount, but without specifying what invoices it cancels. It is up to us to find out which ones the payment corresponds to. For example, say that the

Re: My own accounting python euler problem

2009-11-07 Thread Jack Diederich
On Sat, Nov 7, 2009 at 4:39 PM, vsoler vicente.so...@gmail.com wrote: In the accounting department I am working for we are from time to time confronted to the following problem: [snip] For example, say that the customer has the following outstanding invoices:  $300, $200, $50; and say that the

Re: My own accounting python euler problem

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, vsoler wrote: In the accounting department I am working for we are from time to time confronted to the following problem: A customer sends us a check for a given amount, but without specifying what invoices it cancels. It is up to us to find out which ones the payment

Re: Serious Privileges Problem: Please Help

2009-11-07 Thread Victor Subervi
httpd.conf: VirtualHost *:80 ServerAdmin m...@creative.vi DocumentRoot /var/www/html/angrynates.com ServerName angrynates.com Options +ExecCGI -IncludesNoExec Directory /var/www/html/angrynates.com/global_solutions/* Options +ExecCGI AllowOverride Options AllowOverride FileInfo #AddHandler

Re: My own accounting python euler problem

2009-11-07 Thread Robert P. J. Day
On Sat, 7 Nov 2009, vsoler wrote: In the accounting department I am working for we are from time to time confronted to the following problem: A customer sends us a check for a given amount, but without specifying what invoices it cancels. It is up to us to find out which ones the payment

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Terry Reedy
Steven D'Aprano wrote: On Fri, 06 Nov 2009 18:46:33 -0800, gil_johnson wrote: I don't have the code with me, but for huge arrays, I have used something like: arr[0] = initializer for i in range N: arr.extend(arr) This doubles the array every time through the loop, and you can add the

Re: exception due to NoneType

2009-11-07 Thread Diez B. Roggisch
api = twitter.Api('asitdhal','swordfish') You just gave the world the account-information to your twitter-account. You'd rather change these asap, or somebody hijacks your account... Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: is None or == None ?

2009-11-07 Thread sturlamolden
On 6 Nov, 14:35, Alf P. Steinbach al...@start.no wrote: As I understand it, 'is' will always work and will always be efficient (it just checks the variable's type), while '==' can depend on the implementation of equality checking for the other operand's class. '==' checks for logical

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Ivan Illarionov
On Nov 6, 3:12 pm, kj no.em...@please.post wrote: The best I can come up with is this: arr = [None] * 100 Is this the most efficient way to achieve this result? It is the most efficient SAFE way to achieve this result. In fact, there IS the more efficient way, but it's dangerous,

Re: is None or == None ?

2009-11-07 Thread sturlamolden
On 6 Nov, 18:28, Alf P. Steinbach al...@start.no wrote: Dynamic allocation isn't hare-brained, but doing it for every stored integer value outside a very small range is, because dynamic allocation is (relatively speaking, in the context of integer operations) very costly even with a

Re: Command parsing... best module to use?

2009-11-07 Thread van Asselt
Hello Colin, I have been using 'cmdloop.py' from Crutcher Dunnavant in a few programs See http://py-cmdloop.googlecode.com/svn/trunk/cmdloop.py Regards, Henk - Collin D collin.da...@gmail.com wrote in message

Re: Program to compute and print 1000th prime number

2009-11-07 Thread Wayne Brehaut
On Sat, 7 Nov 2009 19:34:47 +0100, Andre Engels andreeng...@gmail.com wrote: On Sat, Nov 7, 2009 at 6:40 PM, Mensanator mensana...@aol.com wrote: Tongue in cheek solution: import urllib2 url = 'http://primes.utm.edu/lists/small/1.txt' primes = [] for line in

Re: Serious Privileges Problem: Please Help

2009-11-07 Thread Rami Chowdhury
On Saturday 07 November 2009 13:51:06 Victor Subervi wrote: httpd.conf: VirtualHost *:80 ServerAdmin m...@creative.vi DocumentRoot /var/www/html/angrynates.com ServerName angrynates.com Options +ExecCGI -IncludesNoExec Directory /var/www/html/angrynates.com/global_solutions/* You may

feedback on function introspection in argparse

2009-11-07 Thread Yuv
This was posted to the argparse mailing list by Steven Bethard and now we'd like some feedback from comp.lang.python. We now have a branch[5] of argparse that supports an ``argparse.run`` function[6] which does some function introspection to build a command line parser from a function definition:

Re: is None or == None ?

2009-11-07 Thread sturlamolden
On 6 Nov, 17:54, Alf P. Steinbach al...@start.no wrote: But wow. That's pretty hare-brained: dynamic allocation for every stored value outside the cache range, needless extra indirection for every operation. First, integers are not used the same way in Python as they are in C+ +. E.g. you

Re: exception due to NoneType

2009-11-07 Thread Bruno Desthuilliers
asit a écrit : On Nov 7, 10:36 pm, Bruno Desthuilliers bdesth.quelquech...@free.quelquepart.fr wrote: asit a écrit : In my program I want to catch exception which is caused by accessing NoneType object. Can anyone suggest me how this can be done ?? Not without the minimal working code

Re: database handling

2009-11-07 Thread Bruno Desthuilliers
asit a écrit : I need some tutorial about python-mysql connectivity(database handling). Somebody please help me !! You didn't search very far, did you ? http://wiki.python.org/moin/DatabaseProgramming/ -- http://mail.python.org/mailman/listinfo/python-list

Re: feedback on function introspection in argparse

2009-11-07 Thread geremy condra
On Sat, Nov 7, 2009 at 5:45 PM, Yuv ubershme...@gmail.com wrote: This was posted to the argparse mailing list by Steven Bethard and now we'd like some feedback from comp.lang.python. We now have a branch[5] of argparse that supports an ``argparse.run`` function[6] which does some function

Re: is None or == None ?

2009-11-07 Thread Steven D'Aprano
On Sat, 07 Nov 2009 14:22:28 -0800, sturlamolden wrote: On 6 Nov, 14:35, Alf P. Steinbach al...@start.no wrote: As I understand it, 'is' will always work and will always be efficient (it just checks the variable's type), while '==' can depend on the implementation of equality checking for

Re: exception due to NoneType

2009-11-07 Thread Ben Finney
asit lipu...@gmail.com writes: for s in users: print print ## try: print user id : + str(s.id) print user name : + s.name print user location : + s.location print user description : + s.description

Re: Microsoft research on code quality

2009-11-07 Thread Mensanator
On Nov 6, 3:15 pm, a...@pythoncraft.com (Aahz) wrote: http://research.microsoft.com/en-us/news/features/nagappan-100609.aspx -- Aahz (a...@pythoncraft.com)           *        http://www.pythoncraft.com/ [on old computer technologies and programmers]  Fancy tail fins on a brand new '59

Re: feedback on function introspection in argparse

2009-11-07 Thread Carl Banks
On Nov 7, 2:45 pm, Yuv ubershme...@gmail.com wrote: This was posted to the argparse mailing list by Steven Bethard and now we'd like some feedback from comp.lang.python. We now have a branch[5] of argparse that supports an ``argparse.run`` function[6] which does some function introspection

Re: feedback on function introspection in argparse

2009-11-07 Thread Yuv
On Nov 8, 1:33 am, Carl Banks pavlovevide...@gmail.com wrote: Is the docstring expected to be formatted according to some convention? Yes it does, we parse the docstring as explained in argparse.py: def _parse_docstring(function): Parses a function's docstring for a description of the

Spam Bot, broken pipe

2009-11-07 Thread Someone Something
I have a irc spam bot (only testing on my channel :P ) whose main loop is the following: privc=PRIVMSG +self.channel while True: self.sock.send(privc= :SPAM SPAM SPAM!); time.sleep(2); And it gives an error Broken Pipe. How can I fix this? --

How convert string '1e7' to an integer?

2009-11-07 Thread Peng Yu
It seems that int() does not convert '1e7'. I'm wondering what function to use to convert '1e7' to an integer? int('1e7') Traceback (most recent call last): File stdin, line 1, in module ValueError: invalid literal for int() with base 10: '1e7' --

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread Carl Banks
On Nov 7, 5:05 pm, sturlamolden sturlamol...@yahoo.no wrote: On 7 Nov, 03:46, gil_johnson gil_john...@earthlink.net wrote: I don't have the code with me, but for huge arrays, I have used something like: arr[0] = initializer for i in range N:      arr.extend(arr) This doubles the

Re: Most efficient way to pre-grow a list?

2009-11-07 Thread exarkun
On 01:18 am, pavlovevide...@gmail.com wrote: On Nov 7, 5:05�pm, sturlamolden sturlamol...@yahoo.no wrote: On 7 Nov, 03:46, gil_johnson gil_john...@earthlink.net wrote: I don't have the code with me, but for huge arrays, I have used something like: arr[0] = initializer for i in range N:

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Mensanator
On Nov 7, 7:17 pm, Peng Yu pengyu...@gmail.com wrote: It seems that int() does not convert '1e7'. Because 'e' isn't a valid character in base 10. I'm wondering what function to use to convert '1e7' to an integer? int('1e7') int(1e7) 1000 Traceback (most recent call last):   File

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Mick Krippendorf
Peng Yu wrote: It seems that int() does not convert '1e7'. It seems it does, though: int('1e7', base=16) 487 Mick. -- http://mail.python.org/mailman/listinfo/python-list

Re: How convert string '1e7' to an integer?

2009-11-07 Thread MRAB
Peng Yu wrote: It seems that int() does not convert '1e7'. I'm wondering what function to use to convert '1e7' to an integer? int('1e7') Traceback (most recent call last): File stdin, line 1, in module ValueError: invalid literal for int() with base 10: '1e7' In Python the e-form

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Ben Finney
Mick Krippendorf mad.m...@gmx.de writes: Peng Yu wrote: It seems that int() does not convert '1e7'. It seems it does, though: int('1e7', base=16) 487 Well played, sir. -- \ “It is wrong to think that the task of physics is to find out | `\ how nature *is*. Physics

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Gary Herron
Mensanator wrote: On Nov 7, 7:17 pm, Peng Yu pengyu...@gmail.com wrote: It seems that int() does not convert '1e7'. Because 'e' isn't a valid character in base 10. But 1e7 is a valid float, so this works: int(float('1e7')) 1000 That has a problem though, if you surpass the

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Benjamin Kaplan
On Sat, Nov 7, 2009 at 8:17 PM, Peng Yu pengyu...@gmail.com wrote: It seems that int() does not convert '1e7'. I'm wondering what function to use to convert '1e7' to an integer? int('1e7') Traceback (most recent call last):  File stdin, line 1, in module ValueError: invalid literal for

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Christian Heimes
Peng Yu wrote: It seems that int() does not convert '1e7'. I'm wondering what function to use to convert '1e7' to an integer? 1e7 is a way to express a float in science and math. Try float(1e7) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: How convert string '1e7' to an integer?

2009-11-07 Thread Tim Chase
Mick Krippendorf wrote: Peng Yu wrote: It seems that int() does not convert '1e7'. It seems it does, though: int('1e7', base=16) 487 Bah...so narrow-minded ;-) print '\n'.join(Base %i: %i % (base, int('1e7', base=base)) for base in range(15,37)) Base 15: 442 Base 16: 487 Base 17: 534

Spam Bot, broken pipe

2009-11-07 Thread Someone Something
I'm just testing it on my channel! I promise! Besides, I'm doing it to learn about sockets! Please! On Sat, Nov 7, 2009 at 8:07 PM, Krister Svanlund krister.svanl...@gmail.com wrote: On Sun, Nov 8, 2009 at 2:00 AM, Someone Something fordhai...@gmail.com wrote: I have a irc spam bot (only

Re: Web development with Python 3.1

2009-11-07 Thread Alan Harris-Reid
mario ruggier wrote: With respect to to original question regarding web frameworks + database and Python 3, all the following have been available for Python 3 since the day Python 3.0 was released: QP, a Web Framework http://pypi.python.org/pypi/qp/ Durus, a Python Object Database (the

Re: is None or == None ?

2009-11-07 Thread Hrvoje Niksic
Alf P. Steinbach al...@start.no writes: Speedup would likely be more realistic with normal implementation (not fiddling with bit-fields and stuff) I'm not sure I understand this. How would you implement tagged integers without encoding type information in bits of the pointer value? --

Re: PyQt processEvents not processing

2009-11-07 Thread DarkBlue
On Nov 8, 12:04 am, David Boddie da...@boddie.org.uk wrote: On Saturday 07 November 2009 05:12, DarkBlue wrote: qt 4.5.3 pyqt 4.6.1 python 2.6 I have this QtTable widget which I want to refresh once about every 2 seconds with new data. so I do :  def updateSchedule(self):    

Re: Spam Bot, broken pipe

2009-11-07 Thread Someone Something
anyone? On Sat, Nov 7, 2009 at 9:06 PM, Someone Something fordhai...@gmail.comwrote: I'm just testing it on my channel! I promise! Besides, I'm doing it to learn about sockets! Please! On Sat, Nov 7, 2009 at 8:07 PM, Krister Svanlund krister.svanl...@gmail.com wrote: On Sun, Nov 8,

Cancelling a python thread (revisited...)

2009-11-07 Thread Sven Marnach
Hi, the Python threading module does not seem to provide a means to cancel a running thread. There are many discussions on the web dealing with this issue and many solutions are offered, but none of them seems to be applicable to my situation, which is as follows: I have a C library which does

Re: An assessment of Tkinter and IDLE

2009-11-07 Thread r
More on canvas widget... The Canvas widget should return objects and not simple tags/ids for canvas items *OR* at least allow for me to add attributes to the canvasitems obj. I find that the id/tag system --while quite simple and strait forward-- can really leave you with both hands tied behind

Re: Cancelling a python thread (revisited...)

2009-11-07 Thread Carl Banks
On Nov 7, 6:04 pm, Sven Marnach s...@pantoffel-wg.de wrote: So do I really have to refactor my C library just because Python Thread objects lack a cancel method?  Is there really no other way? It doesn't sound like the thread is communicating with the process much. Therefore: 1. Run the C

How to parse HTTP time header?

2009-11-07 Thread Kevin Ar18
Basically, I'm wondering if it is part of the standard library somewhere before I code my own. Page 20 of RFC2616 (HTTP) describes the format(s) for the time header. It wouldn't be too difficult for me to code up a solution for the 3 standard formats, but what get's me is the little note

Re: How to parse HTTP time header?

2009-11-07 Thread Philip Semanchuk
On Nov 7, 2009, at 10:39 PM, Kevin Ar18 wrote: Basically, I'm wondering if it is part of the standard library somewhere before I code my own. Page 20 of RFC2616 (HTTP) describes the format(s) for the time header. It wouldn't be too difficult for me to code up a solution for the 3

  1   2   >