Python Forum
Importing files to other python scripts - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Importing files to other python scripts (/thread-2043.html)



Importing files to other python scripts - amilie1234 - Feb-13-2017

Hey everyone

I need help, when I import from ex_part1 import loadData it decides to execute the part1 python script instead of part2 python script, but I want python to execute part2 script not part1. I don't understand why this is occurring when importing the file. If anyone has suggestions on how to fix this, it would be great help.


RE: Importing files to other python scripts - buran - Feb-13-2017

we don't know what part1 and part2 are. what is executed depends on what's in ex_part1 module. show us your code.