Trian Gular Ramblings

Sign in to follow this  
Followers 0
  • entries
    50
  • comments
    217
  • views
    22,180

My Very First Python Program [U]

Sign in to follow this  
Followers 0

Entry posted

382 views

THIS PROGRAM WAS WRITTEN BY A BEGINNER PROGRAMMER. YOU WILL FIND IT TO BE VERY BASIC, AND NOT VERY USEFUL TO YOU. YOU HAVE BEEN WARNED.

It's more of a test program than a useful program, but it is my nevertheless my first program.

I call it Basic Shapes. It calculates the Perimeter and Area of a Triangle, Circle, Rectangle, and Square. Some of the shapes have other calculations attached to them. I also have an Easter egg thrown in (Hint: a 2x4 ____ brick).

I wrote it in Python 3.3 using IDLE (IDLE is horrible), and compiled x86 and x64 Windows EXEs using cx_freeze (why, since this is just a test, who knows). The Python script has no dependencies other than a Python interpreter. I did run it on Python 2.7, but it did not work (which is odd, since it is such a simple script). The EXEs also have no dependencies other than the files in the same folder as the EXE.

As of V1.1, all bugs have been fixed, and now works as I had originally planned.

Download Basic Shapes V1.1 from Sourceforge.net.

Special thanks to JrMasterModelBuilder for helping me set up the multiple Python installations correctly, for looking at my code because I thought it was broken, and just putting up with me and all my annoying questions! ;P

Update: I've basically rewritten the script, fixed it up a bit and correcting the bugs. If you care, get the updated version from the link above.


  Report Entry
Sign in to follow this  
Followers 0


6 Comments

Posted · Report

print """

This text will be formated as you see it.

You can write any number of lines with only one call to print.

If you still insist on putting newlines, "print 'herpderp' +/n" works.

You also don't need parenthesis. """

Share this comment


Link to comment

Posted · Report

@TheDoctor: You need parenthesis in Python >= 3. It's also just good practice.

Share this comment


Link to comment

Posted · Report

@TheDoctor: You need parenthesis in Python >= 3. It's also just good practice.

I feel that I need to say something about Python 3.x, but I don't know what. Maybe asking you what you can do that you can't in 2.7.x that's not related to syntax, but I still don't know.

Share this comment


Link to comment

Posted · Report

It's cleaner, UTF8 support, bytes are treated as integers instead of chars (personal preference), nonlocal closure declaration, speed, new features are being added to 3 and not 2.

Share this comment


Link to comment

Posted · Report

Plus, a lot of Python 2 stuff that kinda doesn't work too well has either been fixed, rewritten, or removed in Python 3. For example, raw_input() freezes FF with using it on Codecademy, and I've had issues with it on a computer before. In Python 3, it has been replaced with input(), which works much better. ;)

Share this comment


Link to comment

Posted · Report

BTW, I've updated Basic Shapes to V1.1. It fixes the bugs, and have been overall fixed. If you want to, download it from the same link.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now