Re: Finding the name of a function while defining it

2012-12-29 Thread Jussi Piitulainen
Abhas Bhattacharya writes: [...] > If i call one() and two() respectively, i would like to see "one" > and "two". I dont have much knowledge of lambda functions, neither > am i going to use them, so that's something I cant answer. It's not about lambda. The following does not contain lambda. Wha

Re: email.message.Message - as_string fails

2012-12-29 Thread Helmut Jarausch
On Fri, 28 Dec 2012 20:57:46 -0500, Terry Reedy wrote: > On 12/28/2012 7:22 AM, Helmut Jarausch wrote: >> Hi, >> >> I'm trying to filter an mbox file by removing some messages. >> For that I use Parser= FeedParser(policy=policy.SMTP) >> and 'feed' any lines to it. >> If the mbox file contains a wh

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Morten Engvoldsen
Hi Dave, Thanks for reply. I will really appreciate if you reply to my mail id and keep python list in cc, since everytime you reply my query i need to search the reply in the forwarding message of python list. Using logger.setLevel(logging.DEBUG) will log only debug message in the log file and di

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Chris Angelico
On Sat, Dec 29, 2012 at 11:39 PM, Morten Engvoldsen wrote: > Hi Dave, > Thanks for reply. I will really appreciate if you reply to my mail id and > keep python list in cc, since everytime you reply my query i need to search > the reply in the forwarding message of python list. The normal thing to

Re: PYTHON 3.3 + GUI + COMPILE

2012-12-29 Thread Kwpolska
On Fri, Dec 28, 2012 at 3:08 AM, Dimitrios Xenakis wrote: > Morning, > I have been looking for a library solution of both GUI and Compiler but for > Python 3.3 and ofcourse i was hoping for a combination that would be most > compatible between them. After searching i may have concluded to cx_Fre

Re: Confused about logger config from within Python (3)

