March 30, 2015

Week of 03/22/15 - Python Part 24: Writing Interruption

    On Tuesday, March 24, I could not work on my Python project very much because we had to do a writing piece for the State of Texas. It was supposed to be a hypothetical submission for an art demo. I couldn't really think of what it should be, until my friend reminded me about my use of ASCII art in my project. That gave me the idea of an ASCII animation, and I would use Python to display it. I would convert each frame of a video of a bouncing ball through a conversion program, then save each ASCII frame in a separate text file. Then, using Python, I would open the first frame's file, display it, wait 1/30th of a second, clear the terminal, then show the next one. I would also make it loop. This got me thinking about my use of ASCII in my own Python code. So, instead of cluttering up my code with a bunch of print() statements, I put the ASCII art in a separate text file, and actually wrote the code to display it in both the test file and the main file.

    Next thing I tried to do was make a distinction using html of the post before this one. The original html showed two areas of code where one was an iteration of the other. To show the difference between the two pieces of code, I changed the different part's background color to maroon using another set of <pre> tags. However, apparently the pre tag makes a new paragraph when used, making a space which I don't want there. To fix this, I did some googling and learned how to do it in CSS. But I can't really change the CSS in Blogger, so that's when I learned I could input CSS using html with the <style> tag. Now it looks like this:


No comments: