module - How can I use import, from import and sys.append together in Python -


i have directory add sys.path import custom modules. correct/best way use import, import , sys.path together? mean if acceptable use sys.path.append in between "imports".

for example:

#!c:/python27 import sys sys.path.append('c:\\users\\user\\mypythonmodules') import writedata wd import os import csv collections import defaultdict 

edit:

i should have mentioned writedata custom module want import wd. module writedata located in c:\\users\\user\\mypythonmodules

yes, is. there no syntax or semantic rule in language prevents that.

i not aware of "style" rule may breaking, in case, option providing pythonpath python interpreter.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -