For example,
from math import factorial def factorial(n): return factorial(n)
There is a Python file called
from file1 import factorial
a = input("n : ") print (factorial(a))
Suppose you have a file called file2.py.
I'd like to send the n value input from file2 to file1, is there any way?
python module import
It means from, so you can write that value. I don't know because I'm not looking at the whole code, but I can't load a function without n. If n is not in the function, you can do from file2 import *.
3079 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
1921 M2 Mac fails to install rbenv install 3.1.3 due to errors
1751 I want to run pyautogui without remote connection on Windows 10 in the cloud
1788 Uncaught (inpromise) Error on Electron: An object could not be cloned
2558 I want to display multiple lines with FFmpeg subtitles.
© 2026 OneMinuteCode. All rights reserved.