I want to pass a variable from fileA.py to fileB.py but i don't know how use (import) it in fileB.py.
I have this situation (frames folder and file.A are at same level)
frames
|
folder
|
fileB.py
fileA.py
In the fileA.pyi have an image and i want to pass it in fileB.py
immagine= cv2.imread('image.jpg')
os.chdir("frames/folder")
subprocess.call(["python", "fileB.py", 'immagine'])
I think this works well but i don't know how import immagine in fileB.py.
Maybe i should to use:
from ..fileA.py from immagine
but not works and i have this error: ImportError: attempted relative import with no known parent package
I hope you can help me... i'm really new in python (like Ide i use pycharm and i use it to install modules - of course fileB.py and fileA.py aren't modules but normal python files)