DavidMoksha
New Pleskian
I'm writing not as a host, but as a customer of a webhost that uses Plesk Parallels.
I've written a couple simple python scripts to test python on my host, before embarking on a serious project. They are: foo.py and bar.py
If within foo.py I do:
import bar
I get an error in the error.log: ImportError: No module named bar
On my local computer, the import works just fine. People in python forums and IRC similarly advise that this should work just fine.
Why does this not work, and how can I import scripts in the same directory?
One thing I have noticed is that __name__ is not set to '__main__' when going to the url of a python script. Perhaps I am required to use a package? Is there anywhere a guide or tutorial to getting started with these issues programming python for Plesk?
Thanks in advance,
David
I've written a couple simple python scripts to test python on my host, before embarking on a serious project. They are: foo.py and bar.py
If within foo.py I do:
import bar
I get an error in the error.log: ImportError: No module named bar
On my local computer, the import works just fine. People in python forums and IRC similarly advise that this should work just fine.
Why does this not work, and how can I import scripts in the same directory?
One thing I have noticed is that __name__ is not set to '__main__' when going to the url of a python script. Perhaps I am required to use a package? Is there anywhere a guide or tutorial to getting started with these issues programming python for Plesk?
Thanks in advance,
David