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
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
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
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,
> "",
>
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
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
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 -
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
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]
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):
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
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
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
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
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
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
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
>
>
> 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
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.
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.
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
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
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_
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
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
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
>
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
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
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
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
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
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
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
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
>>>
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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,
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
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
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
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
>
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
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
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
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
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
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
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://
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
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
73 matches
Mail list logo