|
Luke, I made a pun too.
|
|
|
|
|
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.
|
|
|
|
|
|
Things that women cannot reverse cars into.
|
|
|
|
|
|
Tory smear.
|
|
|
|
|
|
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!!!!!!!
|
|
|
|
|
|
Karel Čapek wrote: What are 'spaces'?
static_cast<char>(0x20)
|
|
|
|
|
Nemanja Trifunovic wrote: spaces
#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
|
|
|
|
|
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.
|
|
|
|
|
I prefer working in the Python3 branch. The newer facilities are nice, and I have no legacy code to maintain (a rare luxury
Sarcasm - it's not just a verbal skill - it's a lifestyle!
|
|
|
|
|
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.
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. I really am.
|
|
|
|
|
I have called my Raspberry Pi many things. Some of them are not printable.
|
|
|
|
|
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.
|
|
|
|
|
Yes o' master of RPi willco
|
|
|
|
|
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.
|
|
|
|
|
Earl Owens wrote: How hard can learning a scripting language be?
Clearly, you've never done any hardcore JavaScript development.
Jeremy Falcon
|
|
|
|
|
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
|
|
|
|
|
That was sarcasm. Yes I have wrestled the great bear JavaScript.
|
|
|
|
|
|
For what it's worth, you can also program it with C/C++.
I use the same IDE (Code::Blocks) in Windows, x64 Linux and on the RasPi. In combination with wxWidgets and a wx design tool of your choice it makes for nice suite.
The only thing I'm missing is a socket library on the old version of Raspian that I have.
"When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down 'happy'. They told me I didn't understand the assignment, and I told them they didn't understand life." - John Lennon
|
|
|
|