Re: Forms with multiple submit buttons vs 'form' objects with single 'submit' methods

2006-04-13 Thread Tim Williams (gmail)
On 13 Apr 2006 12:26:52 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:Hi all,  I'm using pywin to write a script that will commandeer internet explorer to go to a certain website, where it will navigate menus, postforms, and eventually retrieve certain data.  Here's my question:  Suppose a fo

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: In Karrigell you could write the host mappings into a karrigell script (.ks) application, so you wouldn't  even need to use virtual-hosts in the config file.  and of course, you could just write a single ..ks  that contains (a

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Roel Schroeven <[EMAIL PROTECTED]> wrote: Tim Williams (gmail) schreef:> Karrigell will happily run multiple karrigell "applications" on a single> server .  In your example simply by having different applications at > http://foo.example.com/app1 and http://

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Tim Williams (gmail)
On 13/04/06, Roel Schroeven < [EMAIL PROTECTED]> wrote: There's something I don't quite get regarding the Karrigell- andCherryPy-style frameworks. With PHP or mod_python I can put any numberof different applications in different directories on a web server, which is very convenient: [SNIP]How do

Re: Receiving emails with attachments

2006-04-09 Thread Tim Williams (gmail)
On 8 Apr 2006 13:24:20 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: want to develop a script which will receive emails with attachmentsfrom my POP3 account, perform certain actions on it and email it back to someone else.However, I'm not familiar with any Python library which does it. Coul

Re: raw_input

2006-03-23 Thread Tim Williams (gmail)
On 23/03/06, cm012b5105 <[EMAIL PROTECTED]> wrote:     if s = raw_input ("hello what's your name? ") if s=='carmel ': print "Ahh the boss's wife"  What i would like to know is what if she doesn't write carmel she rights say carm short of me writing if s=='carm': on a ne

Re: raw_input (was "no subject")

2006-03-23 Thread Tim Williams (gmail)
On 23/03/06, cm012b5105 <[EMAIL PROTECTED]> wrote: Hi there i am hoping some one could help me out with a small problem i am in the process of learning python. I am trying to write an interactive programme, This is a short example. if s = raw_input ("hello what's your name? ") if

Re: Uploading files from IE

2006-03-22 Thread Tim Williams (gmail)
On 22/03/06, AB <[EMAIL PROTECTED]> wrote: >> try something like this:> filename = os.path.basename(fullpathname) I tried the following with the same result:myName = ulImage.filenamenewFile = file (os.path.join(upload_dir, os.path.basename(myName)), 'wb')Any other ideas?  Seems like it shouldn't be

Re: Server.sendmail with no "to_addrs" parameter.

2006-03-22 Thread Tim Williams (gmail)
On 22 Mar 2006 08:31:16 -0800, EdWhyatt <[EMAIL PROTECTED]> wrote: So it's a restriction of Python?What I am trying to simulate here is the sending of mail to addressessolely in the CC and/or BCC fields - both of which are possible throughOutlook.-- http://mail.python.org/mailman/listinfo/python-li

Re: string.upto() and string.from()

2006-03-22 Thread Tim Williams (gmail)
On 22/03/06, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: > if  u"h" in u"hello, world !" and u"hello, world !".from("h"): >  return " u"hello, world !" >else:   # not really required, used for demonstration only >

Re: string.upto() and string.from()

2006-03-22 Thread Tim Williams (gmail)
On 22 Mar 2006 06:41:32 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I often need to re-code for myself a small code snippet to definestring.upto() and string.from(), which are used like : [snip] # if not found, return whole string> "hello, world !".upto("#") "hello, world !"> u"hello, wo

Re: Server.sendmail with no "to_addrs" parameter.

2006-03-22 Thread Tim Williams (gmail)
On 22 Mar 2006 03:18:41 -0800, EdWhyatt < [EMAIL PROTECTED]> wrote: Hi all, I have searched the group with no answer to this particularproblem.In my sendmail program, I would like to have the ability to send a mailmessage with no-one email address in the To field. I do this by adding the mail to th

Re: IMAP Checking Folder Size

2006-03-20 Thread Tim Williams (gmail)
On 20/03/06, Kevin F <[EMAIL PROTECTED]> wrote: Traceback (most recent call last):   File "/Life/School/ Homework/Spring 2006/OPIM 399/Tutorial/IMAP/mailboxsize.py", line 23, in -toplevel- number_of_messages_all += int(number_of_messages[0])ValueError: invalid literal for int(): The requested

