another problem with modules

2011-02-17 Thread Tim Hanson
Okay, I solved my problem with Python finding modules: I put the following into a file in my home directory, on the good advice of Andrea Crotti: import sys sys.path.append('/home/foo/mypath' I named the file ~/pypath.py, so now, in idle: import pypath No errors. I'm still getting a little

Re: another problem with modules

2011-02-17 Thread Robert Kern
On 2/17/11 11:11 AM, Tim Hanson wrote: import pypath import intersect #the name of a file that contains the above short function. intersect('spam','spmmer') Traceback (most recent call last): File pyshell#2, line 1, inmodule intersect('spam','spmmer') TypeError: 'module' object is not

Re: another problem with modules

2011-02-17 Thread MRAB
On 17/02/2011 17:11, Tim Hanson wrote: Okay, I solved my problem with Python finding modules: I put the following into a file in my home directory, on the good advice of Andrea Crotti: import sys sys.path.append('/home/foo/mypath' I named the file ~/pypath.py, so now, in idle: import pypath

another problem..

2009-12-16 Thread codefly
now.. another problem.. when i type me = code2() the error is here.. Traceback (most recent call last): File stdin, line 1, in module TypeError: 'module' object is not callable -- http://mail.python.org/mailman/listinfo/python-list

Re: another problem..

2009-12-16 Thread Dave Angel
codefly wrote: now.. another problem.. when i type me = code2() the error is here.. Traceback (most recent call last): File stdin, line 1, in module TypeError: 'module' object is not callable By creating a new thread for each new question, you're forcing yourself to repeat the code

Re: another problem..

2009-12-16 Thread Grant Edwards
On 2009-12-16, codefly coron...@gmail.com wrote: now.. another problem.. Sorry to be so blunt, but your main problem is that you don't know how to ask questions. Fix that, and everything else will become much easier: 1) Read this: http://catb.org/~esr/faqs/smart-questions.html 2) Read

Another problem with 'Dive Into Python'

2006-07-31 Thread Ben Edwards (lists)
Am going through Chapter 9 - HTTP Web Services in dive into Python. It uses the following: data = urllib.urlopen('http://diveintomark.org/xml/atom.xml').read() The page no longer exists, can anyone recommend an alternative page to use? Ben --

Re: Adding paths to sys.path permanently, and another problem...

2004-12-17 Thread Amir Dekel
Jeff Shannon wrote: Judging from this, I think that os.environ['USERPROFILE'] seems like it may do what you want, though os.environ['APPDATA'] might be useful as well. Of course, if you're trying to get something to work cross-platform, things may be more difficult -- but that's because

Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Amir Dekel
Hi everyone, I have two problems: 1. How can I keep my changes in sys.path after closing the interpreter? 2. os.path.expanduser(~) always gives me C:\\ instead of my homepath. I have tried to change my homepath in WinXP using set homepath(in command line), and alsaw using the Environment

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Lenard Lindstrom
Amir Dekel [EMAIL PROTECTED] writes: Hi everyone, I have two problems: 1. How can I keep my changes in sys.path after closing the interpreter? Just how flexible does this need to be? sys.path can easily be altered at startup from within a sitecustomize module (section 3.28 -- site --

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Amir Dekel
Jeff Shannon wrote: Not only can one modify the environment variable PYTHONPATH, but one can also use a .pth file. Under windows, when the interpreter starts up it will search its default sys.path for any files with extension .pth; if it finds any, then it will use each line of those files as

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Jeff Shannon
Amir Dekel wrote: 2. os.path.expanduser(~) always gives me C:\\ instead of my homepath. I have tried to change my homepath in WinXP using set homepath(in command line), and alsaw using the Environment Variables in WinXP system properties, non helped. I really have to fix this somehow. Well,

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Jean Brouwers
Maybe, set environment variable PYTHONPATH. More details at http://www.python.org/doc/current/tut/node8.html /Jean Brouwers In article [EMAIL PROTECTED], Lenard Lindstrom [EMAIL PROTECTED] wrote: Amir Dekel [EMAIL PROTECTED] writes: Hi everyone, I have two problems: 1. How

Re: Adding paths to sys.path permanently, and another problem...

2004-12-16 Thread Jeff Shannon
Lenard Lindstrom wrote: Amir Dekel [EMAIL PROTECTED] writes: Hi everyone, I have two problems: 1. How can I keep my changes in sys.path after closing the interpreter? Saving sys.path changes between interpreter runs would be more involved. On Windows Python loads the initial module search