2012-12-29 Thread Roy Smith
In article <50de7a0a$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > In Python 3.2 and 3.3, the message about no handlers is not printed, > which is an interesting difference. (Somebody who knows more about the > logging package than I do might be able to state why that d

Re: noob can't install python modules/scripts

2012-12-29 Thread Joel Goldstick
On Fri, Dec 28, 2012 at 11:40 PM, lostguru wrote: > On Friday, December 28, 2012 11:12:19 PM UTC-5, Steven D'Aprano wrote: > > "The website"? There's more than one website on the Internet. Which > > > > website are you referring to? What .py script did you download? How did > > > > you run it? De

Re: noob can't install python modules/scripts

2012-12-29 Thread lostguru
On Saturday, December 29, 2012 9:33:59 AM UTC-5, Joel Goldstick wrote: > You should read the BeautifulSoup tutorial/documentation.  If I remember > correctly you do  > from bs4 import BeautifulSoup > > Look at this tutorial to get started: > http://www.crummy.com/software/BeautifulSoup/bs4/doc

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Dave Angel
On 12/29/2012 07:39 AM, Morten Engvoldsen wrote: > Hi Dave, > Thanks for reply. I will really appreciate if you reply to my mail id and > keep python list in cc, since everytime you reply my query i need to search > the reply in the forwarding message of python list. I won't be able to remember to

Inserting Unicode chars in Entry widget

2012-12-29 Thread Alan Graham
Hello Python experts, I want to insert Unicode chars in an Entry widget by pushing on buttons; one for each Unicode character I need. I have made the Unicode buttons. I just need a simple function that will send the Unicode character to the Entry widget. Is there a better approach? Alan -- http:

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Morten Engvoldsen
Hi Dave, Thanks a lot for your reply. I have used logging.setLevel(logger.DEBUG) because of threshold as you said. I didn't copy paste the entire program since it was very huge. The "batch " which value i am trying to retrieve is in a a for loop : for payment in payment_line: but here payment_li

Re: Inserting Unicode chars in Entry widget

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 3:43 AM, Alan Graham wrote: > Hello Python experts, > > I want to insert Unicode chars in an Entry widget by pushing on buttons; > one for each Unicode character I need. I have made the Unicode buttons. > I just need a simple function that will send the Unicode character to

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 3:54 AM, Morten Engvoldsen wrote: > but here payment_line has null value since it was not able to retrieve > payment line value from the payment object. Specifically what value? Is it an empty string? An empty list? The singleton None? ChrisA -- http://mail.python.org/ma

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Dave Angel
On 12/29/2012 11:54 AM, Morten Engvoldsen wrote: > Hi Dave, > Thanks a lot for your reply. I have used logging.setLevel(logger.DEBUG) > because of threshold as you said. > > I didn't copy paste the entire program since it was very huge. The "batch " > which value i am trying to retrieve is in a a

Re: Inserting Unicode chars in Entry widget

2012-12-29 Thread Irmen de Jong
On 29-12-2012 17:43, Alan Graham wrote: > Hello Python experts, > > I want to insert Unicode chars in an Entry widget by pushing on buttons; > one for each Unicode character I need. I have made the Unicode buttons. > I just need a simple function that will send the Unicode character to > the Entry

Re: Inserting Unicode chars in Entry widget

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 4:11 AM, Irmen de Jong wrote: > b1=Button(f, text='char1', command=lambda b=1: insert_char(b)) > b2=Button(f, text='char2', command=lambda b=2: insert_char(b)) > ...etc.. > > def insert_char(b): > if b==1: > entrywidget.insert(0, u"\u20ac") # inserts € in the

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Monte Milanuk
On 12/27/2012 12:01 PM, mogul wrote: I'm new to python, got 10-20 years perl and C experience, all gained on unix alike machines hacking happily in vi, and later on in vim. Do I really need a real IDE, as the windows guys around me say I do, or will vim, git, make and other standalone tools m

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 4:44 AM, Monte Milanuk wrote: > Maybe its because I'm still just a hobbyist when it comes to coding, but I > spend far more time 'thinking' about what I'm doing than typing things in... > so shaving a few seconds here and there are less important to me. The value of a good

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Morten Engvoldsen
Hi Dev, Thanks a lot Dev for your reply. It is really a great help. Yes i have fixed what was wrong in the create method like log.debug. I have declared line_counter=1 before the for loop. i will try now to chcek the value of payment_line. Thanks again a lot. I am greateful be a member of this f

Re: Keeping a Tkinter GUI alive during a long running process

2012-12-29 Thread Grant Edwards
On 2012-12-21, Kevin Walzer wrote: > I maintain a Tkinter application that's a front-end to to a package > manger, and I have never been able to find a way to keep the app from > locking up at some point during the piping in of the package manager's > build output into a text widget. At some p

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Grant Edwards
On 2012-12-27, mogul wrote: > I'm new to python, got 10-20 years perl and C experience, all gained > on unix alike machines hacking happily in vi, and later on in vim. > > Now it's python, and currently mainly on my kubuntu desktop. > > Do I really need a real IDE, as the windows guys around me s

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 12:44 PM, Monte Milanuk wrote: Maybe its because I'm still just a hobbyist when it comes to coding, but I spend far more time 'thinking' about what I'm doing than typing things in... so shaving a few seconds here and there are less important to me. I think the general idea is t

Re: Inserting Unicode chars in Entry widget

2012-12-29 Thread Irmen de Jong
On 29-12-2012 18:23, Chris Angelico wrote: > On Sun, Dec 30, 2012 at 4:11 AM, Irmen de Jong wrote: >> b1=Button(f, text='char1', command=lambda b=1: insert_char(b)) >> b2=Button(f, text='char2', command=lambda b=2: insert_char(b)) >> ...etc.. >> >> def insert_char(b): >> if b==1: >> en

Re: Py 3.3, unicode / upper()

2012-12-29 Thread wxjmfauth
Le mercredi 19 décembre 2012 16:33:50 UTC+1, Christian Heimes a écrit : > > I think Python 3.3+ is using uppercase mapping (uc) instead of simple > > upper case (suc). I think you are thinking correctly. This a clever answer. Note: I do not care about the uc / suc choice. As long there is consi

dict comprehension question.

2012-12-29 Thread Quint Rankid
Newbie question. I've googled a little and haven't found the answer. Given a list like: w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] I would like to be able to do the following as a dict comprehension. a = {} for x in w: a[x] = a.get(x,0) + 1 results in a having the value: {1: 3, 2: 2, 3: 1, 4: 2, 5: 1

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Roy Smith
Monte Milanuk wrote: > > Maybe its because I'm still just a hobbyist when it comes to coding, but I > > spend far more time 'thinking' about what I'm doing than typing things in... If more "professional" programmers spent more time thinking and less type typing, the world would be a better place

Re: dict comprehension question.

2012-12-29 Thread Roy Smith
In article <724d4fea-606a-4503-b538-87442f6bc...@ci3g2000vbb.googlegroups.com>, Quint Rankid wrote: > Newbie question. I've googled a little and haven't found the answer. > > Given a list like: > w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] > I would like to be able to do the following as a dict compre