Re: IMAP Folder Size Information

2006-03-20 Thread Tim Williams (gmail)
On 20/03/06, Kevin F <[EMAIL PROTECTED]> wrote: I'm trying to use the following code to get my remote server's foldersize information.  Unfortunately, i'm getting the error:Traceback (most recent call last):   File "/Life/School/Homework/Spring 2006/OPIM 399/Tutorial/IMAP/mailboxsize.py", line 23,

Re: string stripping issues

2006-03-03 Thread Tim Williams (gmail)
On 3 Mar 2006 00:20:21 -0800, P Boy <[EMAIL PROTECTED]> wrote: This seems like a web page parsing question. Another approach can be asfollows if you know the limiting token strings:a.split('SIZE=2>')[1].split('\r\n')[0] As others have mentioned , you really need a an HTML parser.   But the fo

Re: regular expresson for Unix and Dos Lineendings wanted

2006-02-24 Thread Tim Williams (gmail)
On 24/02/06, John Zenger <[EMAIL PROTECTED]> wrote: Franz Steinhaeusler wrote:>> Thank you all for the replies.> But I still don't have a solution.>re.sub(r"\s+[\n\r]+", lambda x: x.expand("\g<0>"). \ lstrip(" \t\f\v"),text).rstrip() But I think your code is a lot easier to read.  :) How about:

Re: problem(s) with import from parent dir: "from ../brave.py import sir_robin"

2006-02-24 Thread Tim Williams (gmail)
On 24 Feb 2006 05:10:37 -0800, per9000 <[EMAIL PROTECTED]> wrote: SHORT VERSION:I tried three variants of "from ../brave.py import sir_robin", oneworks. I want to use it in a py-file to execute command-line-style andthat does not work.Can someone please give me, not a bucket with the desert(s) on t

Re: Zope/Plone - Is it the right solution?

2006-02-21 Thread Tim Williams (gmail)
On 21 Feb 2006 08:00:03 -0800, Michele Simionato <[EMAIL PROTECTED]> wrote: For easy of use nothing beats CherryPy, but I am not sure how stable itis. If CherryPy is of interest then don't discount Karrigell,  it has a smaller learning curve and appears stable.   Overall I found it quicker to becom

Re: multiple email recipients

2006-02-20 Thread Tim Williams (gmail)
On 20/02/06, Rene Pijlman <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED]:>was wondering how to modify the code so as i can send to multiple email >recipients using "TO"? thanks.You add RFC 2822 headers.http://www.ietf.org/rfc/rfc2822.txt("3.6.3. Destination address fields") RFC 2822 relates to the f

Re: multiple email recipients

2006-02-20 Thread Tim Williams (gmail)
On 20 Feb 2006 01:01:38 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:hii currently am using this email function that can send single email address[SNIP]was wondering how to modify the code so as i can send to multiple emailrecipients using "TO"? thanks. You are making the common mistake of t

Re: python create mail

