OK, prerequisites:
- It's my first ever Python project. I used to do some scripting but never anything bigger
- So I'm at the very beginning of a learning curve. It's like when you can't kill an ant in Fallout 2 Temple level. On later levels, I was really good in Fall 2:)
Problem:
I can't figure out how to import a module written by me and placed in a different folder
Context:
The project I'm intended to create is meant to do a lot of measures conversions. So I decided to store in DB all data in the same unit system & keep all conversions upon user preferences on a codebase level
In a different folder I decided to store tests. To write the very first one (testing the abovementioned module) I need to import the module, but here is the story begins. I know it's classic, but I'm completely messed with import
Toolkit:
- PyCharm Pro (PyCharm 2021.3.1)
- Python 3.7 interpreter
- macOS 10.15, Intell
Set up: Settings screenshot provided
- Project structure. Folders are marked as Source & Test
- I need to import from conversions.py to test_conversions.py
- PYTHONPATH settings like this
What do I, for the sake of God, need: with all the abovementioned, how do I import conversions.py to test_conversions.py or any other place of my project? I read a number of articles and it's getting me anywhere (contradictory, 2.x related, etc). I feel like I need a piece of more foundational info but as well I need a clear walkthrough, a code snippet to import bloody file, I really appreciate any kind of advice