0

in window I know make this withe the cmd but in ubuntu it's not good

I have a question about the Terminal. I want to ask how to call a program in the terminal

$ /home/yvanmoses/Dropbox/apprendre_a_programmer/"boucles en python"/mot_le_plus_frequent.py

the answer is permission not given. How to put this right? or

python: can't open file 'mot_le_plus_frequent.py': [Errno 2] No such file or directory`enter code here`

A second question: Is that a short way to open a script?

My wish: to program and verify without the "execute" button in geany (the little cogwhell in the right top)

I want to work with python and ruby

good experts saying to me to add #!/path/to/python in the first line of my script.

This work for files that are in/home/myname/ But for the files that are deep into directory into directory etc, in my Dropbox it is not good.

A priori it sames very trivial. I read many questions that someones considered as very similar to mine and find no uniform explanation. SO I REPETE THE QUESTION WHAT is the best way for a developer (python or ruby) when he work in a script to run and run again the script easy and nicely. I was convicted that they use the terminal. If it is not right. I'ii accept! WHAT TO DO???

kouty
  • 157
  • 13
  • 1.) Are you sure your path is correct? 2.) Try copy/moving and running your script from a folder not inside Dropbox. 3.) Don't use "boucles en python", but .../boucles\ en\ python/ – David Mar 29 '15 at 21:54
  • Run the command with python, so "python /path/to/script.py". Or do chmod +x /path/to/script.py. In that case, you'll need to start the script file with #!/usr/bin/python or something like that. – Jo-Erlend Schinstad Mar 29 '15 at 22:00
  • @David I tried to paste the script in /home/yvanmoses/ etc but the same result. – kouty Mar 29 '15 at 22:13
  • @Jo-ErlendSchinstad yvanmoses@yvanmoses-desktop:~$ chmod +x/path/to/mot_le_plus_frequent.py chmod: opérande manquant après «+x/path/to/mot_le_plus_frequent.py» Saisissez « chmod --help » pour plus d'informations. yvanmoses@yvanmoses-desktop:~$ It sames that It is no good. Why? – kouty Mar 29 '15 at 22:15
  • What is your first line of your file say? The first line should be something like #!/path/to/python ? – David Mar 29 '15 at 22:51
  • Also, have you tried python mot_le_plus_frequent.py – David Mar 29 '15 at 22:52
  • @David I folowed the Jo-ErlendSchinstad council: #!/usr/bin/python, but I'll try your formula – kouty Mar 30 '15 at 04:34
  • @kouty: You didn't have a space between the +x and the path. The +x means to make the file executable so that it is a program and not just a text file. So chmod +x /home/yourname/folder/mot_le_blabla.py – Jo-Erlend Schinstad Mar 30 '15 at 05:56
  • @kouty: But as I said, you can just run it with python, like "python /home/yourname/script.py" – Jo-Erlend Schinstad Mar 30 '15 at 05:57
  • @David Finally I come back. I tried to inity my script with"#!/path/to/python". I pasted a copy in the /home/m – kouty Mar 30 '15 at 16:24
  • @David Finally I come back. I tried to inity my script with"#!/path/to/python". I pasted a copy in the /home/myname/le_mot_le_plus_long2.py and it works. That is the first stape with the Terminal and I can now work with sublime text and atome. Thanks. Now I'll tried to make this independently of the directory emplacement...... HOW NO -> python: can't open file 'mot_le_plus_long.py': [Errno 2] No such file or directory – kouty Mar 30 '15 at 16:31
  • My error was that i tried to open a file as a directory. To open the file, after the cd path... ENTER ... python mot_le_plus_long.py THE RESPONSE IS THAT I CONFUSED OPEN A DIRECTORY AND OPEN A FILE – kouty May 10 '15 at 19:49

0 Answers0