Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Python and the Pi

Python and the Pi

Scheduled Pinned Locked Moved The Lounge
pythonlinuxhardwarequestionlearning
24 Posts 12 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Ygnaiih
    wrote on last edited by
    #1

    Bought a Raspberry Pi and everything I can find about programming it calls for Python. So thinking, “How hard can learning a scripting language be?” I dove head long into it. Most of the code examples I have found are poop. Indenting makes me long for curly braces. Then there’s 2.7.9 and 3.4.3, where 3.4.3 is not backwardly compatible. Then there is the worship of the great Guido. BTW, seems that the Linux kiddies are using it in a large way. Bottom line is if I’m going to get anything out of the Pi, it’s just hack it and go. Sigh() { Response.write(“What do you mean unexpected indent!”); }

    N F N J Kornfeld Eliyahu PeterK 6 Replies Last reply
    0
    • Y Ygnaiih

      Bought a Raspberry Pi and everything I can find about programming it calls for Python. So thinking, “How hard can learning a scripting language be?” I dove head long into it. Most of the code examples I have found are poop. Indenting makes me long for curly braces. Then there’s 2.7.9 and 3.4.3, where 3.4.3 is not backwardly compatible. Then there is the worship of the great Guido. BTW, seems that the Linux kiddies are using it in a large way. Bottom line is if I’m going to get anything out of the Pi, it’s just hack it and go. Sigh() { Response.write(“What do you mean unexpected indent!”); }

      N Offline
      N Offline
      Nemanja Trifunovic
      wrote on last edited by
      #2

      Eh, it's not that bad. I actually like Python. Just stick with 2.7.x and make sure your editor converts tabs into spaces, you'll be fine.

      utf8-cpp

      T R Y 3 Replies Last reply
      0
      • N Nemanja Trifunovic

        Eh, it's not that bad. I actually like Python. Just stick with 2.7.x and make sure your editor converts tabs into spaces, you'll be fine.

        utf8-cpp

        R Offline
        R Offline
        R Giskard Reventlov
        wrote on last edited by
        #3

        What are 'spaces'?

        L N M N 4 Replies Last reply
        0
        • N Nemanja Trifunovic

          Eh, it's not that bad. I actually like Python. Just stick with 2.7.x and make sure your editor converts tabs into spaces, you'll be fine.

          utf8-cpp

          T Offline
          T Offline
          TheGreatAndPowerfulOz
          wrote on last edited by
          #4

          Nemanja Trifunovic wrote:

          spaces

          :-D :thumbsup:

          #SupportHeForShe

          If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein

          1 Reply Last reply
          0
          • N Nemanja Trifunovic

            Eh, it's not that bad. I actually like Python. Just stick with 2.7.x and make sure your editor converts tabs into spaces, you'll be fine.

            utf8-cpp

            Y Offline
            Y Offline
            Ygnaiih
            wrote on last edited by
            #5

            My tab does 4 spaces in Notepad++ and in the Pi IDE. Also I can't get global variables visible through out the scrip especially in If statements. I'm using 2.7 as well.

            1 Reply Last reply
            0
            • Y Ygnaiih

              Bought a Raspberry Pi and everything I can find about programming it calls for Python. So thinking, “How hard can learning a scripting language be?” I dove head long into it. Most of the code examples I have found are poop. Indenting makes me long for curly braces. Then there’s 2.7.9 and 3.4.3, where 3.4.3 is not backwardly compatible. Then there is the worship of the great Guido. BTW, seems that the Linux kiddies are using it in a large way. Bottom line is if I’m going to get anything out of the Pi, it’s just hack it and go. Sigh() { Response.write(“What do you mean unexpected indent!”); }

              F Offline
              F Offline
              Frank Alviani
              wrote on last edited by
              #6

              I prefer working in the Python3 branch. The newer facilities are nice, and I have no legacy code to maintain (a rare luxury :-D

              Sarcasm - it's not just a verbal skill - it's a lifestyle!

              1 Reply Last reply
              0
              • R R Giskard Reventlov

                What are 'spaces'?

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Things that women cannot reverse cars into. :cool:

                C 1 Reply Last reply
                0
                • Y Ygnaiih

                  Bought a Raspberry Pi and everything I can find about programming it calls for Python. So thinking, “How hard can learning a scripting language be?” I dove head long into it. Most of the code examples I have found are poop. Indenting makes me long for curly braces. Then there’s 2.7.9 and 3.4.3, where 3.4.3 is not backwardly compatible. Then there is the worship of the great Guido. BTW, seems that the Linux kiddies are using it in a large way. Bottom line is if I’m going to get anything out of the Pi, it’s just hack it and go. Sigh() { Response.write(“What do you mean unexpected indent!”); }

                  N Offline
                  N Offline
                  newton saber
                  wrote on last edited by
                  #8

                  Allow me to insert my gratuitous self-promotion here AND answer your question. It just so happens I've written quite a few Python programs and I own a RPi -- anyone who knows anything about RPi knows that you refer to it as RPi. :D The thing is if you are trying to do stuff with a UI, then you are probably looking for Tkinter help. Tkinter is ugly. But, my point -- and I do have one -- is that my simple Tkinter examples, which I wrote on a PC with Python work with no changes on the RPi. Here's my self promotion: My book at amazon.com Learn Python, Think Python[^]. For all you downvoters: I'm answering a question about RPi. :D I really am.

                  Y 1 Reply Last reply
                  0
                  • R R Giskard Reventlov

                    What are 'spaces'?

                    N Offline
                    N Offline
                    newton saber
                    wrote on last edited by
                    #9

                    Karel Čapek wrote:

                    What are 'spaces'?

                    Yes, alas, Python uses spaces (whitespace) as a delimiter for code blocks. It is the most horrendous thing about Python. You will get (random) errors because of spacing problems in your code. agh! "Hey, let's use a non-printable char as the delimiter in our language.", Sincerely Guido Van Rossum The rest of the world, shouting.... Nooooooooooooooooooo!!!!!!!

                    1 Reply Last reply
                    0
                    • N newton saber

                      Allow me to insert my gratuitous self-promotion here AND answer your question. It just so happens I've written quite a few Python programs and I own a RPi -- anyone who knows anything about RPi knows that you refer to it as RPi. :D The thing is if you are trying to do stuff with a UI, then you are probably looking for Tkinter help. Tkinter is ugly. But, my point -- and I do have one -- is that my simple Tkinter examples, which I wrote on a PC with Python work with no changes on the RPi. Here's my self promotion: My book at amazon.com Learn Python, Think Python[^]. For all you downvoters: I'm answering a question about RPi. :D I really am.

                      Y Offline
                      Y Offline
                      Ygnaiih
                      wrote on last edited by
                      #10

                      I have called my Raspberry Pi many things. Some of them are not printable.

                      N 1 Reply Last reply
                      0
                      • Y Ygnaiih

                        I have called my Raspberry Pi many things. Some of them are not printable.

                        N Offline
                        N Offline
                        newton saber
                        wrote on last edited by
                        #11

                        Earl Owens wrote:

                        Raspberry Pi

                        You are going to have to start referring to it as RPi, okay? Otherwise I will think of you as a nube. :D

                        Y 1 Reply Last reply
                        0
                        • Y Ygnaiih

                          Bought a Raspberry Pi and everything I can find about programming it calls for Python. So thinking, “How hard can learning a scripting language be?” I dove head long into it. Most of the code examples I have found are poop. Indenting makes me long for curly braces. Then there’s 2.7.9 and 3.4.3, where 3.4.3 is not backwardly compatible. Then there is the worship of the great Guido. BTW, seems that the Linux kiddies are using it in a large way. Bottom line is if I’m going to get anything out of the Pi, it’s just hack it and go. Sigh() { Response.write(“What do you mean unexpected indent!”); }

                          J Offline
                          J Offline
                          Jeremy Falcon
                          wrote on last edited by
                          #12

                          Earl Owens wrote:

                          How hard can learning a scripting language be?

                          Clearly, you've never done any hardcore JavaScript development.

                          Jeremy Falcon

                          Y 2 Replies Last reply
                          0
                          • N newton saber

                            Earl Owens wrote:

                            Raspberry Pi

                            You are going to have to start referring to it as RPi, okay? Otherwise I will think of you as a nube. :D

                            Y Offline
                            Y Offline
                            Ygnaiih
                            wrote on last edited by
                            #13

                            Yes o' master of RPi willco :)

                            N 1 Reply Last reply
                            0
                            • R R Giskard Reventlov

                              What are 'spaces'?

                              M Offline
                              M Offline
                              Maximilien
                              wrote on last edited by
                              #14

                              (sfw music (no)video) Space is only noise[^]

                              I'd rather be phishing!

                              1 Reply Last reply
                              0
                              • J Jeremy Falcon

                                Earl Owens wrote:

                                How hard can learning a scripting language be?

                                Clearly, you've never done any hardcore JavaScript development.

                                Jeremy Falcon

                                Y Offline
                                Y Offline
                                Ygnaiih
                                wrote on last edited by
                                #15

                                I use JavaScript only if I have to, but it is looking more and more there is no escaping it.

                                J 1 Reply Last reply
                                0
                                • Y Ygnaiih

                                  Yes o' master of RPi willco :)

                                  N Offline
                                  N Offline
                                  newton saber
                                  wrote on last edited by
                                  #16

                                  I haven't done much that is interesting with the RPi, unfortunately. I have learned how to connect it directly to my PC via ethernet so I can SSH directly to it and don't have to have a separate screen. I need to work with the GPIO but I've been lazy so far.

                                  1 Reply Last reply
                                  0
                                  • R R Giskard Reventlov

                                    What are 'spaces'?

                                    N Offline
                                    N Offline
                                    Nemanja Trifunovic
                                    wrote on last edited by
                                    #17

                                    Karel Čapek wrote:

                                    What are 'spaces'?

                                    static_cast(0x20)

                                    utf8-cpp

                                    1 Reply Last reply
                                    0
                                    • L Lost User

                                      Things that women cannot reverse cars into. :cool:

                                      C Offline
                                      C Offline
                                      CHill60
                                      wrote on last edited by
                                      #18

                                      Just saying clickety[^] ;P

                                      L 1 Reply Last reply
                                      0
                                      • Y Ygnaiih

                                        I use JavaScript only if I have to, but it is looking more and more there is no escaping it.

                                        J Offline
                                        J Offline
                                        Jeremy Falcon
                                        wrote on last edited by
                                        #19

                                        It's the future of the web man, may as well jump on board.

                                        Jeremy Falcon

                                        1 Reply Last reply
                                        0
                                        • C CHill60

                                          Just saying clickety[^] ;P

                                          L Offline
                                          L Offline
                                          Lost User
                                          wrote on last edited by
                                          #20

                                          Tory smear. ;P

                                          C 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups