Re: Redirecting STDOUT to a Python Variable

2010-06-22 Thread Paul Rubin
Anthony Papillion writes: > I'm writing an application that uses the Google Storage Python > library. When an error occurs, the error is printed on the terminal. > What I need to do is intercept that text into a variable so I can run > a re.search() against it and find out what's going on. I'm u

Jason Bermas EXPOSES Terrorism of FBI MOTHER FoKERS on the PRIME TIME MEDIA - Jason Bermas is a JEW

2010-06-22 Thread nanothermite911fbibustards
Jason Bermas EXPOSES Terrorism of FBI MOTHER FoKERS on the PRIME TIME MEDIA - Jason Bermas is a JEW http://www.youtube.com/watch?v=kTn-w3xjprg&feature=related INCOMPETENT and CRIMINALLY RACIST , FBI mother fucking bastards who HAVE BEEN ACCUSED Publicly by a JEW , movie maker and 911 TRUTH SPRE

Redirecting STDOUT to a Python Variable

2010-06-22 Thread Anthony Papillion
I'm writing an application that uses the Google Storage Python library. When an error occurs, the error is printed on the terminal. What I need to do is intercept that text into a variable so I can run a re.search() against it and find out what's going on. I thought doing a output_text = method_n

Re: Redirecting STDOUT to a Python Variable

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 4:10 PM, Anthony Papillion wrote: > I'm writing an application that uses the Google Storage Python > library.  When an error occurs, the error is printed on the terminal. > What I need to do is intercept that text into a variable so I can run > a re.search() against it and

Re: Redirecting STDOUT to a Python Variable

2010-06-22 Thread Steven D'Aprano
On Mon, 21 Jun 2010 23:10:56 -0700, Anthony Papillion wrote: > I'm writing an application that uses the Google Storage Python library. > When an error occurs, the error is printed on the terminal. What I need > to do is intercept that text into a variable so I can run a re.search() > against it a

Re: tkInter Listbox question

2010-06-22 Thread eb303
On Jun 21, 6:36 pm, rantingrick wrote: > On Jun 21, 12:36 am, Anthony Papillion wrote: > > > So I'm trying to add a Listbox to my window. I want it to be the width > > of my window and the height of my window.  I'm using the following > > code ('root' is my toplevel window): > > > gsItems = Listb

Should I Learn Python or Ruby next?

2010-06-22 Thread Josef Tupag
I've been programming (when I do program) mainly in Perlfor the last 10 years or so. But I've been itching to learn a new language for a while now, and the two near the top of the list are Rubyand Python . I figure that Ruby woul

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 6:58 PM, Josef Tupag wrote: > Before I really dive in, though, I'm curious to hear what others think about > the choice between these two languages. This is a terribly subjective opinion and I apologize to anyone that actually uses Ruby and likes it :) I find Ruby (compar

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Shashwat Anand
Josef: Make sure you ask this question on Ruby mailing list too. Just like James I too am personally biased towards python and so will be a lot of people on this list. On Tue, Jun 22, 2010 at 2:50 PM, James Mills wrote: > On Tue, Jun 22, 2010 at 6:58 PM, Josef Tupag wrote: > > Before I really di

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Jean-Michel Pichavant
Josef Tupag wrote: I've been programming (when I do program) mainly in Perl for the last 10 years or so. But I've been itching to learn a new language for a while now, and the two near the top of the list are Ruby and Python

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 7:29 PM, Jean-Michel Pichavant wrote: > This is a python list, fully dedicated to our dutch semi God. So how can you > even immagine that someone here will suggest you to go for rub... sorry I > can't prononce this blasphemous name. Good call :) (Personally - and again sor

Re: [Python-Dev] adding new function

2010-06-22 Thread Daniel Fetchinson
> how can i simply add new functions to module after its initialization > (Py_InitModule())? I'm missing something like > PyModule_AddCFunction(). This type of question really belongs to python-list aka comp.lang.python which I CC-d now. Please keep the discussion on that list. Cheers, Daniel

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Thomas Jollans
On 06/22/2010 10:58 AM, Josef Tupag wrote: > I've been programming (when I do program) mainly in Perl > for the last 10 years or so. But I've been > itching to learn a new language for a while now, and the two near the > top of the list are Ruby an

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread lkcl
On Tue, Jun 22, 2010 at 6:58 PM, Josef Tupag wrote: > Before I really dive in, though, I'm curious to hear what others think about > the choice between these two languages. i think one good illustration is a story i heard from someone who had learned a hell of a lot of programming languages, but

From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
Hi, Sorry for the long mail but I've been searching the web for days for how to do this.. I see that possibilities using shelve or pickle but I don't want to do this (The source of the data changes constantly) I'm learning Python and very much a beginner with Classes. I have data like this: (h

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Michael Crute
On Tue, Jun 22, 2010 at 4:58 AM, Josef Tupag wrote: > I've been programming (when I do program) mainly in Perl for the last 10 > years or so. But I've been itching to learn a new language for a while now, > and the two near the top of the list are Ruby and Python. If you have the time give both a

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andre Alexander Bell
On 06/22/2010 12:05 PM, Jerry Rocteur wrote: > Sorry for the long mail but I've been searching the web for days for how to > do this.. I see that possibilities using > shelve or pickle but I don't want to do this (The source of the data changes > constantly) You might be interested in the csv mo

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On 06/22/2010 12:05 PM, Jerry Rocteur wrote: >> Sorry for the long mail but I've been searching the web for days for how to >> do this.. I see that possibilities using >> shelve or pickle but I don't want to do this (The source of the data changes >> constantly) > > You might be interested in t

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Nathan Rice
It really depends on what you want to do. Ruby and Python are both highly expressive languages. Python syntax seems "nicer" to me but that is subjective. As far as community support, Python has 4342 packages listed in sourceforge, Ruby has 705. Python is listed in ~0.4% of jobs at indeed.com's

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andre Alexander Bell
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/22/2010 01:32 PM, Jerry Rocteur wrote: > My input is NOT CSV, I used this format to try and make the question shorter. > Although I could create a CSV file, I'd > like to learn how to code a class to work the way I described in the question. So

Re: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > My input is NOT CSV, I used this format to try and make the question shorter. > Although I could create a CSV file, I'd > like to learn how to code a class to work the way I described in the question. Your input certainly looks CSV-ish to m

Re: question about multiprocessing

