server.quit()
except Exception, e:
arq=open(dir_log,'a')
print arq, Falha no envio da mensagem de email, não foi
--
=
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
Dave Merrill [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]...
Sorry for the newbness... Win2K, Python 2.3.3, MySQL 4.1.7. Downloaded and
extracted MySQL-python-1.0.0.win32-py2.3.zip. Put the whole extracted
directory into C:\Program Files\Python23\Lib\site-packages\ and renamed it
- Original Message -
From: Martin Franklin [EMAIL PROTECTED]
server.sendmail(fromaddr, toaddrs, msg)
You can use this if you don't need to worry about whether the email was
successfully sent to all recipients. Otherwise, you need something like
this
(untested and partly copied from
- Original Message -
From: Tim Williams [EMAIL PROTECTED]
try:
s.close()
except
pass
Typo!!
That should be s.quit() not s.close()
:)
--
http://mail.python.org/mailman/listinfo/python-list
- Original Message -
From: Jesse Noller [EMAIL PROTECTED]
I am looking at implementing a simple SMTP server in python - I know
about the smtpd module, but I am looking for code examples/snippets as
the documentation is sparse.
If anyone has any good examples/recipes I'd greatly
':
sendToMe('test', 'test')
It says it sends it but I get nothing in my inbox or anywhere! This is
really frustrating me.
_
[tim williams] No it definitely works, but Hotmail will blackhole your
constructed email as it is obviously
it but I get nothing in my inbox or anywhere! This is
really frustrating me.
_
[tim williams] No it definitely works, but Hotmail will blackhole
your
constructed email as it is obviously fake. It has no headers, dates,
msg-id
of minutes. If not post back and I'll knock
something up :)
- Original Message -
From: Tim Williams [EMAIL PROTECTED]
To: python-list@python.org
Sent: Thursday, June 09, 2005 3:20 PM
Subject: Re: Simple SMTP server
- Original Message -
From: Jesse Noller [EMAIL PROTECTED]
I
After a few posts recently, I have put together an SMTP test rig that will
receive emails and either store them to a file, write them to a console, or
both.
Does anyone have any suggestions on where I can get it hosted as a utility
for general public use?
TIA
Tim
--
:)
--
=
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
)
s.sendmail(frm, to, msg)
s.sendmail(frm, [to], msg)
s.quit()
if __name__ == '__main__':
sendToMe('Testing', 'This is a test')
From: Tim Williams [EMAIL PROTECTED]
To: Ivan Shevanski [EMAIL PROTECTED]
Subject: Re: help with sending mail in Program
Date: Thu, 9
- Original Message -
From: Ivan Shevanski [EMAIL PROTECTED]
if __name__ == '__main__':
body = 'x is',x,'y is',y,'.Lets hope that works!'
subject = 'Neo'
sendToMe(subject, body)
I really have no idea whats going on. . .help?
-Ivan
Ivan, you need to pass the body as a
Does anyone know of (personal/desktop) firewall that can be controlled via
Python, or a Python Firewall package, or even something like DAXFi but not
dormant ?
The XP native firewall appears to have an API, but I'm not convinced I want
to go that route unless it is relatively simple.
Google
On Thu, 16 Jun 2005, Tim Williams wrote:
Does anyone know of (personal/desktop) firewall that can be controlled
via Python, or a Python Firewall package, or even something like DAXFi
but not dormant ?
http://wipfw.sourceforge.net/
import os
def deny(src, dst, proto=all):
cmd = ipfw add
- Original Message -
From: Tom Anderson [EMAIL PROTECTED]
AIUI, you won't be stopping and restarting ipfw - the ipfw command just
modifies the ruleset being used by a continuously-running instance of
the
ipfw kernel module or daemon or whatever. How long it takes from
starting
- Original Message -
From: Paul Rubin http://phr.cx@NOSPAM.invalid
Matthias Kluwe [EMAIL PROTECTED] writes:
Hmm. I tried
server.sock.realsock.shutdown(2)
before server.quit() with the result of
I don't think that's exactly what you want. You need to send a
specific TLS
- Original Message -
From: Remi Villatel [EMAIL PROTECTED]
There is always a nice way to do things in Python but this time I can't
find one.
So far, all I got is:
while True:
some(code)
if final_condition is True:
break
#
#
What I don't find so nice is to have to build an
- Original Message -
From: frost [EMAIL PROTECTED]
Hi,
I am trying to login a website that using PHP and javascript. This is
what happend if you browse that website using IE, after you login, you
can go anywhere without enter your name and password again, as long as
you keep that
- Original Message -
From: David Bear [EMAIL PROTECTED]
I have a file that contains lists -- python lists. sadly, these are not
pickled. These are lists that were made using a simple print list
statement.
Is there an easy way to read this file into a list again? I'm thinking I
- Original Message -
From: Matthias Kluwe [EMAIL PROTECTED]
Have you verified that its your end that is broken, not gmail's, do
other
servers give the same response ?
No, I have not -- I should have, as I know now: Connecting, starttls,
login and sending mail works fine without
nephish [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hey there,
i have a script that retrieves my email, but i need it to
be able to strip all the stuff off except the body (the message itself)
so i can later write it to a text file.
anyone know how to accomplish this?
- Original Message -
From: Tim Williams [EMAIL PROTECTED]
To: python-list@python.org
Sent: Wednesday, June 22, 2005 10:48 AM
Subject: Re: need to strip stuff off email
nephish [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
hey there,
i have a script that retrieves
- Original Message -
From: [EMAIL PROTECTED]
Here's what I'm trying to do:
I need to connect to a pop3 server, download all messages, and copy all
of the attachments into a specific directory. The actual email message
##
import email
import poplib
mimes =
- Original Message -
From: Greg Lindstrom [EMAIL PROTECTED]
A bit off topic, but what does the expression Don't try to teach your
grandfather how to suck eggs. mean? I've never heard it before and am
curious to the story behind it.
A relatively well know phrase, however as quoted
- Original Message -
From: Florian Lindner [EMAIL PROTECTED]
Hello,
I am building a object cache in python, The cache has a maximum size and
the
items have expiration dates.
At the moment I'm doing like that:
What possible you see to optimize this lookup? Or anything else you see
I have a working SMTP client that I need to add TLS capability to,I
absolutely need the client to timeout within a specified time, but when I
use the sock.timeout() line it freezes the reading of chars from SSLFakeFile
used during TLS instead of timing out the client connection.I am
- Original Message -
From: John Abel [EMAIL PROTECTED]
praba kar wrote:
Dear All,
Is it possible to send a message as a mail
with out smtplib module? If you find out any module
for mail sending(without smtplib) kindly mail me.
regards
Prabahar
socket
praba kar [EMAIL PROTECTED] wrote:
Here I want to avoid this line Received: from unknown
(HELO prabahar.enmail.com) (59.92.13.47) by
mailserver with SMTP; 11 May 2005 10:09:11 - How
can I do this? . Why python give this line? . Mail
sending Module in php will not give this type line.
Ximo [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hello, I want that the return sentence don't return anything, how can I do
it?. If i do only return it returns None, and pass don't run too.
Can anyone help me?, thanks.
XIMO
Just don't use a return statement at all, or do
On 18/07/07, Robert Rawlins - Think Blue
[EMAIL PROTECTED] wrote:
What's the best way to create a copy of a list? I've seen several method and
I'm not sure what to use. This will be in a class and one method creates a
list which I then want to move to the self scope, like so:
listB =
On 20/07/07, DJ Fadereu [EMAIL PROTECTED] wrote:
Hello, can anyone help me with this? What am I doing wrong here?
(I've changed private info to /xx)
I'm getting an authentication error while using a standard script
Gmail:
--SCRIPT-
but it doesn't if you use replace !! wink
z = '123 456'
int( z.replace( ' ' ,'' ) )
123456
Propose:
123 456 789 = 123456789
123.456 789 = 123.456789
+1 for me too
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 02/08/07, Beema shafreen [EMAIL PROTECTED] wrote:
Hi everybody ,
I am a beginner in python,
I have to fetch the redundant entries from a file,
code:
import re
L = []
fh = open('ARCHITECTURE_MAIN.txt',
'r')
for line in fh.readlines():
data =line.strip()
#
the capitalization), but that was all - originally it
stopped the script dead, so it wasn't the cause of your problem.
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 17/08/07, Beema shafreen [EMAIL PROTECTED] wrote:
hi everybody,
i have a file with data separated by tab
mydata:
fhl1fkh2
dfp1chk1
mal3alp14
mal3moe1
mal3spi1
mal3bub1
mal3bub3
mal3mph1
mal3mad3
hob1nak1
hob1wsp1
hob1rad3
cdr2
On 21/12/2007, Benedict Verheyen [EMAIL PROTECTED] wrote:
Hi,
i get an Unable to relay for when trying to send an email from within
my network to an email address not on my domain.
I don't understand why it says relaying as i'm sending from an
internal domain user to an external user.
Email
On 11/10/2007, brad [EMAIL PROTECTED] wrote:
Crazy question, but has anyone attempted this or seen Python code that
does? For example, if a text file contained 'Guido' and or 'Robert' and
or 'Susan', then we should return True, otherwise return False.
--
valid.
Invalid email doesn't always bounce, ( or the bounces may not always reach you )
:)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 12/10/2007, Florian Lindner [EMAIL PROTECTED] wrote:
Hello,
is there a function in the Python stdlib to test if a string is a valid
email address?
You mean a valid SMTP email address?
In reality, there isn't a way of doing this. But a good rule of thumb
is if it hasn't got at least one
On 25/10/2007, A.T.Hofkamp [EMAIL PROTECTED] wrote:
On 2007-10-25, Pete Bartonly [EMAIL PROTECTED] wrote:
Also, brackets around conditions (in the if) are not needed, and comparing
against None is usually done with 'is' or 'is not' instead of '==' or '!='.
The result is then
if logMsg is
On 27/11/2007, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
There's a government website which shows public data for banks. We'd
like to pull the data down programmatically but the data is hidden
behind .aspx...
Is there anyway in Python to hook in directly to a browser (firefox or
IE) to do
On 11/05/07, Sven Rech [EMAIL PROTECTED] wrote:
Hi,
I have a written a C program which makes use of python embedding.
I want to find out all threads that a loaded module has started.
But I can't find anything about this in the docs. Is it possible?
Without details of your module, its
On 15 May 2007 06:38:45 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I'm trying to use PAMIE to login to a website:
import cPAMIE
# python.org - just a test, works fine
ie = cPAMIE.PAMIE()
website = http://www.python.org;
ie.navigate(website)
ie.textBoxSet('q', 'pamie')
in range(10):
print '.\b',
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 17/06/07, William Gill [EMAIL PROTECTED] wrote:
I have a (web) development computer w/o an SMTP server and want to test
form generated e-mail using a dummy SMTP server that delivers the mail
message to a file, or better yet, to a text editor instead of actually
sending it. Is it possible
the script won't run, if the script
finshes/crashes or the machine reboots the open file will close.
In both cases if the script finishes normally or crashes, or the
machine is restarted. The lock (ie socket or open file) is released.
HTH :)
--
Tim Williams
--
http://mail.python.org/mailman
will still exist and
future execution of the script will fail.
:)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 18/06/07, Robin Becker [EMAIL PROTECTED] wrote:
Wildemar Wildenburger wrote:
Robin Becker wrote:
.
Well I can think of a dumb way: create a temporary file during the
transaction and have your script check for that before running its main
body.
I think thats the most
On 18/06/07, Nick Craig-Wood [EMAIL PROTECTED] wrote:
Tim Williams [EMAIL PROTECTED] wrote:
You can also do this by holding a file open in write mode until the
script has finished.
try:
open('lock.txt','w')
my_script()
except
On 13/06/06, Alex Reinhart [EMAIL PROTECTED] wrote:
Is running Python's built-in smtpd, pretending to accept and forward all
messages, enough to get me noticed by a spammer, or do I have to do
something else to advertise my script as an open proxy?
This will get you noticed by crawlers that
On 26 Jun 2006 08:24:54 -0700, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
And what if I want to search for an item in a tuple, is there a
similarly easy method?
Tim Chase wrote:
What's the best way to search a string for a particular word and get a
booleen value indicating whether it
On 07/07/06, Jack [EMAIL PROTECTED] wrote:
I just did some testing between CherryPy's web server and lighttpd.
My test was very simple and I used ab.exe for this purpose.
CherryPy web server can serve about 140 simple request / second, while
lighttpd can handle around 400 concurrent requests.
On 7 Jul 2006 06:27:43 -0700, Gerard Flanagan [EMAIL PROTECTED] wrote:
Tim Williams wrote:
On 07/07/06, Jack [EMAIL PROTECTED] wrote:
I just did some testing between CherryPy's web server and lighttpd.
My test was very simple and I used ab.exe for this purpose.
CherryPy web server can
On 30/03/07, Boudreau, Emile [EMAIL PROTECTED] wrote:
sendMail('this is the subject line', 'the results: 71 fails, 229 pass, 300
total.', '[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]')
def sendMail(subject, body, TO, FROM=[EMAIL PROTECTED]):
print TO
HOST =
On 30/03/07, Tim Williams [EMAIL PROTECTED] wrote:
Emile, (slight change to my original reply)
You are passing the TO addresses as 3 addresses in a single string.
[TO] results in a list containing a single string - not a list
containing 3 individual addresses.
You need to either pass
On 29 Mar 2007 13:40:58 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
On Mar 29, 12:02 pm, [EMAIL PROTECTED] wrote:
Alex I'm looking for a simple method to delete a folder after 72
Alex Business hours (saturday/sunday doesnt count) since its
Alex creation. Note that This is
On 30/03/07, Durumdara [EMAIL PROTECTED] wrote:
Hi!
I want to create some backup archives with python (I want to write a backup
application in Python).
Some package managers (7z, arj, winzip) can create splitted archives (1
mega, 650, 700 mega, etc).
Because I want to ftp these results to
On 4 Apr 2007 08:58:49 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
For any list x, x.index(item) returns the index of the FIRST
occurrence of the item in x. Is there a simple way to identify the
LAST occurrence of an item in a list? My solution feels complex -
reverse the list, look for
On 3 Apr 2007 12:36:10 -0700, flit [EMAIL PROTECTED] wrote:
Hello All,
Using poplib in python I can extract only the headers using the .top,
there is a way to extract only the message text without the headers?
for i in range( M.stat()[0] ): # M.stat returns msg-count and mbox size
msg =
the
retrieved message into a string. You can use \n but if you plan to
push the text back out in an email '\r\n' is required for the SMTP
sending part. Your client may or may not convert \n to \r\n at
sending time :)
HTH :)
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python-list
On 06/04/07, Tim Williams [EMAIL PROTECTED] wrote:
Content: ['text/plain', 'text/html', 'message/delivery-status',
'text/plain', 'text/plain', 'text/plain', 'unknown', 'message/rfc822',
'text/plain', 'text/html']
I should explain that this was the content in a single email
On 07/04/07, Eric Price [EMAIL PROTECTED] wrote:
Good grief! And they call a 722-line program simple?! LOL!
I did what I need to do with a __one_line_shell_script__ LOL!
Naw, if I have to go through all that, I'll skip on python this time around,
thank you very much!
Eric
Yup, its not so
On 4 May 2007 03:02:37 -0700, Jaswant [EMAIL PROTECTED] wrote:
This is a simple way to do it i think
s=hello
if(len(s)==0):
print Empty
else:
print s
hello
Not as simple asIf not s:
and nowhere near as simple asprint s or 'Empty' :) :)
s =
On 20 Jul 2006 15:12:27 GMT, Duncan Booth [EMAIL PROTECTED] wrote:
Ksenia Marasanova wrote:
i want to send plain text alternative of html email, and would prefer
to do it automatically from HTML source.
Any hints?
Use htmllib:
import htmllib, formatter, StringIO
def cleanup(s):
On 7 Aug 2006 07:55:11 -0700, abcd [EMAIL PROTECTED] wrote:
if i have a number, say the size of a file, is there an easy way to
output it so that it includes commas?
for example:
1890284
would be:
1,890,284
I was bored !!
a = 1890284
','.join([str(a)[::-1][x:x+3] for x in
On 7 Aug 2006 13:52:16 -0700, Hitesh [EMAIL PROTECTED] wrote:
I have a small script here that goes to inside dir and sorts the file
by create date. I can return the create date but I don't know how to
find the name of that file...
I need file that is not latest but was created before the last
On 9 Aug 2006 08:22:03 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
that's
timeout calling local sendmail
not
timeout calling local se
[EMAIL PROTECTED] wrote:
(Environment: RedHat Linux recent, Python 2.3.5)
We have a batch processing script that on occasion needs to send out
On 11 Aug 2006 09:39:23 -0700, jean-jeanot [EMAIL PROTECTED] wrote:
Anyway many thanks.Here is the program:
file_obj= open (D:/Mes documents/ADB Anna.ods,'r')
s = file_obj
s.readlines()
Please remember not to top-post :)
Try this
s = open (D:/Mes documents/ADB Anna.ods,'r')
On 13 Aug 2006 16:28:45 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Greetings:
I'm brand new to Python and decided to write a syllogism solver for a
class I'm taking. At the start of the program, I define a function that
classifies the type of each statement in the syllogism. Python
On 15/08/06, M_M [EMAIL PROTECTED] wrote:
Hi,
I am looking for a simple text book to introduce 13 to 18 year olds to
python programming. Suggestion?
You might consider Learn to programme using Python by Alan Gauld
as a means to introduce both programming and python at the same time.
On 16/08/06, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
On 16 Aug 2006 09:00:57 -0700, Hitesh [EMAIL PROTECTED] declaimed
the following in comp.lang.python:
Thank you Fredrik. That works for a string.
But I am getting list of tuples from DB.
rows =
On 16 Aug 2006 10:30:26 -0700, Hitesh [EMAIL PROTECTED] wrote:
Thank you all it worked!.
Tim,
modRows = ['\\'+itm[0].replace(:, $) for itm in rows]
What are those two forward slashes for?
Hi Hitesh,
\ is an escape character, it can give unexpected results depending
on the character
On 16 Aug 2006 15:23:06 -0700, fuzzylollipop [EMAIL PROTECTED] wrote:
I want to do email address format validations, without turning to ANTLR
or pyparsing, anyone know of a regex that is COMPLIANT with RFC 821.
Most of the ones I have found from google searches are not really as
robust as I
On 17/08/06, Sybren Stuvel [EMAIL PROTECTED] wrote:
Dennis Lee Bieber enlightened us with:
What happens when you get a pathname that looks like:
\\who\cares\common.exe\program.exe
Is that possible on Windows? At one point, I named a directory
www.something.com and then it wouldn't
print x[0], x[1]
server.quit()
break
except: #can't connect so continue to next MX server - don't fail !!!
e_error = str(sys.exc_info()[0])
print e_error
server.quit()
continue
for recip in failed: # some failed, some didn't
print recip
--
Tim Williams
--
http
On 21/08/06, Tim Williams [EMAIL PROTECTED] wrote:
On 21/08/06, John Draper [EMAIL PROTECTED] wrote:
Sorry, there's an indentation error here
except smtplib.SMTPRecipientsRefused, x : #all recips failed
for recip in x.recipients:
print recip
server.quit()
break
On 22/08/06, Tim Roberts [EMAIL PROTECTED] wrote:
John Draper [EMAIL PROTECTED] wrote:
Hi Tim :)
Tim William's answer is not exactly correct. The host you specify in the
smtplib.SMTP constructor should NOT be the MX record for any of the
recipients. You should never have to look up MX
At this time right now I prefer to do something that works the quickest
possible...
I never had any experience with CGI, do I need to set up a web server
for that ?
can you point me some usefull reading material so I can get a start ?
I will post for a comment at Zope , I had installed once
On 20/08/07, Brian McCann [EMAIL PROTECTED] wrote:
Hi,
I can read in the whole file build.number which has the following lines
how do I just capture the value of build.number and assign it to a variable
Thanks,
Brian
contents of file build.number:
#Build Number for ANT. Do not edit!
On 20/08/07, Brian McCann [EMAIL PROTECTED] wrote:
From: [EMAIL PROTECTED] on behalf of Tim Williams
Sent: Mon 8/20/2007 2:59 PM
To: Brian McCann
Cc: python-list@python.org
Subject: Re: reading a line in file
On 20/08/07, Brian McCann [EMAIL PROTECTED
On 20/08/07, Shawn Milochik [EMAIL PROTECTED] wrote:
Hopefully this will help (using your input file)
#!/usr/bin/env python
import re
buildinfo = input.txt
input = open(buildinfo, 'r')
regex = re.compile(r^\s*build.number=(\d+)\s*$)
for line in input:
if re.search(regex, line):
On 20/08/07, Brian McCann [EMAIL PROTECTED] wrote:
Shawn, Tim ,Jay
many thanks,
It looks like there are many ways this problem can be approached
either by using regex or a tokens
Tim I'm not familiar with your solution, but will learn about that method
also
Hi Brian,
buildNum =
On 23/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi,
I have a bunch of files that have changed from standard htm files to
php files but all the links inside the site are now broken because
they point to the .htm files while they are now .php files.
Does anyone have an idea about how
On 23/08/07, Tim Williams [EMAIL PROTECTED] wrote:
On 23/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi,
I have a bunch of files that have changed from standard htm files to
php files but all the links inside the site are now broken because
they point to the .htm files while
On 24/08/07, J. Cliff Dyer [EMAIL PROTECTED] wrote:
Tim Williams wrote:
On 23/08/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi,
I have a bunch of files that have changed from standard htm files to
php files but all the links inside the site are now broken because
they point
On 27/08/07, Simon Brunning [EMAIL PROTECTED] wrote:
On 8/27/07, Carnell, James E [EMAIL PROTECTED] wrote:
Image.open(C:\test.jpg)
Try:
Image.open(rC:\test.jpg)
See http://docs.python.org/ref/strings.html
rC:\test.jpg
also
C:\\test.jpg or 'C:/test.jpg'
--
On 06/09/07, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
You may want to try with a regexp, but I'm not sure it's worth it (hint:
the timeit module is great for quick small benchmarks).
Else, you could as well write your own testing function:
def str_starts_with(astring, *prefixes):
On 07/09/07, Tom Brown [EMAIL PROTECTED] wrote:
On Thursday 06 September 2007 16:01, windandwaves wrote:
Hmmm, thank you all for your replies. I will do some research on the
net (i did some already, but because I am really not much of a
programmer, it is often too detailed for me). I have
On 13/09/2007, Fabian Braennstroem [EMAIL PROTECTED] wrote:
me again... I should describe it better:
the result should be an array with just:
498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04
3.8560e-03 4.8384e-02 11:40:01 499
499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
On 14/09/2007, Sean Nakasone [EMAIL PROTECTED] wrote:
I'm having trouble with sending smtp mail. It's hanging after the
smtplib.SMTP() line. It doesn't works from home but not from work. What's
the best way to debug this?
# Here's my script
import smtplib
msg = Subject: Hello\n\nThis is
On 15/09/2007, Konstantinos Pachopoulos [EMAIL PROTECTED] wrote:
Hi,
is there something corresponding to the java String.trim() method, ie
trim start and trailing space/tab chars from string?
say convert asdf to asdf?
' asdf '.strip()
'asdf'
' asdf '.rstrip()
' asdf'
' asdf '.lstrip()
On 21/09/2007, Tim Williams [EMAIL PROTECTED] wrote:
On 20/09/2007, Python Maniac [EMAIL PROTECTED] wrote:
I am new to Python however I would like some feedback from those who
know more about Python than I do at this time.
def scrambleLine(line):
s = ''
for c in line:
s
On 20/09/2007, Python Maniac [EMAIL PROTECTED] wrote:
I am new to Python however I would like some feedback from those who
know more about Python than I do at this time.
def scrambleLine(line):
s = ''
for c in line:
s += chr(ord(c) | 0x80)
return s
def
On 28/09/2007, Robin Becker [EMAIL PROTECTED] wrote:
Tim Williams wrote:
On 28/09/2007, Robin Becker [EMAIL PROTECTED] wrote:
Is there a way to use smtplib to get recipient validation. I can use
smtplib
quite happily to send emails using the locahost's sendmail, but sendmail
is just
On 28/09/2007, Robin Becker [EMAIL PROTECTED] wrote:
Is there a way to use smtplib to get recipient validation. I can use smtplib
quite happily to send emails using the locahost's sendmail, but sendmail is
just
fire and forget, so some bad addresses eg [EMAIL PROTECTED] don't cause any
one 'x11' in the list you could also consider
print mylist.index('x11')
and
print mylist[mylist.index('x11')]
Also, before iterating the whole list check that 'x11' exists
if 'x11' in mylist:
do stuff
and list comprehesions
print [x for x in mylist if x == 'x11']
HTH :)
Tim Williams
On 07/10/2007, Tim Chase [EMAIL PROTECTED] wrote:
I'm not really sure how readline() works. Is there a way to iterate
through a file with multiple lines and then putting each line in a
variable in a loop?
You can use readlines() to get the whole line (including the
newline):
lines =
')
new_file = []
for line in infile:
if 'msgid' in line:
# transform line
# make sure the line ending is intact
new_file.append(line)
outfile.write(''.join(new_file)
infile.close()
outfile.close()
--
Tim Williams
--
http://mail.python.org/mailman/listinfo/python
On 29 Aug 2006 20:43:49 -0700, alex23 [EMAIL PROTECTED] wrote:
abcd wrote:
ok, no of any python solutions? or command-line firewalls?
You did try searching Google for python firewall, right?
http://www.google.com.au/search?q=python+firewall
The very first entry is a pointer to a solution
On 1 Sep 2006 03:26:12 -0700, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
How do I add a Sender name to the emails sent by the following script:
writer = MimeWriter.MimeWriter(out)
# set up some basic headers... we put subject here
# because smtplib.sendmail expects
1 - 100 of 277 matches
Mail list logo