Skip to content
Advertisement

Tag: python-module

Invoking python3 with no arguments results in the interpreter opening a script called dis.py in the current directory. How to avoid similar problems?

Invoking the python 3.10.6 interpreter with no arguments produces the following output in the presence of a (possibly empty) file called dis.py in the working directory. Clearly I shouldn’t have my own files called dis.py lying around in the working directory! Are the names of all of the other modules included by inspect.py also “reserved”? Shouldn’t the modules inspect.py imports

Python program that tells you whether or not you need an umbrella when you leave the house [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 8 months ago. Improve this question The program should: Ask you if it is raining using input() If the input is ‘y’, it should output ‘Take

ModuleNotFoundError: No module named ‘sharedFunctions’

I have a Python project in which I have the following folder structure: The download_module/__init__.py has the following code: The sharedFunctions.py file contains the following function: Then on the useSharedFunction.py I try to import the shared function and use it like this. When I try to run this by using python3 useSharedFunction.py I got the following error: I do believe

Asyncio combined with custom modules and aiohttp

I am trying to sleep a module for a couple seconds, while sleeping, the script should continue running. When the sleep is over, the module should put data[“found”] = True, but the code never reaches past asyncio.sleep() The code should print: “bulbasaur” “do stuff” x 5 “bulbasaur” But bulbasaur never comes back. main.py: pokemon.py: nba.py Answer The issue lies in

‘Namespace’ object is not iterable

Attempting to pass an undetermined amount of integers using argparse. When I input: py main.py 3 2 Error Namespace Argument is not iterable I think is is because I am passing an argument that is not of the correct type. After reading through all the documentation I could find I cannot figure out how to make this work. I want

Advertisement