python-import
Does importing a module (but not using it) decrease performance in Python?
I\'m running a website using Django, and I import ipdb at the beginning of almost all of my scripts to make debugging easier. However, most of the time I never use the functions from the module (only[详细]
2023-04-10 07:23 分类:问答Why is Python more strict with circular imports when using from-imports?
I know that Python discourages any situation which can get you into a circular import. But I wanted understand the Python internals of why from-imports are seemingly arbitrarily less forgiving than no[详细]
2023-04-08 07:36 分类:问答How should I perform imports in a python module without polluting its namespace?
I am developing a Python package for dealing with some scientific data. There are multiple frequently-used classes and functions from other modules and packages, including numpy, that I need in virtua[详细]
2023-04-05 03:27 分类:问答Django ImportError
I created my own Django application with directory structure /appname __init__.py models.py /submodule1 __init__.py[详细]
2023-03-29 01:59 分类:问答Python: Use an import done inside of a class in a function
Can anyone explain how to make the following example work?Since several functions inside of the class will use the same function from platform I thought it would be better to import it开发者_开发技巧[详细]
2023-03-24 04:30 分类:问答how to import the new installed module whie an old same module exists
everybody! the built-in pycurl module doesn\'t define Curl object conn = pycurl.Curl() Error message: \"pycurl\" module has no attribute Curl[详细]
2023-03-20 13:51 分类:问答Python imports for tests using nose - what is best practice for imports of modules above current package
This is a question which is asked frequentl开发者_如何转开发y in different forms, and often obtains \"lol you\'re not doing it properly\" responses. Pretty sure that\'s because there\'s a common sense[详细]
2023-03-19 14:30 分类:问答About importing modules in python
I have three modules in the same folder. The first module, run.py, is the main program. The second module, called shapes.py, contains a class called \"Shape\"[详细]
2023-03-18 22:20 分类:问答Why is Python running my module when I import it, and how do I stop it?
I have a Python program I\'m building that can be run in either of 2 ways: the first is to call python main.py which prompts the user for input in a开发者_如何学Go friendly manner and then runs the us[详细]
2023-03-16 10:36 分类:问答Python Strategy pattern: Dynamically import class files
I am trying to build a software package that fixes arbitrary data inconsistencies in one of my databases. My design includes two classes - Problem and Fix.[详细]
2023-03-15 06:52 分类:问答