2

I have created a FileManager for my personal files. The launcher for this manager is launched by following script.

#!/usr/bin/python

from ui.MovieManager import MovieManager

MovieManager().showView()

Movie manager and other modules are situated in the ui and core packages, but when executing the file as script, I do get following error.

vsd@homeworks:~/homework/ws-python/movie-database$ sh Launcher.py 
from: can't read /var/mail/ui.MovieManager

I am not able to identify why this script is not picking up MovieManager module under the current folder? However when I execute command python Launcher.py, It works well.

Vijay Shanker Dubey
  • 4,308
  • 6
  • 32
  • 49

2 Answers2

2

It's not python which generates the error.

Check this out:

blubb@nemo:~$ from ui.MovieManager import MovieManager
from: can't read /var/mail/ui.MovieManager

Mind you, this is the console, which is a logical consequence of you calling the script with sh Launcher.py. Instead, use ./Launcher.py. For this to work your file needs to be marked as executable, though.

blubb
  • 9,510
  • 3
  • 40
  • 82
0

Have you tried going to the folder where Launcher.py is and running

./Launcher.py 
Hernan
  • 5,811
  • 10
  • 51
  • 86