'Referencing another project
In a simple program I made, I wanted to get a list from another project and access the elements from it. Since I'm new to python, I don't really have any idea what to do. In my project, I checked the box for the project name I wanted to reference and... I don't know what to do. A few google searched did me no good, so I'm hoping someone here can tell/link me how to set this up.
Solution 1:[1]
Generally if you have some code in project1.py and then want to use it from a different file in the same directory, you can import project1 as a module:
import project1
data = project1.my_data_function()
This works just the same way as you would import any module form the standard library.
Solution 2:[2]
Not sure if this will help but I had a similar problem. My problem was the main accessor file was not in the root folder. I had it inside another folder. The reference worked as soon and I moved it to the root folder.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sth |
| Solution 2 | Kaane Guji |
