I have this IRC bot that I am hard coding from scratch just for kicks. In it I pasted all of my functions to a separate file so that it saves spaces on my eyes when I code the mainframe. So on my imports I have:
import socket, re, time
import urllib.request, os, sys
import pickle
from RushFunctions import *
The bottom line is my custom module with all of my functions. With in there in one of my functions I call:
url = urllib.request.Request(url)
But I get the error:
File "/home/ron/RushFunctions.py", line 6, in stats
url = urllib.request.Request(url)
NameError: global name 'urllib' is not defined
If I paste all of my functions into my main file, it all works fine and dandy. I have found that if I import those modules from within my module it works fine, but will that effect how I use them in my main module.
The same goes for the var if I do the ugly imports to get the above to work:
SkillsArray = stuffhere
I try and use it in one of my custom functions and I get that the variable is undefinded.