I two .py files:
file_1.py
file_2.py
file_1.py
contains code that will open an raster and split it into sections. Similar to creating a grid and clipping to each grid within QGIS. I have a variable x
set as my file that I want to use "raster.tif". I would like import this variable into file_2.py. I found this answer by @Ashwini Chaudhary (import file_1
then file_1.x
). The problem I am facing is when I run file_2.py
, file_1
is executing first. I simply want to access the variable and not execute the file. Is that possible to do?