2006-01-12 Thread Tim Williams (gmail)
on 1/12/06, Tim Williams (gmail) < [EMAIL PROTECTED]> wrote: On 12 Jan 2006 04:28:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: hey I need help in sending email,It seems that while using  this set of commands from smtplib import SMTPs = SMTP()s.set_debuglevel

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Tim Williams (gmail)
On 12/01/06, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: On 12 Jan 2006 09:04:21 -0800, fynali < [EMAIL PROTECTED]> wrote: Hi all,I have two files:  - PSP320.dat (quite a large list of mobile numbers),  - CBR319.dat (a subset of the above, a list of barred bumber

Re: How to remove subset from a file efficiently?

2006-01-12 Thread Tim Williams (gmail)
On 12 Jan 2006 09:04:21 -0800, fynali <[EMAIL PROTECTED]> wrote: Hi all,I have two files:  - PSP320.dat (quite a large list of mobile numbers),  - CBR319.dat (a subset of the above, a list of barred bumbers)# head PSP320.dat CBR319.dat ==> PSP320.dat <==96653696338  

Re: how to improve this simple block of code

2006-01-12 Thread Tim Williams (gmail)
On 11/01/06, Mike Meyer <[EMAIL PROTECTED]> wrote: "py" <[EMAIL PROTECTED]> writes:> Say I have...> x = "132.00"> but I'd like to display it to be "132" ...dropping the trailing > zeros...I currently try this Is it likely that  x might not have any decimal places?    If so all the above solutions f

Re: python create mail

2006-01-12 Thread Tim Williams (gmail)
On 12 Jan 2006 04:28:44 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: hey I need help in sending email,It seems that while using  this set of commands from smtplib import SMTP s = SMTP() s.set_debuglevel(1) s.connect('outmail.huji.ac.il')I should be able to get a connection but what I get is

Re: smtplib error('Connection reset by peer')

2006-01-05 Thread Tim Williams (gmail)
On 4 Jan 2006 15:47:34 -0800, Van_Gogh <[EMAIL PROTECTED]> wrote: Hi,I am learning how to use the smtplib module, but am having some veryearly problems, maybe because I don't understand it.So, am I correct that by following the example in the Python: [snip]  When I try to create the server(the li

Re: compare dictionary values

2006-01-03 Thread Tim Williams (gmail)
On 30/12/05, rbt <[EMAIL PROTECTED]> wrote: What's a good way to compare values in dictionaries? I want to find[snip]My key-values pairs are filepaths and their modify times. I want toidentify files that have been updated or added since the script last ran. You don't need to store each file's upda

Re: compare dictionary values

2005-12-30 Thread Tim Williams (gmail)
In <[EMAIL PROTECTED]>, rbt wrote: > What's a good way to compare values in dictionaries? Do you need to compare dictionaries, if its an option it would be simpler/cheaper  to compare  each entry from your file listing with entries in a single dict and act accordingly, mainly because you will alrea

Re: reading files into dicts

2005-12-30 Thread Tim Williams (gmail)
On 30/12/05, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote: On 2005-12-30, Tim Williams (gmail) wrote:> Apologies for the top post, it was my first attempt at using gmail's> pda-enabled web interface. There is no option to bottom post.Can you not move the cursor? Nope,  th

Re: reading files into dicts

2005-12-29 Thread Tim Williams (gmail)
Apologies for the top post, it was my first attempt at using gmail's pda-enabled web interface. There is no option to bottom post. Apart from the mistake in my previous reply, when I meant to suggest using import instead of eval() not repr(). I also omitted an example. So here goes -but I don't kn

Re: reading files into dicts

2005-12-29 Thread Tim Williams (gmail)
A further thought, if you write the data to a file in the correct format, you can use import and reload to access the data later instead of repr. On 12/29/05, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: > On 30/12/05, Giovanni Bajo <[EMAIL PROTECTED]> wrote: &g

Re: reading files into dicts

2005-12-29 Thread Tim Williams (gmail)
On 30/12/05, Giovanni Bajo <[EMAIL PROTECTED]> wrote: >>> d = {'.\\sync_pics.py': 1135900993, '.\\file_history.txt': 1135900994, '.\\New Text Document.txt': 1135900552}>>> file("foo", "w").write(repr(d))>>> data = "" >>> data"{'.sync_pics.py': 1135900993, '.file_history.txt': 1135900994

Re: reading files into dicts

2005-12-29 Thread Tim Williams (gmail)
On 30/12/05, rbt <[EMAIL PROTECTED]> wrote: What's a good way to write a dictionary out to a file so that it can beeasily read back into a dict later? I've used realines() to read textfiles into lists... how can I do the same thing with dicts? Here's some sample output that I'd like to write to fil

Re: Modifying values in a list

2005-12-29 Thread Tim Williams (gmail)
On 29 Dec 2005 08:43:17 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:The following code:numbers = [1, 2, 3]for value in numbers: value *= 2print numbers Above,  you are modifying "value", not the item in the list >>> numbers = [1, 2, 3] >>> for x in range(len(numbers)): ...     num

Re: Windows and python execution

2005-12-26 Thread Tim Williams (gmail)
On 26/12/05, Mark Carter <[EMAIL PROTECTED]> wrote: What I would like to do it type something like > myscript.pyinstead of > python myscript.py Open an explorer window or open "My Computer" Click on TOOLS then FOLDER OPTIONS Select the "FILE TYPES tab and click on NEW Enter  PY as the file

Re: File object question

2005-12-22 Thread Tim Williams (gmail)
On 22/12/05, S. D. Rose <[EMAIL PROTECTED]> wrote: Hello all.  If I read a binary file:file = open('c:\\logo.gif', 'rw'') # Read from FS as one way to get theobject, d/l from website another...file.read()is there anyway I can determine the 'size' of the object file? (Without going to the filesystem

Re: A simple list question.

2005-12-22 Thread Tim Williams (gmail)
On 22/12/05, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: On 22 Dec 2005 10:14:10 -0800, KraftDiner < [EMAIL PROTECTED]> wrote: Is there a cleaner way to implement this code?if len(self.listOfObjects) == 0:self.listOfOb

Re: A simple list question.

2005-12-22 Thread Tim Williams (gmail)
On 22 Dec 2005 10:14:10 -0800, KraftDiner <[EMAIL PROTECTED]> wrote: Is there a cleaner way to implement this code?if len(self.listOfObjects) == 0:self.listOfObjects.append(self.currentObject)elif:  

Re: Parsing a date-time string?

2005-12-22 Thread Tim Williams (gmail)
On 21 Dec 2005 01:43:13 -0800, Tim N. van der Leeuw <[EMAIL PROTECTED]> wrote: Hi,I want to parse strings containing date-time, which look like thefollowing: "Mon Dec 19 11:06:12:333 CET 2005"[snipped]What I want to get is some sort of sortable date; either as a number or(if nothing else) as a str

Re: coverting EST to PST

2005-12-21 Thread Tim Williams (gmail)
On 21 Dec 2005 03:15:47 -0800, Narendra < [EMAIL PROTECTED]> wrote: Hi All,i got a problem. I need to convert time from EST standard to PSTstandard.Thu, 15 Dec 2005 09:24:19 -0500 to PST Quick and dirty,   might not work for times at the end of DST >>> import time >>> from email import Utils >>>

Re: Queueing in Python (ala JMS)

2005-12-20 Thread Tim Williams (gmail)
On 20 Dec 2005 15:01:02 +0100, Stefan Arentz <[EMAIL PROTECTED]> wrote: Is there a JMS-like API available for Python? I would like toquickly receive messages through the network and then processthose slowly in the backgound. In the Java world I would simplycreate a (persistent) queue and tell the J

Re: checking if a string contains a number

2005-12-20 Thread Tim Williams (gmail)
On 20/12/05, Suresh Jeevanandam <[EMAIL PROTECTED]> wrote: Hi,I have a string like,s1 = '12e3's2 = 'junk'Now before converting these values to float, I want to check if theyare valid numbers.s1.isdigit returns False. Is there any other function which

Re: How to get the path of current running python script?

2005-12-20 Thread Tim Williams (gmail)
On 20/12/05, Kevin Yuan <[EMAIL PROTECTED]> wrote: I tried the following  getFilePath = lambda name: os.path.normpath('%s\\%s' % (sys.modules[name].prefix, sys.modules[name].__name__)) getFilePath('__main__') getFilePath =  sys.argv[0]    ?? :) -- http://mail.python.org/mailman/listinf

Re: Displaying error message in a try except?

2005-12-11 Thread Tim Williams (gmail)
On 11/12/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote:> Fairly new to python.  In a try except how do you display the true> (raw) error message so it can be displayed back to the user? assuming that "true" means "the message you would get if you hadn'tused a try/except", the

Re: information needed to make a connection between computers

2005-12-11 Thread Tim Williams (gmail)
On 11/12/05, John Walton <[EMAIL PROTECTED]> wrote:  Hello again! I'm still working on that instant messenger (for science fair), and I have been reading about networking in some Java tutorials. In one part of it, it said to have a connection with another computer, you need to know the IP name of t

Re: Validating an email address

2005-12-09 Thread Tim Williams (gmail)
On 09/12/05, Ben Finney <[EMAIL PROTECTED]> wrote: The only validation you should be doing before sending the message ison the domain part. Since there are records available in DNS toverify, you can check those. Is there an MX record? Is the addressvalid? Do the mappings both way for that record ma

Re: Constructing RFC2822 Message

2005-12-05 Thread Tim Williams (gmail)
On 5 Dec 2005 06:27:44 -0800, Narendra <[EMAIL PROTECTED]> wrote: Hi All,This is narendra from india doing my engineering.i need to develop an E-mail client in python,which connects to my MTAon port 25 and sends email from there.I was able to do that but my e-mail is ending in bulk when i'm trying

Re: [Forged?] Re: How to find the port a server is listening on (from within the server)

2005-11-25 Thread Tim Williams (gmail)
On 26/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:    If I understand correctly, you're looking for the socket methodgetsockname(), documented at http://docs.python.org/lib/socket-objects.htmlJeff Many thanks Jeff, self.server.socket.getsockname() did the trick. -- -- http://mail.py

How to find the port a server is listening on (from within the server)

2005-11-25 Thread Tim Williams (gmail)
How can I find the port a server is listening on - at the commented line in the code below. (ie  self.serving_on_port_num =  ? ) I have googled a lot. :-( -- class BaseSrvr(SocketServer.ThreadingMixIn, SocketServer.TCPServer):  

Re: query domain registry from python?

2005-11-20 Thread Tim Williams (gmail)
On 19 Nov 2005 19:40:58 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:hi, does anyone know of a library that can query domain registry or any site that provide information to such an activity? as i want to build asimple domain name searching program for my own benefit.. thanks alot :D [TW]  

Re: Adding through recursion

2005-11-18 Thread Tim Williams (gmail)
On 18 Nov 2005 06:30:58 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:> I still don't get it. I tried to test with x = 0 and found that to Informative print statements can help you to see and understand  the program flow, especially if the problem is conceptual,  with no *real*  errors in yo

Re: Spambayes modifications with web services

2005-11-02 Thread Tim Williams (gmail)
On 02/11/05, Steve Holden <[EMAIL PROTECTED]> wrote: > Personally I didn't regard the reply as unhelpful, and I believe the > replier was honestly trying to get you to see that your rather naive > suggestion was most unlikely to make things better. > To the OP A tip for curing your own problem -

Re: dictionary that have functions with arguments

2005-11-02 Thread Tim Williams (gmail)
On 1 Nov 2005 20:02:41 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > i have a dictionary defined as > > execfunc = { 'key1' : func1 } ## def __HELLO(x=' '): print 'HELLO',x def __BYE(x=' '): print 'BYE',x def __PRINT(x=None, y=None): print 'PRINT',x,y c

Re: do cc list from smtplib

2005-10-21 Thread Tim Williams (gmail)
On 21/10/05, Steve Holden <[EMAIL PROTECTED]> wrote: > > Assuming that TO and CC are single addresses it would be saner to use: > :) Assuming that the envelope TOs (inc CCs) are the same as the Header-TOs and Header-CCs Actually, I think this would be safer ! > def email(HOST,FROM,TO,CC, RECI

Re: do cc list from smtplib

2005-10-21 Thread Tim Williams (gmail)
On 21 Oct 2005 02:34:40 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > def email(HOST,FROM,TO,CC,SUBJECT,BODY): > import smtplib > import string, sys > body = string.join(( > "From: %s" % FROM, > "To: %s" % TO, > "CC: %s % CC, > "Subject: %s" % SUBJECT, > "", >

Re: Send password over TCP connection

2005-10-10 Thread Tim Williams (gmail)
On 10 Oct 2005 13:31:51 -0700, dcrespo <[EMAIL PROTECTED]> wrote: > Hi. I found TSL, a Python Library that supports SRP. > Do you know where can I find a sample client and server code? Thanks > for your help. http://trevp.net/tlslite/ It comes with examples. I use it in several servers and clie

Re: socketServer questions

2005-10-08 Thread Tim Williams (gmail)
On 07/10/05, rbt <[EMAIL PROTECTED]> wrote: > I have written a python socketServer program and I have a few questions This is a multithreaded non-blocking version of your server (not tested), with a basic attempt to hande errors. from socket import * from SocketServer import * import time, threa

Re: Help installing Python 2.3 on Win2K

2005-09-23 Thread Tim Williams (gmail)
On 23/09/05, D.S. Hein <[EMAIL PROTECTED]> wrote: > I have tried various ways to set PYTHONPATH with the various directories > where I have python programs (i.e. xx.py) but no matter how I set > PYTHONPATH I keep getting a message that python can't open the python > file. If I try to specify t

Re: mailing from with python

2005-09-20 Thread Tim Williams (gmail)
On 20/09/05, M.N.A.Smadi <[EMAIL PROTECTED]> wrote: > hi; > if i want to send a mail message using the "mail" client on a machine > that has smtp protocol is there an easy way (i.e. like bash where you > would just type mail -s SUBJECT message RECIPIENT) to do it from a > python script? Any mail c

Re: Question about smtplib, and mail servers in general.

2005-09-20 Thread Tim Williams (gmail)
On 20/09/05, Daniel Dittmar <[EMAIL PROTECTED]> wrote: > Chris Dewin wrote: > > Hi. I've been thinking about using smtplib to run a mailing list from my > > website. > > > > s = smtplib.SMTP("server") > > s.sendmail(fromaddress, toaddresess, msg) > > > > Not really an answer to your question, bu

Re: Question about smtplib, and mail servers in general.

2005-09-20 Thread Tim Williams (gmail)
On 20/09/05, Chris Dewin <[EMAIL PROTECTED]> wrote: > > s = smtplib.SMTP("server") > s.sendmail(fromaddress, toaddresess, msg) > > I know that in this instance, the toaddresses variable can be a variable > of type list. > > Suppose the list contains well over 100 emails. Would that create some >

Re: how to build email message with attachment?

2005-07-26 Thread Tim Williams (gmail)
On 7/26/05, praba kar <[EMAIL PROTECTED]> wrote: > Dear All, > >Can any one let me know? How to build > email in python? with some some examples. > > regards > Prabahar The email module is what you need. http://docs.python.org/lib/module-email.html hth :) -- http://mail.python.org/mail

Re: dictionary that discards old items

2005-07-22 Thread Tim Williams (gmail)
On 7/21/05, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Will McGugan wrote: > > > I need a collection class that behaves like a dictionary but when it > > reaches 'n' items it discards the oldest item so that the length never > > goes above 'n'. (Its for caching search results) > > > > I have a v

Re: open a mail and...

2005-07-15 Thread Tim Williams (gmail)
On 7/15/05, Alberto Vera <[EMAIL PROTECTED]> wrote: > > Hello > > Is it possible to open a mail and download its files attached in a hard-disk > using a python script? > > Regards > -- > http://mail.python.org/mailman/listinfo/python-list > yes, use the email module. >>> msg = email.message_from_

Date & time in a Zip File

2005-07-13 Thread Tim Williams (gmail)
Using zipfile.Zipfile How can I add a file to a zip file and keep its date and time correct? Currently the date/time change to the time the file was added to the zip.Zipinfo doesn't have a write method! Solutions other than zipfile are welcome, with snippets if possible :) ginmf in this ins

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Tim Williams (gmail)
On 7/5/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > > I just tried this and it failed with IP addresses but not > > hostnames/machine names, try it again with the server name. :) > > Nope, same problem. I think TJG might be right, and our server probably > doesn't have IMAP running (yet). Could y

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-05 Thread Tim Williams (gmail)
On 7/5/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion, Tim. Unfortunately, I get a 'connection refused' > error on the line 'M = imaplib.IMAP4(server)'. It says "socket.error: > (10061, 'Connection refused')". I've tried both the external IP adress and > the internal one (10.

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-04 Thread Tim Williams (gmail)
On 7/4/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > > Anything else I could try? Lateral thinking ? === untested === import imaplib, time, sys f = open(msg_file) r = f.readlines() f.close() msg1 = ''.join(r) server = 'my.exchangeserver.com' # or IP address user = 'user' pw = 'pw' M = imaplib.

Re: POP3 and "seen" flag

2005-06-30 Thread Tim Williams (gmail)
> > > Hello All, > > Is there a way to know in a POP session of a message was seen (old) or not > (new)? > You have to keep a persistant local list of viewed messages , UID into a text file is often the simplest method. HTH :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary to tuple

2005-06-28 Thread Tim Williams (gmail)
On 28 Jun 2005 14:45:19 GMT, Odd-R. <[EMAIL PROTECTED]> wrote: > I have a dictionary, and I want to convert it to a tuple, > that is, I want each key - value pair in the dictionary > to be a tuple in a tuple. > > If this is the dictionary {1:'one',2:'two',3:'three'}, > then I want this to be the r

Re: Plain text email?

2005-06-27 Thread Tim Williams (gmail)
On 27 Jun 2005 15:38:59 -0700, Inkiniteo <[EMAIL PROTECTED]> wrote: > Hi guys. I have a script that sends the info by email, but i'd like to > avoid the convertion to HTML by the email client or Gmail, because it > ruins all the formatting i did (with tabs, mostly). Briefing, i wanna > be able to s

Re: Python & firewall control (Win32)

2005-06-27 Thread Tim Williams (gmail)
On 6/17/05, Tim Williams <[EMAIL PROTECTED]> wrote: > > > - Original Message - > > From: "Tom Anderson" <[EMAIL PROTECTED]> > > > re: http://wipfw.sourceforge.net/?page=home > > Tom, this looks good. I had it downloaded, installed and running some > custom rules in under 5 minutes. V

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Tim Williams (gmail)
On 6/20/05, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Paul Watson wrote: > > > While printf() does tightly control formatting in C, it does not in > > Python. > > There is no printf() in Python. You should not think of print as being a > Python version of printf. For quick and simple removal