开发者

Problem with creating python executor [duplicate]

This question already has answers here: Getting Python error "from: can't read /var/mail/Bio" (6 answers) Closed 10 months ago.

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.


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.


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

./Launcher.py 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