Quantcast
Channel: Active questions tagged 22.04 - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4536

Python3 won't recognize my custom module's functions? [closed]

$
0
0

So I have to write a separate module containing the functions for another python program for school.

I have both the main program and the module contained in the same folder/directory, both saved as .py files, but when I try running the program and calling the function from the imported module, it gives me this error:

name "falling_distance" is not defined.

I called it as falling_distance() and yet it did not work. To make sure this was the issue I also wrote a little test() function that prints the word "Test!" and that too gave the same error. I made sure the module was imported.

How do I get python to recognize the functions in the module? Thanks.

Oddly, it does seem to recognize the module itself when I import it, as it will give me another error if I mistype the module's name.


Viewing all articles
Browse latest Browse all 4536

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>