Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Thomas Rachel
Am 11.03.2013 06:47 schrieb Thomas Rachel: # either message.add_header('Subject', email.quoprimime.header_encode(SUBJECT)) # or message.add_header('Subject', email.base64mime.header_encode(SUBJECT)) Sorry! These were completely wrong. # either message.add_header('Subject', email.quoprimime.h

Advice regarding multiprocessing module

2013-03-10 Thread Abhinav M Kulkarni
Dear all, I need some advice regarding use of the multiprocessing module. Following is the scenario: * I am running gradient descent to estimate parameters of a pairwise grid CRF (or a grid based graphical model). There are 106 data points. Each data point can be analyzed in parallel.

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Thomas Rachel
Am 11.03.2013 06:25 schrieb Thomas Rachel: 1. Your subject is not properly encoded. All characters outside the ASCII area must be encoded in an appropriate way if you send an email. It MIGHT be the case that sendmail handles this for you, but probably not every version. Mine not, at least. S

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Thomas Rachel
Am 09.03.2013 22:20 schrieb Νίκος Γκρ33κ: SENDMAIL = '/usr/sbin/sendmail' FROM = mail TO = ['supp...@superhost.gr'] SUBJECT = "Επικοινωνία πιθανού πελάτη!" TEXT = comment mess

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Michael Torrie
On 03/10/2013 11:53 AM, Νίκος Γκρ33κ wrote: > Michael may i send you an email with my reseller account password so > you can try things for yourself because i'am not sure what exactly i > must do in the remote jailed unix prompt ? It's never a good idea to share that kind of information with folks

Re: Regular expression problem

2013-03-10 Thread Terry Reedy
On 3/10/2013 1:42 PM, mukesh tiwari wrote: Hello all I am trying to solve this problem[1] [1] http://www.spoj.com/problems/MAIN12C/ As I remember, and as it still appears, this site severely penalizes Python solvers by using the same time limit for all languages. Thus, a 'slow' python program

Re: Pygame mouse cursor load/unload

2013-03-10 Thread Ian Kelly
On Sun, Mar 10, 2013 at 4:25 PM, Alex Gardner wrote: > Now the cursor isn't moving at all! > > while True: > for event in pygame.event.get(): > if event.type == QUIT: > sys.exit() > > screen.blit(bpaddle, paddle_rect) > # Draw the net

Re: Interesting list() un-optimization

2013-03-10 Thread Roy Smith
In article <513d18d6$0$6512$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Sun, 10 Mar 2013 18:34:58 -0400, Roy Smith wrote: > > > Yeah, that's what I was afraid of. The "obvious" solution of: > > > > class QuerySet(mongoengine.queryset.QuerySet): > > def __init__(self,

Re: Interesting list() un-optimization

2013-03-10 Thread Steven D'Aprano
On Sun, 10 Mar 2013 18:34:58 -0400, Roy Smith wrote: > Yeah, that's what I was afraid of. The "obvious" solution of: > > class QuerySet(mongoengine.queryset.QuerySet): > def __init__(self, document, collection): > super(QuerySet, self).__init__(document, collection) [...] > d

Re: Building importable _tkinter on Windows (solved)

2013-03-10 Thread Terry Reedy
On 3/9/2013 7:41 PM, Terry Reedy wrote: If you have tried to build _tkinter on Windows from the cpython repository, and have 'import tkinter' work, please share your experience, successful or not. I and another person have both failed. > [snip] Solution from Merlijn van Deen on core-mentorship

Re: Interesting list() un-optimization

2013-03-10 Thread Roy Smith
In article , Terry Reedy wrote: > > It turns out, we don't actually use QuerySet in our models. We've > > defined our own QuerySet subclass which adds a few convenience methods. > > Adding > > > > def __len__(self): > > raise NotImplemented > > > > to our subclass should do the jo

Re: Pygame mouse cursor load/unload

