Mar-08-2018, 03:53 PM
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
then I think I fixed it by changing to
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
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
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