Re: dict comprehension question.

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 02:48 PM, Quint Rankid wrote: Newbie question. I've googled a little and haven't found the answer. Given a list like: w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] I would like to be able to do the following as a dict comprehension. a = {} for x in w: a[x] = a.get(x,0) + 1 results in a

Re: dict comprehension question.

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 03:01 PM, Mitya Sirenef wrote: On 12/29/2012 02:48 PM, Quint Rankid wrote: >> Newbie question. I've googled a little and haven't found the answer. >> >> Given a list like: >> w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] >> I would like to be able to do the following as a dict comprehension.

Re: dict comprehension question.

2012-12-29 Thread Joel Goldstick
On Sat, Dec 29, 2012 at 3:09 PM, Mitya Sirenef wrote: > On 12/29/2012 03:01 PM, Mitya Sirenef wrote: > >> On 12/29/2012 02:48 PM, Quint Rankid wrote: >> > >> Newbie question. I've googled a little and haven't found the answer. > >> > >> Given a list like: > >> w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] >

Re: dict comprehension question.

2012-12-29 Thread Peter Otten
Quint Rankid wrote: > Newbie question. I've googled a little and haven't found the answer. > > Given a list like: > w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] > I would like to be able to do the following as a dict comprehension. > a = {} > for x in w: > a[x] = a.get(x,0) + 1 > results in a having t

Re: dict comprehension question.

2012-12-29 Thread MRAB
On 2012-12-29 19:48, Quint Rankid wrote: Newbie question. I've googled a little and haven't found the answer. Given a list like: w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] I would like to be able to do the following as a dict comprehension. a = {} for x in w: a[x] = a.get(x,0) + 1 results in a hav

new pipeline manager, feedback welcome

