Top "Python-module" questions

A module is a file containing Python definitions and statements.

How to get filename of the __main__ module in Python?

Suppose I have two modules: a.py: import b print __name__, __file__ b.py: print __name__, __file__ I run the "…

python python-module
Difference between Module and Class in Python

Can I assign value to a variable in the module? If yes, what is the difference between a class and …

python class python-module
How to make global imports from a function?

I fear that this is a messy way to approach the problem but... let's say that I want to make …

python import module python-module
Installing nose using pip, but bash doesn't recognize command on mac

I'm trying to install nose on my computer for the Learn Python the Hard Way tutorial, but can't seem to …

python python-2.7 nose python-module nosetests
How to install Python module on Ubuntu

I just wrote a function on Python. Then, I wanted to make it module and install on my Ubuntu 11.04. Here …

python python-module
Prevent Python from caching the imported modules

While developing a largeish project (split in several files and folders) in Python with IPython, I run into the trouble …

python import ipython python-module python-import
What exactly is a "raw string regex" and how can you use it?

From the python documentation on regex, regarding the '\' character: The solution is to use Python’s raw string …

python regex python-module rawstring
Two Python modules require each other's contents - can that work?

I have a Bottle webserver module with the following line: from foobar.formtools import auto_process_form_insert And the …

python python-module
Is there a Python module to open SPSS files?

Is there a module for Python to open IBM SPSS (i.e. .sav) files? It would be great if there's …

python dataset statistics python-module spss
Error while finding spec for 'fibo.py' (<class 'AttributeError'>: 'module' object has no attribute '__path__')

I have a module in a fibo.py file which has the following functions - #fibonacci numbers module def fib(…

python-3.x python-module