2010-06-22 Thread Gabriel Genellina
En Sun, 20 Jun 2010 09:43:09 -0300, hywhy escribió: from multiprocessing.managers import BaseManager import Queue class CrawlerManager(BaseManager): pass downloader_queue = Queue.Queue() downloader_queue.put('hello') CrawlerManager.register('get_downloader_queue', callable=lambda: downlo

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 9:37 PM, Nathan Rice wrote: > As far as community support, Python has 4342 packages listed in sourceforge, > Ruby has 705.  Python is listed in ~0.4% of jobs at indeed.com's trend You are forgetting the 10278 (last count) or so packages, modules and what not available on P

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/22/2010 01:32 PM, Jerry Rocteur wrote: >> My input is NOT CSV, I used this format to try and make the question >> shorter. Although I could create a CSV file, >> I'd >> like to learn how to code a class to work the way I described in the

Re: What is the difference between 'type' and 'class'?

2010-06-22 Thread Duncan Booth
Peng Yu wrote: > pydoc xrange says: > > Help on class xrange in module __builtin__: > > class xrange(object) > > python_2.6.5_library.pdf says: > > Objects of type xrange are similar to buffers > > Are type and class synonyms? It seems that they are at least according > to some webpages that

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Re: Serialization, save type information in file and restore them

2010-06-22 Thread Gabriel Genellina
En Fri, 18 Jun 2010 08:24:01 -0300, Timothy Wu <2hug...@gmail.com> escribió: I created a class that's able to manipulate tabulated data. I want to be able to dump the bulk of the data and other attributes as a tab-delimited text. I have trouble saving/restoring type information in the file. Fo

Re: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 9:56 PM, Jerry Rocteur wrote: > As part of learning Python, I'm also learning OOP! That is why I want to know > if this is doable using classes. > > The input is not important, I end up with the dictionary as described in the > question and as I asked in the question, > I

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 10:03 PM, Jerry Rocteur wrote: > How do I iterate through and access an individual user record! A much better question! :) You are in fact already demonstrating that you know full well how to access a specific user record - by accessing a parent dictionary holding a mappi

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Bruno Desthuilliers
Jerry Rocteur a écrit : (snip) As part of learning Python, I'm also learning OOP! That is why I want to know if this is doable using classes. > The input is not important, I end up with the dictionary as described in the question and as I asked in the question, I'd like to access the dictiona

Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Jerry Rocteur
> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: > If you were able to ask us perhaps a more specific question > and describe your problem a little more concisely perhaps > I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user': key,

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread James Mills
On Tue, Jun 22, 2010 at 10:03 PM, Jerry Rocteur wrote: >> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: >> If you were able to ask us perhaps a more specific question >> and describe your problem a little more concisely perhaps >> I (and we) might have a bit more to offer you. > > I have

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Andre Alexander Bell
On 06/22/2010 02:03 PM, Jerry Rocteur wrote: >> On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: >> If you were able to ask us perhaps a more specific question >> and describe your problem a little more concisely perhaps >> I (and we) might have a bit more to offer you. > > I have a dictiona

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Jean-Michel Pichavant
Jerry Rocteur wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/22/2010 01:32 PM, Jerry Rocteur wrote: My input is NOT CSV, I used this format to try and make the question shorter. Although I could create a CSV file, I'd like to learn how to code a class to work the way I describ

xmlrpclib and errcode -1

2010-06-22 Thread Pasi Oja-Nisula
I have a xmlrpc server and client running on same Windows computer. The server is part of a bigger program and client is a Cherrypy application that provides a http interface to this program. Problem is that sometimes (1 out of 100) I get xmlrpc ProtocolError without no apparent reason. The server

Re: Second attempt WAS: From Dict to Classes yes or no and how