2012-12-29 Thread franapoli
Hi all, I hope this post can be of interest to someone of you. I'm the developer of a pipeline management system called Leaf (the Python library is called pyleaf). While initially developed for internal use only at my dpt., we tried to make it a decent standalone tool for everyone interested. Y

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Morten Engvoldsen
Hi Dave, It is able to log the message with: logger.debug("value of payment_line is " +repr(payment_line)) The output is: value of payment_line is [] So it means payment_line is an empty list, so may be it could be reason it's not able to enter into the loop since the message in the for loop is n

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Monte Milanuk
On 12/29/2012 11:52 AM, Roy Smith wrote: Chris Angelico wrote: [regarding Bracket matching Language-sensitive auto-indentation and automatically indents Yeah, what he said, plus syntax coloring. And keyword highlighting. And autocompletion of variable names. I'll probably get dog-piled by

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 03:50 PM, Morten Engvoldsen wrote: Hi Dave, > It is able to log the message with: > logger.debug("value of payment_line is " +repr(payment_line)) > > The output is: > value of payment_line is [] > > So it means payment_line is an empty list, so may be it could be reason it's not a

Re: Facing issue with Python loggin logger for printing object value

2012-12-29 Thread Roy Smith
In article , Morten Engvoldsen wrote: > It is able to log the message with: > logger.debug("value of payment_line is " +repr(payment_line)) As a side note, a better way to write that is logger.debug("value of payment_line is %r", payment_line) The difference is that the first way, repr(paymen

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 6:52 AM, Roy Smith wrote: > Chris Angelico wrote: > [regarding >> Bracket matching >> Language-sensitive auto-indentation >> and automatically indents > > Yeah, what he said, plus syntax coloring. And keyword highlighting. > And autocompletion of variable names. Syntax c

Re: dict comprehension question.

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 03:15 PM, Joel Goldstick wrote: On Sat, Dec 29, 2012 at 3:09 PM, Mitya Sirenef > wrote: On 12/29/2012 03:01 PM, Mitya Sirenef wrote: On 12/29/2012 02:48 PM, Quint Rankid wrote: >> Newbie question. I've googled a little and haven

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Roy Smith
In article , Chris Angelico wrote: > Auto-complete is handy, but not critical. You just wait until your finger joints get to be my age and tell me that auto-complete isn't critical :-) > It's extremely handy; not only errors from > compilation/execution, but things like a 'git grep -n' fit to

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 04:52 PM, Roy Smith wrote: "In the big for loop, a couple of lines down, no, not there, the other > for loop, yeah, now go down a couple of lines, no that's too far, back > up one. Yeah there. On that line, why do you ..." > > with: > > "On line 647, why do you ..." It's even be

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 8:52 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> It's extremely handy; not only errors from >> compilation/execution, but things like a 'git grep -n' fit too. > > Emacs has integrations with many version control systems. Over the > years, I've gone b

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Mitya Sirenef
On 12/29/2012 05:30 PM, Chris Angelico wrote: "In the big for loop, a couple of lines down, no, not there, the other >for loop, yeah, now go down a couple of lines, no that's too far, back >up one. Yeah there. On that line, why do you ..." > >with: > >"On line 647, why do you ..." Absolutely!

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 9:40 AM, Mitya Sirenef wrote: > On 12/29/2012 05:30 PM, Chris Angelico wrote: >>> >>> "In the big for loop, a couple of lines down, no, not there, the other >>> >for loop, yeah, now go down a couple of lines, no that's too far, back >>> >up one. Yeah there. On that line,

Re: dict comprehension question.

2012-12-29 Thread Terry Reedy
On 12/29/2012 4:40 PM, Mitya Sirenef wrote: On 12/29/2012 03:15 PM, Joel Goldstick wrote: Would this help: >>> w = [1,2,3,1,2,4,4,5,6,1] >>> s = set(w) >>> s set([1, 2, 3, 4, 5, 6]) >>> {x:w.count(x) for x in s} {1: 3, 2: 2, 3: 1, 4: 2, 5: 1, 6: 1} >>> Indeed,

Re: dict comprehension question.

2012-12-29 Thread Terry Reedy
On 12/29/2012 2:48 PM, Quint Rankid wrote: Given a list like: w = [1, 2, 3, 1, 2, 4, 4, 5, 6, 1] I would like to be able to do the following as a dict comprehension. a = {} for x in w: a[x] = a.get(x,0) + 1 results in a having the value: {1: 3, 2: 2, 3: 1, 4: 2, 5: 1, 6: 1} Let me paraphr

Re: Confused about logger config from within Python (3)

2012-12-29 Thread Terry Reedy
On 12/29/2012 8:48 AM, Roy Smith wrote: In article <50de7a0a$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: In Python 3.2 and 3.3, the message about no handlers is not printed, which is an interesting difference. (Somebody who knows more about the logging package than I

Re: dict comprehension question.

2012-12-29 Thread Tim Chase
On 12/29/12 15:40, Mitya Sirenef wrote: >>> w = [1,2,3,1,2,4,4,5,6,1] >>> s = set(w) >>> s set([1, 2, 3, 4, 5, 6]) >>> {x:w.count(x) for x in s} {1: 3, 2: 2, 3: 1, 4: 2, 5: 1, 6: 1} Indeed, this is much better -- I didn't think of it.. Except that you're st

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Tim Johnson
* Grant Edwards [121229 10:02]: > On 2012-12-27, mogul wrote: > > > I'm new to python, got 10-20 years perl and C experience, all gained > > on unix alike machines hacking happily in vi, and later on in vim. > > > > Now it's python, and currently mainly on my kubuntu desktop. > > > > Do I really

Re: New to python, do I need an IDE or is vim still good enough?

2012-12-29 Thread Chris Angelico
On Sun, Dec 30, 2012 at 11:38 AM, Tim Johnson wrote: > Along the way, I did use emacs as well and ended doing quite a bit > of elisping. elispsis. n. the intentional omission of unnecessary work which can be inferred by the editor; often indicated with three consecutive parentheses ((( ))) Chr

Re: Confused about logger config from within Python (3)

2012-12-29 Thread Roy Smith
In article , Terry Reedy wrote: > On 12/29/2012 8:48 AM, Roy Smith wrote: > > In article <50de7a0a$0$29967$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > > >> In Python 3.2 and 3.3, the message about no handlers is not printed, > >> which is an interesting difference. (So

Re: dict comprehension question.

2012-12-29 Thread Joel Goldstick
On Sat, Dec 29, 2012 at 7:26 PM, Tim Chase wrote: > On 12/29/12 15:40, Mitya Sirenef wrote: > >> >>> w = [1,2,3,1,2,4,4,5,6,1] >>> >>> s = set(w) >>> >>> s >>> set([1, 2, 3, 4, 5, 6]) >>> >>> {x:w.count(x) for x in s} >>> {1: 3, 2: 2, 3: 1, 4: 2, 5: 1, 6: 1} >>>