Testing out Posting Code

One of the things that I love to be able to do in my blog (besides becoming a better writer) is to have the ability for a reader to execute code that designate for that purpose. Thinking on that idea for a bit lead me to the conclusion that having that functionality would be a nightmare. However, I did a bit of digging around WordPress.com's Support pages and came across Code » Posting Source Code.
In order to test it out, I grabbed the first code example from Google Developers' Python Class:
#!/usr/bin/python

# import modules used here -- sys is a very standard one
import sys

# Gather our code in a main() function
def main():
print 'Hello there', sys.argv[1]
# Command line args are in sys.argv[1], sys.argv[2] ...
# sys.argv[0] is the script name itself and can be ignored

# Standard boilerplate to call the main() function to begin
# the program.
if __name__ == '__main__':
main()

That looks pretty nice. The rendering is created by WordPress.com to be specific to Python.
I've started my coding "course work" as per my "New Adventures in Coding" post from earlier this month. I'll start with the Google Python course and proceed from there. I also have a paper copy of Python: Visual QuickStart Guide by Chris Fehily which has been looking accusingly at me for a number of years from my bookshelf. Hopefully, I'll be posting my own code soon. I have a few ideas for coding projects. I'm going to sit on them until I can determine how feasible they will be for my poor coding skills.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: