I am using a python file. I want to call another python code. Is there a way with which I can return data from the second python code to call the python code. Any function like a function returns the value of the calling function.
I must admit that I do not see the problem:
test1.py :
test1.py
def myfunc(): return "spam!"
test2.py :
test2.py
import test1 print(test1.myfunc())
Output when running test2.py :
spam!
Get everything into classes and functions and read a lot about importing modules
Source: https://habr.com/ru/post/1483676/More articles:Defining a carry and overflow flag in 6502 emulation in Java? - javaRabbitMQ: Direct Exchange vs Fanout Exchange - c #Fast (exploded) vector operations MATLAB ... very fast - optimizationIs it possible to return a value from one Python file to another? - pythonReturns values ββfrom one script to another script - pythonThe main layout for using events caused by a child view in one of its regions - jqueryunderstanding of how to import variables from a method - variablesSkip last line of CSV file when repeating in Python - pythonLink existing Linux device structure to device file - linux-kernelIs CommandArgument attribute validation required (used with ASP.NET Relay)? - asp.netAll Articles