0

I hope this question is not too open for SE. I wanted to make my first steps with this guide I already found out how to run Idle3 via SSH and that print is now a function. So I wrote print("Hello World") and tried to run the program via python hello.py This results in a Syntax error. I then opened the hello.py and tried to remove everything. So I went from

Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> print("Hello World")

to

print("Hello World")

I couldn't save the file then due to no writing permissions. Why? Question 1

So I saved it as hello2.py and everything worked then.

I can't delete the text and >>> in the Idle3 editor. Why is that information the written into my file? Question 2

Sidequestion: xming (I'm under windows) does stop working or does not start idle3 when the desktop is started on my pi. Does that have something to do with root permissions? And when I first tried to cd /home/pi/ I got the error that there was no such directory. You can't cd to your working directory then under linux?

Thanks in advance!

  • Please dont worry about the >>> they are part of the interpreters comand line interface, just telling you to type your input there. – Ghanima Sep 16 '14 at 16:07
  • @Ghanima However the Information about are still written to my file and this leads to an error. I doubt it is designed this way that you have to delete that manually afterwards. – idkfa Sep 16 '14 at 16:10
  • Okay, i fiddled around with Idle a little more and it seems that I tried to program in the shell. There is a second option for a window called editor and there is no text or >>> written to the file. I assume this is where I'm suppose to work? – idkfa Sep 16 '14 at 16:49
  • It's going to be hard to help you as you are not giving the command you issue when you get the various errors. For instance I don't believe you issued cd /home/pi on a Pi and got an error message about no such directory. You may have done many things wrong. There is little point in us guessing. – joan Sep 16 '14 at 16:51
  • 1
    The / at the start of a pathname denotes the top directory. So cd /home works because there is a home directory under the "root" (so called because it is the root of the file system). You are then in home. cd /pi looks for a directory called pi under the root. It doesn't exist. Use cd /home/pi (from anywhere) or cd pi (when you are in the home directory). It's pretty much the same as Windows but / is used rather than \. – joan Sep 16 '14 at 18:52

Your Answer

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

Browse other questions tagged or ask your own question.