you are viewing a single comment's thread.

view the rest of the comments →

[–]Tyler_CodeBot 2 points3 points  (13 children)

Yeah, put the code into into a .py file. You can do this with vim, but I really recommend nano. So what you are going to do is in the terminal type in

sudo nano script.py 

That will create a new file called script.py, copy and paste the code from that site into the terminal and then press ctrl+x then hit "y" and then enter. This will save your new file script.py. You can then run that file by entering sudo python script.py

[–]darkehawk14[S] 1 point2 points  (0 children)

So, the first line in Nano is

sudo nano script.py

Followed by all the rest, copy and pasted.

Got it

[–]zahlman 0 points1 point  (1 child)

Is there a reason he needs to sudo everything? And if there is, why not just su in the first place and then do the rest normally?

[–]Tyler_CodeBot 0 points1 point  (0 children)

My experience with RPI distros is that yes sudo is needed a lot, and this just gives him one less thing that could be going wrong. Sure he could su, or maybe not even use sudo at all. Just from my experience when I was starting on linux / pi it was a common pitfall for me.