How can I use my modules here?

K

Kermit Mei

Hello community!

I write a modules for testing, and my code is like this(under Linux):


$ tree
..
|-- MyTestModules
| |-- Test1.py
| |-- Test2.py
| `-- __init__.py
`-- main.py

1 directory, 4 files

$ find . -name '*.py' -print0|xargs -0 cat

############ main.py Begin ##############
#!/usr/bin/env python

from MyTestModules import Test1,Test2

t1 = Test1()
t2 = Test2()

print t1.first()
print t2.first()
############ main.py End ###############

#############Test1.py Begin ##########
#!/usr/bin/env python

class Test1:
def first(self):
return self.arg1

#############Test1.py End ############

#############Test1.py Begin ##########
#!/usr/bin/env python

class Test2:
def first(self):
return self.arg1

#############Test1.py End ############

###### __init__.py Begin ############
#!/usr/bin/env python

###### __init__.py End ############


When I run the main.py, the following error takes:

$ ./main.py
from: can't read /var/mail/MyTestModules
../main.py: line 7: syntax error near unexpected token `('
../main.py: line 7: `t1 = Test1()'




Waiting for your help.
Thanks.

Best Regards

Kermit Mei
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top