[Tutor] Need help on a simple problem (i think)

Marcus Konermann m_konermann@gmx.de
Wed, 11 Apr 2001 23:45:20 +0200


--------------F02AE80BD61521123CF7363D
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hello !

Iīve got two moduls. The first one is mainko.py and the second one
functions.py and i only want to call a method from the mainko.py modul
named test, wich is declared in the modul functions.py.
This is mainko.py :

import string,re,sys,glob,operator
from functions import *
import os

#print os.getcwd()
#print os.listdir(os.getcwd())
#ausgabe=[]
print 'test()=',test()
#abweichung('soll.out',(((3,5),1),((7,9),1)),'ist.out',(((3,5),1),((7,9),1)),r'\d+\.\d+[E][+-]\d+',r'[
]+')
#print 'ausgabe=',ausgabe

#((3,5),1),(4,(1,3)),(5,1)))

and this is the modul functions.py :

import string,sys
from math import *
from types import *
from identify import  identification

class operation(identification):

 def __init__(self,srchfiles,pattfile,splitfile):
  identification.__init__(self,srchfiles,pattfile,splitfile)

 def test(self):
  print'it is ok'

and the ERROR Output from Python is the following:

test()=Traceback (innermost last):
  File
"C:\Arbeit_Studienarbeit\PythonPROG\Pythonwin\pywin\framework\scriptutils.py",
line 237, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Arbeit_Studienarbeit\Arbeit\Marcus\aktuell\mainko.py", line
8, in ?
    print 'test()=',test()
NameError: test

and I donīt know why thereīs a NameError. Iīm using Pythonwin under
Win98 and a few days before i put my working directory in another
destination, probably there could be an answer of my problem.
I already put the following PATH Command in my autoexec.bat:

SET
PYTHONPATH=c:\arbeit_studienarbeit\arbeit\marcus\aktuell;c:\arbeit_studienarbeit\pythonprog\lib

but nothing happend.
So ,can anyone help me ???

Thanks a lot
Marcus

--------------F02AE80BD61521123CF7363D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hello !
<p>I&acute;ve got two moduls. The first one is mainko.py and the second
one functions.py and i only want to call a method from the mainko.py modul
named test, wich is declared in the modul functions.py.
<br>This is mainko.py :
<p><i>import string,re,sys,glob,operator</i>
<br><i>from functions import *</i>
<br><i>import os</i>
<p><i>#print os.getcwd()</i>
<br><i>#print os.listdir(os.getcwd())</i>
<br><i>#ausgabe=[]</i>
<br><i>print 'test()=',test()</i>
<br><i>#abweichung('soll.out',(((3,5),1),((7,9),1)),'ist.out',(((3,5),1),((7,9),1)),r'\d+\.\d+[E][+-]\d+',r'[
]+')</i>
<br><i>#print 'ausgabe=',ausgabe</i>
<p><i>#((3,5),1),(4,(1,3)),(5,1)))</i>
<p>and this is the modul functions.py :
<p><i>import string,sys</i>
<br><i>from math import *</i>
<br><i>from types import *</i>
<br><i>from identify import&nbsp; identification</i>
<p><i>class operation(identification):</i>
<p><i>&nbsp;def __init__(self,srchfiles,pattfile,splitfile):</i>
<br><i>&nbsp; identification.__init__(self,srchfiles,pattfile,splitfile)</i>
<p><i>&nbsp;def test(self):</i>
<br><i>&nbsp; print'it is ok'</i>
<p>and the ERROR Output from Python is the following:
<p><i>test()=Traceback (innermost last):</i>
<br><i>&nbsp; File "C:\Arbeit_Studienarbeit\PythonPROG\Pythonwin\pywin\framework\scriptutils.py",
line 237, in RunScript</i>
<br><i>&nbsp;&nbsp;&nbsp; exec codeObject in __main__.__dict__</i>
<br><i>&nbsp; File "C:\Arbeit_Studienarbeit\Arbeit\Marcus\aktuell\mainko.py",
line 8, in ?</i>
<br><i>&nbsp;&nbsp;&nbsp; print 'test()=',test()</i>
<br><i>NameError: test</i>
<p>and I don&acute;t know why there&acute;s a NameError. I&acute;m using
Pythonwin under Win98 and a few days before i put my working directory
in another destination, probably there could be an answer of my problem.
<br>I already put the following PATH Command in my autoexec.bat:
<p>SET PYTHONPATH=c:\arbeit_studienarbeit\arbeit\marcus\aktuell;c:\arbeit_studienarbeit\pythonprog\lib
<p>but nothing happend.
<br>So ,can anyone help me ???
<p>Thanks a lot
<br>Marcus</html>

--------------F02AE80BD61521123CF7363D--