Search

Reply to comment

Python Console Import All Modules at Once

When you Work enough on Console you easily are in a Situation of annoying Repeated Import Module Statements...

To make Working on Python Console a little bit Easier and Pleasant you can Pre-dispose an External File Containing the Import Declarations for all the Modules you need.

Example:

import sys
sys.path.append('/path/To/site-packages')
import time
import pickle 
import re
from BeautifulSoup import BeautifulSoup
from soupselect import select

We suppose you have saved your import declarations like importModules.py somewhere in your driver.

Then for Loading all Modules at Once is enough to Execute into the Python Shell:

>> execfile('/path/To/importModules.py')

After you can test that the Modules are Successfuly imported into the Console.

Reply

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer