[Tutor] assert() question

2008-07-05 Thread Dick Moores
I have a module, mycalc.py, which is a collection of functions designed to be imported independently. I've heard about using assert() to check up on whether things are still working correctly, or something like that. So I've begun to write some assert() expressions(?)  and put them at the bottom

Re: [Tutor] module paths

2008-07-05 Thread Gonzalo Garcia-Perate
That's what I thought but no. There is an install of 2.4 but not in use. /usr/local/bin/Python points to -> /Library/Frameworks/Python.framework/Versions/2.5/bin/python feedparser is installed in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages both the interactive in

Re: [Tutor] module paths

2008-07-05 Thread arsyed
I copy/pasted your script and it ran fine on my end. Is it possible that you've got more than one installation of python and the feedparser module is installed somewhere other than for the python interpreter at /usr/local/bin/python (since that's what your script references)? Perhaps trying "python

Re: [Tutor] Exploring the Standard Library

2008-07-05 Thread arsyed
This might work: >>> import os >>> print os.__file__ c:\devtools\Python25\lib\os.pyc Also, you might find Doug Hellman's "Python Module Of The Week" helpful: http://www.doughellmann.com/projects/PyMOTW/ On 7/5/08, Nathan Farrar <[EMAIL PROTECTED]> wrote: > > I'd like to spend some time expl

[Tutor] Wave error (solved)

2008-07-05 Thread Alex Krycek
Per someone's suggestion I changed my wave files from 32 bit to 16 bit. I can now open (and manipulate) them without any error. I'm not sure why it worked but it worked. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] my first object model, using an interface

2008-07-05 Thread tpc247
Dear fellow Python enthusiasts: I want to run an idea by you to see if I understand modeling objects adequately, after reading Alan Gauld's excellent tutorial and two brief articles about interfaces in Python, here: http://www.freenetpages.co.uk/hp/alan.gauld/tutclass.htm http:/

[Tutor] Voice Text To Speech and Wav File Make and Save

2008-07-05 Thread FT
Hi! I got my text to speech to work better, will in the future remove the buttons and only have the file menu. It seems to work fine and now use sub menu's for voice settings. What will be needed as an event to capture the cursor movement inside the text box. How do I get the key and

Re: [Tutor] Tutor Digest, Vol 53, Issue 18

2008-07-05 Thread Alan Gauld
"kinuthiA muchanE" <[EMAIL PROTECTED]> wrote python on Ubuntu. How would I find the location of the modules (find / -name "os.py" does not yield results)? Not all modules are implemented as .py files. Some are compiled C libraries. Thus searching for .py will not find all Python modules. A

[Tutor] Wave module

2008-07-05 Thread Alex Krycek
Hello, I'm trying to join two .wav files with the wave module. But when I try to use wave.open(filename, "rb") I receive the following error: Traceback (most recent call last): File "", line 1, in File "F:\PortablePython1.0\lib\wave.py", line 483, in open return Wave_read(f) File "F:\P

[Tutor] module paths

2008-07-05 Thread Gonzalo Garcia-Perate
I'm looking at python after a long time. I wanted to build a quick parser for some rss feeds and have started using feedparser. When I test my code on the python interactive shell things work fine but when I try to write it into a file I get the following error: AttributeError: 'module' object has

Re: [Tutor] Script Name/Path Information

2008-07-05 Thread Josh Rosen
How about the following: import os print os.path.abspath(__file__) # the full absolute path to the current module's file print os.path.split(os.path.abspath(__file__)) # if you need the individual components of the path. On Jul 5, 2008, at 11:00 AM, Monika Jisswel wrote: import sys

Re: [Tutor] Tutor Digest, Vol 53, Issue 18

2008-07-05 Thread kinuthiA muchanE
On Sat, 2008-07-05 at 20:23 +0200, [EMAIL PROTECTED] wrote: > Message: 7 > Date: Sat, 05 Jul 2008 12:23:36 -0600 > From: Nathan Farrar <[EMAIL PROTECTED]> > Subject: [Tutor] Exploring the Standard Library > To: Python Tutor > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset="us

Re: [Tutor] Script Name/Path Information

2008-07-05 Thread Steve Willoughby
Monika Jisswel wrote: import sys #a module that gives access to the system import os#a module that gives access to the os print sys.argv[0] #prints file name of the script print os.getcwd() #print current working directory print os.getcwd()+sys.argv[0] # but os.getcwd() retu

Re: [Tutor] Exploring the Standard Library

2008-07-05 Thread Monika Jisswel
import sys print sys.path but no one recommends starting with python from there. you're better of reading the python.org/doc files. 2008/7/5 Nathan Farrar <[EMAIL PROTECTED]>: > I'd like to spend some time exploring the standard library. I'm running > python on Ubuntu. How would I find the

Re: [Tutor] Exploring the Standard Library

2008-07-05 Thread amingv
The python interpreter can give you this information; just type: import sys for i in sys.path: print i And search in the lib directories it shows. You might also be interested in the std library reference at docs.python.org. -- Amin Rainmaker--- Begin Message --- I'd like to spend some time

Re: [Tutor] loops, variables and strings

2008-07-05 Thread bob gailer
James wrote: All, I'm trying to do something pretty simple, but I can't seem to get Python to behave nicely. :) I'd like to automate a script that sends out three or four lists in an e-mail. I have a function dedicated to sending e-mail that will take a string variable, slap it in a message, an

[Tutor] Exploring the Standard Library

2008-07-05 Thread Nathan Farrar
I'd like to spend some time exploring the standard library. I'm running python on Ubuntu. How would I find the location of the modules (find / -name "os.py" does not yield results)? Thanks! Nathan ___ Tutor maillist - Tutor@python.org http://mail.pyt

Re: [Tutor] loops, variables and strings

2008-07-05 Thread Monika Jisswel
maybe StringIO ? MsgBody = StringIO.StringIO() print >> MsgBody, "Hello. Below is an automated e-mail with important statistics." print >> MsgBody, ""#empty line print >> MsgBody, ""#empty line print >> MsgBody, "The following user accounts expired today:" print >> MsgBody, " - " %

Re: [Tutor] Script Name/Path Information

2008-07-05 Thread Monika Jisswel
import sys #a module that gives access to the system import os#a module that gives access to the os print sys.argv[0] #prints file name of the script print os.getcwd() #print current working directory print os.getcwd()+sys.argv[0] # 2008/7/5 Nathan Farrar <[EMAIL PROTECTED]>

[Tutor] Script Name/Path Information

2008-07-05 Thread Nathan Farrar
I'm new to python and wondering if there is a way to reference information about the script that is running. For example, if I was running a script named "FileInfo.py" from the directory "/home/username", I'm looking for attributes such that something similar to: print self.name print self.path

[Tutor] loops, variables and strings

2008-07-05 Thread James
All, I'm trying to do something pretty simple, but I can't seem to get Python to behave nicely. :) I'd like to automate a script that sends out three or four lists in an e-mail. I have a function dedicated to sending e-mail that will take a string variable, slap it in a message, and send it on it

Re: [Tutor] graphs & diagrams in python

2008-07-05 Thread Kent Johnson
On Fri, Jul 4, 2008 at 3:54 PM, Monika Jisswel <[EMAIL PROTECTED]> wrote: > Hi Again, > > What is the best library for drawing graphs & diagrams to ilustrate some > statistics ? A few possibilities here: http://wiki.python.org/moin/GraphicsAndImages Kent __