I have been working with Python for about a year now, and I'm starting to write my own modules. I'm trying to make a module that imports a bunch of useful modules at the same time. The module imports fine. When I try to run it, it gives the error
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
importuseful()
TypeError: 'module' object not callable
My file name is importuseful.py My code is:
def importuseful():
import sys
import os
import RPi.GPIO as GPIO
import GPIO as gpio
import random
import math
import time
import email
import tty
import turtle
I run at the IDLE shell:
from Modules import importuseful
importuseful()
Here is where it throws the TypeError
The path it is in is /home/pi/Modules, and that is set as part of $PYTHONPATH.
The only other module I have made is GPIO which is one I am trying to import. I was having the same problem with that one, but that one fixed itself. Anyone have any ideas on what is wrong or how to fix?