2013-03-10 Thread Alex Gardner
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: > I am in the process of making a pong game in python using the pygame library. > My current problem is that when I move the mouse, it turns off as soon as > the mouse stops moving. The way I am doing this is by making the default

RE: Switch statement

2013-03-10 Thread Joseph L. Casale
> Or could you do something like: > > arguments_to_pass = [list of some sort] > switch.get(var, default)(*arguments_to_pass) Stevens lambda suggestion was most appropriate. Within the switch, there are functions called with none, or some variation of arguments. It was not easy to pass them in afte

Re: Switch statement

2013-03-10 Thread Terry Reedy
On 3/10/2013 11:18 AM, Steven D'Aprano wrote: On Sun, 10 Mar 2013 14:16:27 +, Joseph L. Casale wrote: I have a switch statement composed using a dict: switch = { 'a': func_a, 'b': func_b, 'c': func_c } switch.get(var, default)() As a result of multiple functions per choic

idle (GUI)doesn't work…

2013-03-10 Thread leonardo
>>> hi guys >>> i need help: >>> i have a mac os x 10.8, i had already python 2.7, i downloaded python >>> 3.3 and active tcl 8.5, but idle and the new version don't work, the >>> answer is:"idle's subprocess didn't make connection or personal firewall >>> is blocking" plus in the terminal i sti

Re: Switch statement

2013-03-10 Thread Nicholas Cole
On Sun, Mar 10, 2013 at 8:42 PM, Mitya Sirenef wrote: > On 03/10/2013 10:16 AM, Joseph L. Casale wrote: > >> I have a switch statement composed using a dict: >> > > > > > > switch = { > > 'a': func_a, > > 'b': func_b, > > 'c': func_c > > } > > switch.get(var, default)() > > > > > > As a result of

Re: Interesting list() un-optimization

2013-03-10 Thread Terry Reedy
On 3/10/2013 9:05 AM, Roy Smith wrote: In article , Roy Smith wrote: The problem is, QuerySets have a __len__() method. Calling it is a lot faster than iterating over the whole query set and counting the items, but it does result in an additional database query, which is a lot slower than t

Re: Switch statement