2010-06-22 Thread Dave Angel
Jerry Rocteur wrote: On Tue, Jun 22, 2010 at 9:32 PM, Jerry Rocteur wrote: If you were able to ask us perhaps a more specific question and describe your problem a little more concisely perhaps I (and we) might have a bit more to offer you. I have a dictionary: users[key] = {'user'

Book review / advise

2010-06-22 Thread lallous
Hello, I wonder if anyone read this: http://www.amazon.com/PYTHON-2-6-Extending-Embedding-documentation/dp/1441419608/ref=sr_1_7?ie=UTF8&s=books&qid=1277214352&sr=1-7 or this: http://www.amazon.com/Python-Extending-Embedding-Documentation-Manual/dp/1441412743/ref=pd_sim_b_3 Are these books just a

encodings.idna.ToASCII( unicodeStr ) != unicodeStr.encode( 'idna' )

2010-06-22 Thread python
Python 2.6.4 (Win32): Anyone have any explanation for the following encodings.idna.ToASCII( unicodeStr ) != unicodeStr.encode( 'idna' ) Given that other processes may have to use the output of these methods, what is the recommended technique? Demonstration: >>> import encodings.idna >>> name =

Simple list problem that's defeating me!

2010-06-22 Thread Neil Webster
Hi all, I've got a simple problem but it's defeated me and I was wondering if somebody could point out where I'm going wrong or offer an alternative solution to the problem? I have a list of lists such as [[a,2,3,4],[b,10,11,12], [a,2,3,4]]. I need to combine the two lists that have the same fir

Re: Book review / advise

2010-06-22 Thread lallous
Hi again, Well, it seems the printed version of the manual. Can anyone suggest a nice book to learn more about the Python C Api? Thanks, Elias -- http://mail.python.org/mailman/listinfo/python-list

Re: Book review / advise

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 12:14 AM, lallous wrote: > Well, it seems the printed version of the manual. Can anyone suggest a > nice book to learn more about the Python C Api? It's not really a book, but how about the source ? If you're a competent C programmer you're not really going to even need a

Re: Simple list problem that's defeating me!

2010-06-22 Thread Xavier Ho
On 23 June 2010 00:06, Neil Webster wrote: > Hi all, > > I've got a simple problem but it's defeated me and I was wondering if > somebody could point out where I'm going wrong or offer an alternative > solution to the problem? > > I have a list of lists such as [[a,2,3,4],[b,10,11,12], [a,2,3,4]]

Re: Book review / advise

2010-06-22 Thread lallous
Hi James, For me it is not a matter of competency to seek a book: organized, structured and uniform way of presenting information. Nonetheless, I always refer to the sources to get my questions answered...but a book (with the qualities I mentioned above) would make everyone's life easier. :) On

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
On 6/22/10 4:51 AM, James Mills wrote: > On Tue, Jun 22, 2010 at 9:37 PM, Nathan Rice > wrote: >> As far as community support, Python has 4342 packages listed in sourceforge, >> Ruby has 705. Python is listed in ~0.4% of jobs at indeed.com's trend > > You are forgetting the 10278 (last count) or

Re: Simple list problem that's defeating me!

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 12:06 AM, Neil Webster wrote: > I've got a simple problem but it's defeated me and I was wondering if > somebody could point out where I'm going wrong or offer an alternative > solution to the problem? Is this a hypothetical/mathematical problem of sorts ? If so, do you ha

Google Adsense Account Approval With In 4 Hours

2010-06-22 Thread tapaas
Google adsense account with in 4 hours. Send your name,address and phone number to "earnmoney9...@gmail.com". I will give ur account with in 4hrs. secure and Safe Account Approval , approved directly by adsense team. -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple list problem that's defeating me!

2010-06-22 Thread Mark Lawrence
On 22/06/2010 15:06, Neil Webster wrote: Hi all, I've got a simple problem but it's defeated me and I was wondering if somebody could point out where I'm going wrong or offer an alternative solution to the problem? I have a list of lists such as [[a,2,3,4],[b,10,11,12], [a,2,3,4]]. I need to c

Re: Book review / advise

2010-06-22 Thread Tim Golden
On 22/06/2010 15:27, lallous wrote: Hi James, For me it is not a matter of competency to seek a book: organized, structured and uniform way of presenting information. Nonetheless, I always refer to the sources to get my questions answered...but a book (with the qualities I mentioned above) woul

Using Unicode file names with ftplib and encodings.idna as a workaround?

2010-06-22 Thread python
Python 2.6.5 (Win32): Is there a work around for ftplib's (and ftputil's) apparent inability to support Unicode file names? I'm thinking that I might be able to use the encodings.idna as a work around for this? In other words, regardless of whether I'm getting or putting a file to the server, I w

