Python and the Pi
-
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!”); }
-
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!”); }
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.
-
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.
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
-
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.
What are 'spaces'?
-
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.
-
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!”); }
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!
-
What are 'spaces'?
-
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!”); }
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.
-
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.
-
What are 'spaces'?
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!!!!!!!
-
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
-
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!”); }
Earl Owens wrote:
How hard can learning a scripting language be?
Clearly, you've never done any hardcore JavaScript development.
Jeremy Falcon
-
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
-
What are 'spaces'?
(sfw music (no)video) Space is only noise[^]
I'd rather be phishing!
-
Earl Owens wrote:
How hard can learning a scripting language be?
Clearly, you've never done any hardcore JavaScript development.
Jeremy Falcon
-
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.
-
What are 'spaces'?
-
I use JavaScript only if I have to, but it is looking more and more there is no escaping it.
It's the future of the web man, may as well jump on board.
Jeremy Falcon