msmtp in python
Hi.
I have written a program to send email using python. However, I want to
use msmtp for delegating the sending to my gmail account. So this part
should be changed but I have no idea how! In theory the "sendmail"
function should automatically call msmtp, but i don't know how to define
"s" then.
s = smtplib.SMTP('localhost')
s.sendmail(me, family, msg.as_string())
s.quit()
Any help would be appreciated!
--
http://mail.python.org/mailman/listinfo/python-list
"The urlopen() and urlretrieve() functions can cause arbitrarily long delays"
Hi! The subject is a segment of a sentence which I copied from Python's official homepage. In whole, it reads: "The urlopen() and urlretrieve() functions can cause arbitrarily long delays while waiting for a network connection to be set up. This means that it is difficult to build an interactive Web client using these functions without using threads." Here is my issue: I am testing my web site (which I have some problems with), and comparing its response speed to a couple of other sites, such as msn.com and python.org. Now, it is very strange that python.org responds always under 0.5 s while my site takes about 20 s to respond! And MSN about 60 seconds! So it does not seem "arbitrary" to me. And I can figure out the mechanisms behind the long delays. What I am wondering is if there's another way for me to go about. I didn't really find any solutions with "threads" as suggested by python's document base. Any suggestions? This is really important because technicians at my web hotel do not use proper tools and my site has been nearly dysfunctional since their latest upgrade and I want to make a case with proper statistics. Thank you in advance. -- http://mail.python.org/mailman/listinfo/python-list
Re: "The urlopen() and urlretrieve() functions can cause arbitrarily long delays"
On Sun, 24 Feb 2013 11:55:09 -0700, Ian Kelly wrote: > On Sun, Feb 24, 2013 at 10:48 AM, 7segment <[email protected]> wrote: >> Hi! >> >> The subject is a segment of a sentence which I copied from Python's >> official homepage. In whole, it reads: >> >> "The urlopen() and urlretrieve() functions can cause arbitrarily long >> delays while waiting for a network connection to be set up. This means >> that it is difficult to build an interactive Web client using these >> functions without using threads." > > I believe what this is warning about is that if a network connection is > not immediately available when the functions are called, they will block > while waiting for one rather than returning control to the calling > function. If used in an interactive client without threads, this would > cause the application to appear to "hang" while urllib waits for a > response. I don't think it's meant to suggest that urllib is > responsible for the delays; that sounds like a problem with your network > configuration. Thanks. I store all the data (response times) in a database. The figures I cited are always nearly the same. For example MSN has response times between 60-61 seconds consistently, my site 21-35 seconds, but python.org only about 0.3 seconds. the calls to the servers happen during the same minute. And there's nothing wrong with my web connection at home. -- http://mail.python.org/mailman/listinfo/python-list
Re: "The urlopen() and urlretrieve() functions can cause arbitrarily long delays"
On Sun, 24 Feb 2013 19:04:28 +, MRAB wrote: > On 2013-02-24 18:55, Ian Kelly wrote: >> On Sun, Feb 24, 2013 at 10:48 AM, 7segment <[email protected]> wrote: >>> Hi! >>> >>> The subject is a segment of a sentence which I copied from Python's >>> official homepage. In whole, it reads: >>> >>> "The urlopen() and urlretrieve() functions can cause arbitrarily long >>> delays while waiting for a network connection to be set up. This means >>> that it is difficult to build an interactive Web client using these >>> functions without using threads." >> >> I believe what this is warning about is that if a network connection is >> not immediately available when the functions are called, they will >> block while waiting for one rather than returning control to the >> calling function. If used in an interactive client without threads, >> this would cause the application to appear to "hang" while urllib waits >> for a response. I don't think it's meant to suggest that urllib is >> responsible for the delays; that sounds like a problem with your >> network configuration. >> > When in doubt, check some other way, such as with a browser. Thank you Ian. Browser is not a good idea, because I need this tool to work automatically. I don't have time to check and compare the response times manually and put them into the database. -- http://mail.python.org/mailman/listinfo/python-list