Re: Book review / advise

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 12:27 AM, lallous wrote: > For me it is not a matter of competency to seek a book: organized, > structured and uniform way of presenting information. > > Nonetheless, I always refer to the sources to get my questions > answered...but a book (with the qualities I mentioned a

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread D'Arcy J.M. Cain
On Tue, 22 Jun 2010 03:02:15 -0700 (PDT) lkcl wrote: > so whilst ruby may be dynamic and compact, it's not beautiful, > readable or obvious as to what's going on. i look at a python > program, and it uses actual... like... y'know... words that make Python is executible pseudocode. -- D'Arcy J

Re: Book review / advise

2010-06-22 Thread lallous
On Jun 22, 4:49 pm, James Mills wrote: > On Wed, Jun 23, 2010 at 12:27 AM, lallous wrote: > > For me it is not a matter of competency to seek a book: organized, > > structured and uniform way of presenting information. > > > Nonetheless, I always refer to the sources to get my questions > > answe

Re: Simple list problem that's defeating me!

2010-06-22 Thread Bruno Desthuilliers
Neil Webster a écrit : Hi all, I've got a simple problem but it's defeated me and I was wondering if somebody could point out where I'm going wrong 1/ not posting working code (got a NameError) 2/ not posting the expected output 3/ not posting the actual output or offer an alternative soluti

Why 'open' is not a function according to inspect module?

2010-06-22 Thread Peng Yu
Hi, 'open' is not a function according to inspect module. But according to help(open), it is a function. Is there something wrong with inspect module? $ cat main.py #!/usr/bin/env python import inspect def hello(): print "Hello World!" return print inspect.isfunction(str) print inspect.isf

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
On 6/22/10 6:48 AM, lallous wrote: > Hello, > > I wonder if anyone read this: > http://www.amazon.com/PYTHON-2-6-Extending-Embedding-documentation/dp/1441419608/ref=sr_1_7?ie=UTF8&s=books&qid=1277214352&sr=1-7 > or this: > http://www.amazon.com/Python-Extending-Embedding-Documentation-Manual/dp/14

Why inspect.getsource() can not getsource for a class?

2010-06-22 Thread Peng Yu
Hi, It seems I don't completely understand how getsource works, as I expect that I should get the source code of class A. But I don't. Would you please let me know what I am wrong? $ cat main.py #!/usr/bin/env python import inspect class A: pass a=A() print inspect.getsource(a) $ ./main.py

Re: Why 'open' is not a function according to inspect module?

2010-06-22 Thread Ian Kelly
On Tue, Jun 22, 2010 at 9:42 AM, Peng Yu wrote: > Hi, > > 'open' is not a function according to inspect module. But according to > help(open), it is a function. Is there something wrong with inspect > module? > > $ cat main.py > #!/usr/bin/env python > > import inspect > > def hello(): >  print "H

Re: Why 'open' is not a function according to inspect module?

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 1:42 AM, Peng Yu wrote: > 'open' is not a function according to inspect module. But according to > help(open), it is a function. Is there something wrong with inspect > module? $ python Python 2.6.5 (r265:79063, Jun 13 2010, 14:03:16) [GCC 4.4.4 (CRUX)] on linux2 Type "hel

Re: Why inspect.getsource() can not getsource for a class?

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 1:53 AM, Peng Yu wrote: > It seems I don't completely understand how getsource works, as I > expect that I should get the source code of class A. But I don't. > Would you please let me know what I am wrong? If you "read" the documentation carefully: """ getsource(objec

Re: Why inspect.getsource() can not getsource for a class?

2010-06-22 Thread Ian Kelly
On Tue, Jun 22, 2010 at 9:53 AM, Peng Yu wrote: > Hi, > > It seems I don't completely understand how getsource works, as I > expect that I should get the source code of class A. But I don't. > Would you please let me know what I am wrong? > > $ cat main.py > #!/usr/bin/env python > > import inspec

Information about PHP + MySQL E-book

2010-06-22 Thread J3p
Hi, I need some Information from you. Someone told me to buy E-book about PHP + MySQL in http://php-mysql-ebook.blogspot.com Does anyone have experience about this? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Information about PHP + MySQL E-book

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 2:15 AM, J3p wrote: > Hi, I need some Information from you. Someone told me to buy E-book > about PHP + MySQL in > http://php-mysql-ebook.blogspot.com > Does anyone have experience about this? This has nothing whatsoever to do with Python except that Python has MySQL drive

print line number and source filename

2010-06-22 Thread Peng Yu
I want to print filename and line number for debugging purpose. So far I only find how to print the line number but not how to print filename. import inspect print inspect.currentframe().f_lineno I found inspect.getsourcefile(), but I have to supply a class name to it. I have searched online, but

Re: print line number and source filename

2010-06-22 Thread Shashwat Anand
22:26:51 l0nwlf-MBP:~/Desktop$ cat test.py print __file__ 22:26:55 l0nwlf-MBP:~/Desktop$ python test.py test.py On Tue, Jun 22, 2010 at 10:26 PM, Shashwat Anand wrote: > you can use __file__ > > > On Tue, Jun 22, 2010 at 10:14 PM, Peng Yu wrote: > >> I want to print filename and line number fo

Re: print line number and source filename

2010-06-22 Thread Stephen Hansen
On 6/22/10 9:44 AM, Peng Yu wrote: > Also, always importing the inspect module and getting the frame and > accessing the lineno from the frame is not very convenient to type. Is > there a shorter way to access the line number (for example, in C++ and > perl, __LINE__ can be used to access line numb

Re: adding new function

2010-06-22 Thread Terry Reedy
On 6/22/2010 5:44 AM, Daniel Fetchinson wrote: how can i simply add new functions to module after its initialization (Py_InitModule())? I'm missing something like PyModule_AddCFunction(). in Python, for modules written in python import mymod mymod.fname = somefunc #or setattr(mymod, namestrin

Re: print line number and source filename

2010-06-22 Thread Shashwat Anand
you can use __file__ On Tue, Jun 22, 2010 at 10:14 PM, Peng Yu wrote: > I want to print filename and line number for debugging purpose. So far > I only find how to print the line number but not how to print > filename. > > import inspect > print inspect.currentframe().f_lineno > > I found inspec

Re: print line number and source filename

2010-06-22 Thread Shashwat Anand
begin - import logging logging.basicConfig(level=logging.DEBUG,format="%(asctime)s" "%(levelname)-5.5s [%(name)s %(module)s:%(funcName)s:%(lineno)d]" "%(message)s") def run(): x = 5 logging.debug("X = %d" % x) run() - end - You can probably use string default concatenation

Re: Book review / advise

2010-06-22 Thread Terry Reedy
On 6/22/2010 11:49 AM, Stephen Hansen wrote: On 6/22/10 6:48 AM, lallous wrote: Hello, I wonder if anyone read this: http://www.amazon.com/PYTHON-2-6-Extending-Embedding-documentation/dp/1441419608/ref=sr_1_7?ie=UTF8&s=books&qid=1277214352&sr=1-7 or this: http://www.amazon.com/Python-Extending-

Re: Book review / advise

2010-06-22 Thread Stephen Hansen
On 6/22/10 11:01 AM, Terry Reedy wrote: > On 6/22/2010 11:49 AM, Stephen Hansen wrote: >> Uhh, that looks like a scam. Someone scraped the Python docs and bundled >> it up as a "book" to sell to naive people for outrageous prices; > > Various people have asked on this list for printed versions of

*** Proof - JEWS - the Enslavers of the Blacks ***

2010-06-22 Thread nanothermite911fbibustards
http://www.youtube.com/watch?v=kTn-w3xjprg&feature=related watch this Israel's deadly attack on USS Liberty emerges from the past http://www.youtube.com/watch?v=f98jxoUUrzg&feature=fvsr http://www.youtube.com/watch?v=52fm6zAHa-w http://www.youtube.com/watch?v=qL9hGmfGTXc The Secret Relationshi

Re: Why 'open' is not a function according to inspect module?

2010-06-22 Thread Terry Reedy
On 6/22/2010 11:42 AM, Peng Yu wrote: 'open' is not a function according to inspect module. If you want to *learn* Python, perhaps you should ignore the inspect module. It is for advanced purposes. I only used it a couple of times in 13 years. If you want to know what something literally i

Re: print line number and source filename

2010-06-22 Thread Stephen Hansen
On 6/22/10 10:26 AM, Shashwat Anand wrote: > begin - > import logging > logging.basicConfig(level=logging.DEBUG,format="%(asctime)s" > "%(levelname)-5.5s [%(name)s %(module)s:%(funcName)s:%(lineno)d]" > "%(message)s") > > def run(): >x = 5 >logging.debug("X = %d" % x) > > run() >

Python-URL! - weekly Python news and links (Jun 22)

2010-06-22 Thread Cameron Laird
QOTW: "It's hard to overestimate the variance you'll see when you start asking your users for information." - Cody Powell http://www.codypowell.com/taods/2010/01/production-aint-pretty-a-case-for-excessive-application-logging.html The second Release Candidate of Python 2.7 is available fo

conceptual model diagram builder

2010-06-22 Thread Aaron Watters
Hi folks. I design a lot of conceptual models and I usually do it on paper or on a white board. I sometimes need to send an image of a conceptual model (not a photo) and I really don't know of a good tool which works the way I'd like to make images of conceptual models. Particularly I'd like the

Re: Book review / advise

2010-06-22 Thread John Bokma
Stephen Hansen writes: > On 6/22/10 6:48 AM, lallous wrote: >> Hello, >> >> I wonder if anyone read this: >> http://www.amazon.com/PYTHON-2-6-Extending-Embedding-documentation/dp/1441419608/ref=sr_1_7?ie=UTF8&s=books&qid=1277214352&sr=1-7 >> or this: >> http://www.amazon.com/Python-Extending-Emb

Re: Information about PHP + MySQL E-book

2010-06-22 Thread John Bokma
James Mills writes: > On Wed, Jun 23, 2010 at 2:15 AM, J3p wrote: >> Hi, I need some Information from you. Someone told me to buy E-book >> about PHP + MySQL in >> http:// >> Does anyone have experience about this? > > This has nothing whatsoever to do with Python > except that Python has MySQL

Re: Information about PHP + MySQL E-book

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 6:10 AM, John Bokma wrote: > My guess is that this is just spam for a blog. Please don't copy > spamvertized URLs. My bad :/ -- -- -- "Problems are solved by method" -- http://mail.python.org/mailman/listinfo/python-list

mysql query results to web page

2010-06-22 Thread Greg
I'd like to query my local MySQL db and send the results to a locally served web page. I've poked around and found complex examples using web2py and pylons What's best for beginners? Can somebody lay out the basic steps for me? thanks, Greg -- http://mail.python.org/mailman/listinfo/python

Uses of a deprecated module 'string'

2010-06-22 Thread Steven Howe
Hi, I'm trying to import 'letters' from the string module. I get the following message: Uses of a deprecated module 'string' I realize the functionality of 'string' is now in the _builtin_. But are the constants. If so, what are they called. I tried 'letters', but got: NameError: name '

Re: Uses of a deprecated module 'string'

2010-06-22 Thread James Mills
On Wed, Jun 23, 2010 at 7:11 AM, Steven Howe wrote: > Hi, I'm trying to import 'letters' from the string module. > I get the following message: > >    Uses of a deprecated module 'string' > > I realize the functionality of 'string' is now in the _builtin_. But are the > constants. If so, what are

Re: mysql query results to web page

2010-06-22 Thread Aaron Watters
On Jun 22, 4:50 pm, Greg wrote: > I'd like to query my local MySQL db and send the results to a locally > served web page.  I've poked around and found complex examples using > web2py and pylons What's best for beginners?  Can somebody lay out > the basic steps for me? > > thanks, > > Greg Yo

Re: Uses of a deprecated module 'string'

2010-06-22 Thread Thomas Jollans
On 06/22/2010 11:11 PM, Steven Howe wrote: > Hi, I'm trying to import 'letters' from the string module. > I get the following message: > > Uses of a deprecated module 'string' > > I realize the functionality of 'string' is now in the _builtin_. But are > the > constants. If so, what are they

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 19:38:43 +1000 James Mills wrote: > When I came across Rub* I found it to be just a rip-off of Python (in > some respects) and couldn't understand how it became popular so > quickly :) You answered your own question: It's a rip-off of Python. On a more serious note, though,

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 10:49:49 -0400 "D'Arcy J.M. Cain" wrote: > Python is executible pseudocode. > I don't know about you, but if I didn't know this to be praise, it'd sound like an insult to me. As in "Timecube is expendable pseudoscience". Phrases like "Your mother [has property x]" have the

Re: From Dict to Classes yes or no and how

2010-06-22 Thread Andreas Waldenburger
On Tue, 22 Jun 2010 13:56:43 +0200 (CEST) "Jerry Rocteur" wrote: > As part of learning Python, I'm also learning OOP! That is why I want > to know if this is doable using classes. Everything[1] is doable using classes. The question is: Do you *need* to do it with classes? If your problem is best

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread geremy condra
On Tue, Jun 22, 2010 at 1:58 AM, Josef Tupag wrote: > I've been programming (when I do program) mainly in Perl for the last 10 > years or so. But I've been itching to learn a new language for a while now, > and the two near the top of the list are Ruby and Python. My advice is to learn something

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
On 6/22/10 3:35 PM, geremy condra wrote: > On Tue, Jun 22, 2010 at 1:58 AM, Josef Tupag wrote: >> I've been programming (when I do program) mainly in Perl for the last 10 >> years or so. But I've been itching to learn a new language for a while now, >> and the two near the top of the list are Ruby

Re: Where is the help function defined?

2010-06-22 Thread Trent Mick
On 10-06-21 10:57 AM, Emile van Sebille wrote: On 6/21/2010 10:17 AM Peng Yu said... help(help) gives me the following explanation. I then looked at pydoc site. But I don't see an entry on help(). How to figure out where help() (or a function in general) is defined? ActivePython 2.4.1 Bui

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread John Bokma
geremy condra writes: > On Tue, Jun 22, 2010 at 1:58 AM, Josef Tupag wrote: >> I've been programming (when I do program) mainly in Perl for the last 10 >> years or so. But I've been itching to learn a new language for a while now, >> and the two near the top of the list are Ruby and Python. > >

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread rantingrick
Quotes for this thread... On Jun 22, 4:20 am, James Mills wrote: > I find Ruby (compared to Python) to be a syntactical rip-off and > a bad one at that. Some things in Ruby aren't nearly as simple or > as concise as you would find in Python. --- On Jun 22, 4:29 am, Jean-Michel Pichavant wrote

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Rhodri James
On Wed, 23 Jun 2010 00:09:15 +0100, rantingrick wrote: ...After reading these comments i reminisce back to a time when a good friend of this community "r" said basically the same things but was lynched for them. Hmm? Has the community changed? Or is it that these comments came from someone ot

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Stephen Hansen
On 6/22/10 4:09 PM, rantingrick wrote: > ...After reading these comments i reminisce back to a time when a good > friend of this community "r" said basically the same things but was > lynched for them. Hmm? Has the community changed? Or is it that these > comments came from someone other than "r" t

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Thomas Jollans
On 06/23/2010 01:30 AM, Stephen Hansen wrote: > On 6/22/10 4:09 PM, rantingrick wrote: >> ...After reading these comments i reminisce back to a time when a good >> friend of this community "r" said basically the same things but was >> lynched for them. Hmm? Has the community changed? Or is it that

Re: Uses of a deprecated module 'string'

2010-06-22 Thread rantingrick
On Jun 22, 4:37 pm, Thomas Jollans wrote: > Looks like `letters' has been renamed to `ascii_letters'. ASCII rubutted: Really it's more like "asc-bye-bye_letters". They keep shoving me more and more under the carpet! And that big fat glory hog Unicode is really stating to get on my nerves!" Just

Re: Should I Learn Python or Ruby next?

2010-06-22 Thread Emile van Sebille
On 6/22/2010 4:09 PM rantingrick said... ...After reading these comments i reminisce back to a time when a good friend of this community "r" said basically the same things but was lynched for them.Hmm? Has the community changed? Or is it that these comments came from someone other than "r" that

Re: Uses of a deprecated module 'string'

2010-06-22 Thread Stephen Hansen
On 6/22/10 4:53 PM, rantingrick wrote: > On Jun 22, 4:37 pm, Thomas Jollans wrote: >> Looks like `letters' has been renamed to `ascii_letters'. > > > ASCII rubutted: > Really it's more like "asc-bye-bye_letters". They keep shoving me > more and more under the carpet! And that big fat glory hog

TkInter bind() event is not firing event trigger

2010-06-22 Thread Anthony Papillion
So I want to execute some code when the user double clicks an item in a ListBox. The documentation says I should use the listbox.bind() method, specifying the Double-l event to detect the double left mouse button click. My code is this: gsItems = Listbox(root, width=76, height=30, selectmode="brow

  1   2   >