M
M
MMFARSE2020-08-13 11:49:13
Python
MMFARSE, 2020-08-13 11:49:13

How to make import file with function work?

The file with the function has import and the name of the module, but when importing this file into another and calling the import function, it does not work, how to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-08-13
@shurshur

import modulename
result = modulename.functionname(arg1,arg2)

from modulename import functionname
result = functionname(arg1,arg2)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question