Shop OBEX P1 Docs P2 Docs Learn Events
Linux / Python question — Parallax Forums

Linux / Python question

Don MDon M Posts: 1,652
edited 2013-03-25 23:19 in General Discussion
I'm very new to Linux and Python. I have been messing around with a Raspberry Pi with some lessons from the Adafruit website. Wrote a python program to read a DS18B20 temp sensor. My question is there a way to read back the program that was saved? The program is saved as thermometer.py and I would like to read back the python program but don't know the Linux or Python commands to do such.

Thanks.
Don

Comments

  • Don MDon M Posts: 1,652
    edited 2013-03-24 19:10
    I figured it out. I use the command "nano thermometer.py"
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-03-24 20:32
    'nano' is just one of many Linux text editors. Some Linux users might be using 'vi' or 'gedit' or some other.

    If your intent is just to reread, not edit... you can use 'cat' with the file name.

    Actually, 'nano' is one of the more pleasant text editors to use. You might try 'man nano' to get an explaination of it.
  • Mark_TMark_T Posts: 1,981
    edited 2013-03-25 10:36
    more <filename> will display the file and stop for each screenful.
  • Heater.Heater. Posts: 21,230
    edited 2013-03-25 10:53
    Mark_T,

    Yes, better to use "less" because "less" is "more" more or less. Anyway "less" let's you scroll backwards where as "more" does not.
  • Mark_TMark_T Posts: 1,981
    edited 2013-03-25 17:50
    Heater. wrote: »
    Mark_T,

    Yes, better to use "less" because "less" is "more" more or less. Anyway "less" let's you scroll backwards where as "more" does not.

    Well the less binary is 4 times the size of more so less is definitely more! Wasn't sure if RaspPi system had it or not, whereas I knew it has more.
  • Heater.Heater. Posts: 21,230
    edited 2013-03-25 18:40
    Mark_T,
    Well the less binary is 4 times the size of more so less is definitely more! Wasn't sure if RaspPi system had it or not, whereas I knew it has more.

    That's true, more will fit in places where less won't.

    Yeah, yeah, enough of that already.
  • 4x5n4x5n Posts: 745
    edited 2013-03-25 19:18
    Heater. wrote: »
    Mark_T,



    That's true, more will fit in places where less won't.

    Yeah, yeah, enough of that already.

    ROFL!!

    I have a coworker that's all windows all the time and asked why "less" was called "less" and I explained that it's because "less does more than more". The look on his face when I explained it to him was priceless!!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-03-25 23:19
    Mark_T wrote: »
    Well the less binary is 4 times the size of more so less is definitely more! Wasn't sure if RaspPi system had it or not, whereas I knew it has more.

    Raspberry Pi is using the Busybox binaries for Linux utilities. That might clarify what is available. The binaries are surely smaller, but one can compile Busybox selectively to exclude bloat.

    Mie Van de Rohe is the father of "Less is more, and more is less." I guess you might say he was the first minimalist.

    http://www.miessociety.org/legacy/

    Of course "less" inside Busybox, might be smaller than "more" or "less" outside of Busybox. So you really can't say which is which... or whatever.....

    http://www.busybox.net/
Sign In or Register to comment.