Re: import help

2006-08-07 Thread Rob Wolfe
placid wrote: > Hi all, > > How do i import a module that has an hypen/dash (-) in its name ? I get > a SytaxError exception You can use function __import__. >>> print open("-test.py").read() def fun2(): return "Hello from -test !" >>> import -test File "", line 1 import -test

Re: import help

2006-08-07 Thread Gary Herron
placid wrote: > Hi all, > > How do i import a module that has an hypen/dash (-) in its name ? I get > a SytaxError exception > > Cheers > > You can't do that directly. However, the internals of the import mechanism are available to the programmer through a module named imp. It allows you to im

import help

2006-08-07 Thread placid
Hi all, How do i import a module that has an hypen/dash (-) in its name ? I get a SytaxError exception Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: import help

2006-04-10 Thread placid
Dennis Lee Bieber wrote: > On 10 Apr 2006 20:55:31 -0700, "placid" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > > > > > Traceback (most recent call last): > > File "LinkedList.py", line 7, in ? > > main() > > File "LinkedList.py", line 4, in main > > n = Node

Re: import help

2006-04-10 Thread placid
so there is a record of this problem i had, to solve this problem either use import node . . . n = node.Node("test") or from node import * . . . n = Node("test") Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: import help

2006-04-10 Thread placid
Scott David Daniels wrote: > placid wrote: > > I have the following class code for a Node for a Linked List, (saved in > > node.py) > > > > class Node : > > def __init__(self,element): > >self.element = element > >self.next = None > > > > then i have another module called Link

Re: import help

2006-04-10 Thread Scott David Daniels
placid wrote: > I have the following class code for a Node for a Linked List, (saved in > node.py) > > class Node : > def __init__(self,element): >self.element = element >self.next = None > > then i have another module called LinkedList.py, with following code > > import sys

import help

2006-04-10 Thread placid
Hi all, I have the following class code for a Node for a Linked List, (saved in node.py) class Node : def __init__(self,element): self.element = element self.next = None then i have another module called LinkedList.py, with following code import sys import node def main():

Re: import Help Needed - Newbie

2005-07-08 Thread Dan
On 7/7/2005 5:50 PM, GregM wrote: > A search on google for odbchelper resulted in: > http://linux.duke.edu/~mstenner/free-docs/diveintopython-3.9-1/py/odbchelper.py > > I think this will help you. > Greg. > That is the previous example which worked for me fine. I have this code on a network dr

Re: import Help Needed - Newbie

2005-07-07 Thread GregM
A search on google for odbchelper resulted in: http://linux.duke.edu/~mstenner/free-docs/diveintopython-3.9-1/py/odbchelper.py I think this will help you. Greg. -- http://mail.python.org/mailman/listinfo/python-list

import Help Needed - Newbie

2005-07-07 Thread Dan
Hi I am trying to learn Python with the "Dive Into Python" book coming from VB, but am getting stuck at Example 2.3 (http://www.diveintopython.org/getting_to_know_python/everything_is_an_object.html). Here is what I get following the book's directions for: >>> import odbchelper Traceback