4

I'm new to Python and I searched google a lot and read some articles about relative imports etc. Despite the fact that I am unable to get it working. Please, consider my following project structure:

/Project /docs /log /prev /src a.py /tests /tests1 b.py /tests2 .gitignore README.txt program.py 

And what I'm trying to achieve is to import a class from file a.py inside of the script b.py. Generally speaking, script b.py should have line with import of a.py. I've read some articles about using __init__.py files, where should I put them? And should I change PYTHONPATH some way, how? And last question, is project structure OK? Thank you for your time and help!

4

1 Answer 1

1

You need to use Python unit tests and you can start with how-do-i-run-all-python-unit-tests-in-a-directory.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.