Issue
I've got two files, one is a calculation step.py for the other main.py file, it calculates some stuff and assembles an array that array is saved in an Excel file.
The other main.py file should get the array from step.py, I know could just read the information from the Excel file, but I'm sure there is a way to hand over the array (or I really hope so).
step.py:
def SimStep(ResultFile,param_list):
#after some calculation stuff going on...
Module_P=panda.DataFrame(colums=["some columns",...])* #here is the array
this function is not called in step.py but in main.py:
import step as step
class MainWindow(QtWidgets.QMainWindow):
def __init__(self,..): #there is some PyQt happening
self.step() #calling the function
def step(self):
step.SimStep(self.lineResultsFile.text(),param_list) #using it for the calculation*
Solution
Just return the array from SimStep function
def SimStep(ResultFile,param_list):
# calculation
Module_P=panda.DataFrame(colums=["some columns",...])*
return Module_P
and store the array in the step function of MainWindow class
import step as step
class MainWindow(QtWidgets.QMainWindow):
def __init__(self):
self.step()
def step(self):
Module_P_array = step.SimStep(self.lineResultsFile.text(),param_list)
print(Module_P_array)
Answered By - Ankit Arora
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.