I'm confused about how to use the email module in python 2.4.x
I'm using python packaged with suse 9.3.
From the module documetation at http://docs.python.org/lib/node597.html I
found the following example (items cut):
import email
....
msg = email.message_from_file(fp)
...
Yet, when I try this I get the message
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'module' object has no attribute 'message_from_file'
so I dir(email) reveals:
['__builtins__', '__doc__', '__file__', '__name__', 'cStringIO', 'email',
'getMessage', 'sys']
This is nothing like the documentation on python.org.
Any idea what I am missing?
--
David Bear
-- let me buy your intellectual property, I want to own your thoughts -- 2 2241
David Bear wrote: I'm confused about how to use the email module in python 2.4.x
I'm using python packaged with suse 9.3.
From the module documetation at http://docs.python.org/lib/node597.html I found the following example (items cut):
import email
... msg = email.message_from_file(fp) ..
Yet, when I try this I get the message
Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'message_from_file'
so I dir(email) reveals:
['__builtins__', '__doc__', '__file__', '__name__', 'cStringIO', 'email', 'getMessage', 'sys']
This is nothing like the documentation on python.org.
Any idea what I am missing?
That's not what I have on OS X with Python 2.4.1.
In [1]: import email
In [2]: dir(email)
Out[2]:
['__all__',
'__builtins__',
'__doc__',
'__file__',
'__name__',
'__path__',
'__version__',
'message_from_file',
'message_from_string']
Are you sure that you're getting the right file? Check email.__file__ .
--
Robert Kern ro*********@gmail.com
"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
Robert Kern wrote: David Bear wrote: I'm confused about how to use the email module in python 2.4.x
I'm using python packaged with suse 9.3.
From the module documetation at http://docs.python.org/lib/node597.html I found the following example (items cut):
import email
... msg = email.message_from_file(fp) ..
Yet, when I try this I get the message
Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'message_from_file'
so I dir(email) reveals:
['__builtins__', '__doc__', '__file__', '__name__', 'cStringIO', 'email', 'getMessage', 'sys']
This is nothing like the documentation on python.org.
Any idea what I am missing?
That's not what I have on OS X with Python 2.4.1.
In [1]: import email
In [2]: dir(email) Out[2]: ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '__version__', 'message_from_file', 'message_from_string']
Are you sure that you're getting the right file? Check email.__file__ .
never mind. I just discovered my error.
--
David Bear
-- let me buy your intellectual property, I want to own your thoughts -- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Stuart D. Gathman |
last post by:
I am trying to convert an application using rfc822, mimetools and
multifile to use the new email package. In addition to the param parsing
anomoly noted earlier, here is a test message that the...
|
by: Adrien Di Mascio |
last post by:
Hi all,
While reading the email module documentation, I found an error in a
small example given for the as_string() method of the Message class:
Here is the given code :
(URL :...
|
by: Chuck Amadi |
last post by:
A little help has anyone used the email-dir.py Email Module ,I have downloaded
the example and would like some pointers to get it going .
For example Have I got to add any parameters to python...
|
by: Arenz, Ralph |
last post by:
hi all,
my problem is to get a tiff-file-attachment out of an email sent by a
fax-server.
When i try this with "get_payload(decode='True')" i get additional
informations, looks like...
|
by: Tony Burrows |
last post by:
Just getting to grips with Python, a great language BUT
With something like Java I can find the syntax of a method call with no
problems, how do I do the same with Python?
For example, using...
|
by: Erik Johnson |
last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an
attached HTML file.
I have scripts that send basic emails via the smtplib module that don't
have any attachements and that...
|
by: rb.online |
last post by:
Hi all,
I rencently had trouble finding a bug in an email processing script
because of an error that pass silently in the email module.
The get_payload() method in the email.message module...
|
by: Nico Grubert |
last post by:
Hi there,
I wrote a short python script that sends an email using python's email
module and I am using Python 2.3.5.
The problem is, that umlauts are not displayed properly in some email...
|
by: Lev Elbert |
last post by:
Hi, all!
I have to make a custom email module, based on the standard one. The
custom module has to be able to work with extremely large mails (1GB
+), having memory "footprint" much smaller....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |