I had a cold for about 3 or 4 days this week, and didn’t feel like moving very far from my bed, so I decided to take this time to learn Python.
I’ve had a bit of fun setting challenges for myself in Python to get a hang of the basics, such as making the Spirograph type image above. I also made an alternate version where the radii and distances were all random integers, and it was fun watching them all converge on an average shape. And then I added a sine wave path, which created circles tangentially to the side wave, and whose radii were defined by the amplitude of the wave.
I went a little crazy with making trippy changing images, I guess.
I also made a program where the user can define a triangle by two angles and a side, and then the program defines what type of triangle it is and draws it.
I am now thinking it would be fun to make a hilarious Twitter not, but I am not quite sure what hilarious things it would do yet. One idea was that it just retweets everything Doc tweets. “For those of you that don’t want to follow Doc, but want to read all his tweets!” Another idea I had was that it would tweet at Doc all day long with random philosophers’ quotes. For some reason, Doc did not find that idea as hilarious as I did.
Whatever the case may be, it should be fun to figure out. And hopefully it won’t be too annoying to Doc.
5 thoughts on “A week of battling a cold and Python”
I’m so proud of your Python skills!
We’ll see if you’re still so proud of my Python after I write a Doc-pestering-bot! 😉
Are you using interactivepython.org or another environment?
Consider posting your code to github or someplace: I haven’t used turtle graphics and I’d like to see it
Keep on hacking!
I’ve been reading the documentation online (mostly at docs.python.org) as well as a few different free “how to’s” that I found in the Google Play store for my phone, and following along in IDLE. I took two years of C++ in high school, so I thought it wouldn’t be such a big deal to try and dive right in. I haven’t really coded since college, though, so there was a bit of rust to get out.
I’ve mostly been using IDLE because it automatically came with the Python download, so it seemed easiest to use that. But I’ve since heard that perhaps IDLE isn’t the happiest most fun environment to use, so I am open to suggestions.
I will consider posting some of my code to github, that sounds fun! I will say, though, that turtle graphics is mostly intended to teach little kids about programming, so you’re not missing out on too much. Here’s the documentation for turtle: https://docs.python.org/3/library/turtle.html?highlight=turtle#module-turtle
I’ve since moved on to familiarizing myself with pygame, so the user can continue to provide input after the graphics have been displayed. Turtle has been super fun and all, but I’ve been prompting the user for all the input before generating the graphics to their specifications, which has been a bit clumsy.
Thanks for all the encouragement!