Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyuff
#1
Hello,

I am a beginner with python and I would like to use the package pyuff to read some unv files using python3.

I try to use the examples here https://github.com/openmodal/pyuff (test_58.py)
but I don't get how to make it work.

I started by having the problem "NameError: name '__file__' is not defined" happening here
Quote:import numpy as np
import sys, os
my_path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, my_path + '/../')

then I think I fixed it by changing to
Quote:import numpy as np
import sys, os
my_path = os.path.dirname(os.path.abspath('__file__'))
sys.path.insert(0, my_path + '/../')

But I don't know why I needed to make this modification, more than that the code is not returning any thing.
Why do I have such a main in the code
Quote:if __name__ == '__mains__':
np.testing.run_module_suite()

Why is it mains not main and what is the testing line there for ?


I ll appreciate if you help me understand all this.


Best regards,
Oussama
Reply


Messages In This Thread
pyuff - by Ragnar - Mar-08-2018, 03:53 PM
RE: pyuff - by buran - Mar-09-2018, 07:27 AM
RE: pyuff - by Ragnar - Mar-09-2018, 09:28 AM
RE: pyuff - by buran - Mar-09-2018, 09:56 AM
RE: pyuff - by Ragnar - Mar-09-2018, 02:02 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020