-1

As a beginner I initiated python with IDLE: You write a code, than save the file and run with F5.

In the past days I asked how to run scripts. I get good answers as to begin the programm with "#!/path/to/python ". It's good but not for all files e.g. files in /home/myname/Dropbox/programs/python.... are not accessible with this method. And I want to know how to deal with this problem.

1

Python code can be compiled and run from Sublime using Ctrl+B or Tools->Build System->Python. I'm just not sure why the script in your Dropbox folder won't run, have you checked the file permissions?

11
  • with #!/path/to/python I tested the same file in /home/myname/file.py when the fil migrated to /home/myname/downloads or any over subdirectory the result is "python: can't open file 'mot_le_plus_frequent2.py': [Errno 2] No such file or directory " as you see. It is not linked specificaly to dropbox. – kouty Apr 1 '15 at 18:39
  • with #!/path/to/python I tested the same file in /home/myname/file.py when the fil migrated to /home/myname/downloads or any over subdirectory the result is "python: can't open file 'mot_le_plus_frequent2.py': [Errno 2] No such file or directory " as you see. It is not linked specificaly to dropbox. what is file permission?? – kouty Apr 1 '15 at 18:45
  • @AKounovsky I know the control B patent but I don't like it because when I need to test inputs This is not practical – kouty Apr 1 '15 at 18:51
  • File persmissions are the property of files and folders, it ddetermines whether the file can be read, written into or run as a program/script. You can right click on your file, click on Properties and check, if the file can be run as a script since I don't think you're running it from your terminal. Let me ask you a thing: What is your path to python? – A. Kounovský Apr 1 '15 at 18:52
  • I ame sorry but my knowlege is very lacunare ... What is "path to python". Today I ame in another computer W7, the properties says type: Python File C:/Users/moshel/Dropbox/appren..."learn about access control and permission --> Security Settings Property Page but it is microsoft – kouty Apr 2 '15 at 7:42
0

Finally The best is to write cd and the whole path. with the use of the upper array in terminal, it is easy to write again the path. The use of control + B in sublime is less practical, in particular for input() functions. and in the terminal it is easy for the choice of python version, 2.7 or 3.4. for ruby too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.