2013-03-10 Thread Mitya Sirenef
On 03/10/2013 10:16 AM, Joseph L. Casale wrote: I have a switch statement composed using a dict: > > > switch = { > 'a': func_a, > 'b': func_b, > 'c': func_c > } > switch.get(var, default)() > > > As a result of multiple functions per choice, it migrated to: > > > > switch = { > 'a': (func_a1,

how to make a tree with randomly selected html tags from an array in python?

2013-03-10 Thread zuhaib . chohan88
I am new to python. I have xml file as an input to my python script "html.xml". I made an array which contains html tags: from xml.etree import ElementTree tree = ElementTree.parse("html.xml") olp = tree.findall("//tag_Name") mylist = [t.text for t in olp]

Re: Pygame mouse cursor load/unload

2013-03-10 Thread Ian Kelly
On Sat, Mar 9, 2013 at 5:25 PM, Alex Gardner wrote: > On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote: >> I am in the process of making a pong game in python using the pygame >> library. My current problem is that when I move the mouse, it turns off as >> soon as the mouse stops

idle doesn't work

2013-03-10 Thread leonardo
>> hi guys >> >> i have a mac os x 10.8, i had already python 2.7, i downloaded python >> 3.3 and active tcl 8.5, but idle and the new version don't work, the >> answer is:"idle's subprocess didn't make connection or personal firewall >> is blocking". do you know what can i do ? thanks and re

Re: Regular expression problem

2013-03-10 Thread Chris Angelico
On Mon, Mar 11, 2013 at 5:48 AM, mukesh tiwari wrote: > Hi Chris > Thank you! Now I am getting wrong answer so at least program is faster then > previous one and I am looking for wrong answer reason. Thanks again! Excellent! Have fun. Incidentally, regular expressions aren't the only way to sol

Re: Regular expression problem

2013-03-10 Thread mukesh tiwari
Hi Chris Thank you! Now I am getting wrong answer so at least program is faster then previous one and I am looking for wrong answer reason. Thanks again! import re if __name__ == "__main__": n = int ( raw_input() ) c = 1 while c <= n : email = filter ( lambda x : x != None ,

Re: Regular expression problem

2013-03-10 Thread mukesh tiwari
Hi Chris On the problem page, it is 3 second. > What is the time limit? I just tried it (Python 2.6 under Windows) and > > it finished in a humanly-immeasurable amount of time. Are you sure > > that STDIN (eg raw_input()) is where your test data is coming from? Yes, on SPOJ we read data from

Re: Regular expression problem

2013-03-10 Thread Chris Angelico
On Mon, Mar 11, 2013 at 4:59 AM, Chris Angelico wrote: > On Mon, Mar 11, 2013 at 4:42 AM, mukesh tiwari > wrote: >> I am trying to solve this problem[1] using regular expression. I wrote this >> code but I am getting time limit exceed. Could some one please tell me how >> to make this code run

Re: Regular expression problem

2013-03-10 Thread Chris Angelico
On Mon, Mar 11, 2013 at 4:42 AM, mukesh tiwari wrote: > I am trying to solve this problem[1] using regular expression. I wrote this > code but I am getting time limit exceed. Could some one please tell me how to > make this code run faster. What is the time limit? I just tried it (Python 2.6 un

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Νίκος Γκρ33κ
Τη Κυριακή, 10 Μαρτίου 2013 6:09:53 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > You need to post the code snippet that's failing (possibly changing > private details like smtp server ip address for security reasons), and > any exception trace that you are getting! Other wise, sorry we've done

RE: Switch statement

2013-03-10 Thread Joseph L. Casale
> switch = {  > 'A': functools.partial(spam, a), > 'B': lambda b, c=c: ham(b, c), > 'C': eggs, > } >  > switch[letter](b) That's cool, never even thought to use lambdas. > functools.partial isn't always applicable, but when it is, you should > prefer it over lambda since it will

Regular expression problem

2013-03-10 Thread mukesh tiwari
Hello all I am trying to solve this problem[1] using regular expression. I wrote this code but I am getting time limit exceed. Could some one please tell me how to make this code run faster. import re if __name__ == "__main__": n = int ( raw_input() ) c = 1 while c <= n :

Re: BPLUSPY-1.0 Installation issue

2013-03-10 Thread Steven D'Aprano
On Sun, 10 Mar 2013 08:38:43 -0700, mbg1708 wrote: > The Bpluspy-1.0 package from Pypi is excellent. The usual setup loads > the software into site-packages. Unfortunately, once installed, Python > import statements don't find the software. > > The fix is to add a "pth" file in the site-package

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Michael Torrie
On 03/09/2013 10:10 PM, Νίκος Γκρ33κ wrote: > I'am using smtplib and i ahve contacted the hostgator administrators > and they say that Sendmail is ebaled for my reseller account. You need to post the code snippet that's failing (possibly changing private details like smtp server ip address for sec

BPLUSPY-1.0 Installation issue

2013-03-10 Thread mbg1708
The Bpluspy-1.0 package from Pypi is excellent. The usual setup loads the software into site-packages. Unfortunately, once installed, Python import statements don't find the software. The fix is to add a "pth" file in the site-packages directory. The file can be called .pth and needs to cont

Re: Switch statement

2013-03-10 Thread Steven D'Aprano
On Sun, 10 Mar 2013 14:16:27 +, Joseph L. Casale wrote: > I have a switch statement composed using a dict: > > > switch = { >     'a': func_a, >     'b': func_b, >     'c': func_c > } > switch.get(var, default)() > > > As a result of multiple functions per choice, it migrated to: > > >

Re: Any other screenwriters?

2013-03-10 Thread richarddooling
Thanks all! I have the ruby script working pretty well and may indeed just tamper with that and perhaps learn a little ruby along the way. The goal is a command-line converter, hence Trelby would be nice as a converter of last resort, but I would never use it as an editor. The whole point is to

Switch statement

2013-03-10 Thread Joseph L. Casale
I have a switch statement composed using a dict: switch = {     'a': func_a,     'b': func_b,     'c': func_c } switch.get(var, default)() As a result of multiple functions per choice, it migrated to: switch = {     'a': (func_a1, func_a2),     'b': (func_b1, func_b2),     'c': (func_c, ) }

Re: idle doesn't work

2013-03-10 Thread Łukasz Posadowski
Dnia 2013-03-10, nie o godzinie 12:04 +0100, leonardo pisze: > hi guys > > i have a mac os x 10.8, i had already python 2.7, i downloaded python > 3.3 and active tcl 8.5, but idle and the new version don't work, the > answer is:"idle's subprocess didn't make connection or personal firewall > i

Re: Interesting list() un-optimization

2013-03-10 Thread Roy Smith
In article , Roy Smith wrote: > The problem is, QuerySets have a __len__() method. Calling it is a lot > faster than iterating over the whole query set and counting the items, > but it does result in an additional database query, which is a lot > slower than the list resizing! Writing the c

idle doesn't work

2013-03-10 Thread leonardo
hi guys i have a mac os x 10.8, i had already python 2.7, i downloaded python 3.3 and active tcl 8.5, but idle and the new version don't work, the answer is:"idle's subprocess didn't make connection or personal firewall is blocking". do you know what can i do ? or can i use other easy editors

Re: Apparent magic number problem

2013-03-10 Thread Peter Otten
Colin J. Williams wrote: > My main problem appears to be with: > > Profile with Python 2.7 > 11 25.7362.340 25.7362.340 > {numpy.linalg.lapack_lite.dgesv} > > Profile with Python 3.2 > 11 152.111 13.828 152.111 13.828 {built-in method dgesv} > > In other words,

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Steven D'Aprano
On Sat, 09 Mar 2013 22:00:39 -0800, Νίκος Γκρ33κ wrote: > Τη Κυριακή, 10 Μαρτίου 2013 7:56:45 π.μ. UTC+2, ο χρήστης Steven > D'Aprano έγραψε: > >> My wild guess is that the mail server is properly rejecting mail >> because you are trying to send to it without an account. > > Account 'support(-at

Re: This mail never gets delivered. Any ideas why?

2013-03-10 Thread Νίκος Γκρ33κ
Anyone else migth ahve an idea please so that i can successfully send mail via python? -- http://mail.python.org/mailman/listinfo/python-list

PyPyODBC 1.0.5 released. (DBI 2.0 ODBC module compatible with PyPy, IronPython and SQLAlchemy)

2013-03-10 Thread 江文
Changes in Ver 1.0.5 (and 1.0.4, 1.0.3, 1.0.2, 1.0.1) - *Fix several bugs under Python 3.x* - *Add Mac / iODBC platform support* - *Improved ODBC ANSI / unicode mode support* Features - *One pure Python script, runs on CPython / IronPython

Re: pyqt4 & qt license

2013-03-10 Thread newspost2012
Am Sonntag, 10. März 2013 05:09:41 UTC+1 schrieb D. Xenakis: > Please correct me if im wrong.. > ... > PyQT4 GPL Licence is free and by using that someone can develop only > non-commercial software. Wrong. GPL does not prevent you from developing commercial softwarre. You just have to release you

Re: Calling J from Python

2013-03-10 Thread gosinn
Den lördagen den 9:e mars 2013 kl. 19:34:09 UTC skrev Mark Lawrence: > On 09/03/2013 18:49, gos...@gmail.com wrote: > > > Den måndagen den 5:e februari 2007 kl. 14:48:49 UTC skrev Gosi: > > >> It is quite easy to call J from Python > > >> > > >> http://groups.google.com/group/J-Programming/brow