Displays Fibonacci numbers up to the count you specify and also their successive ratios that converge to the Golden Ratio.
Displays Prime numbers, upto a number or upto a count. Checks whether a number is prime. Also returns nth prime for given n.
Prints coordinates of 2 masses in a binary system. You can set masses, initial positions and initial velocities of the two bodies. Resulting file, plotted in gnuplot with lines, gives orbit of both.
Generates a data file plotting the position (x,y) of a projectile. Projected particle is slowed down by air friction as in real life, and hits ground and rebounds (losing energy) as in real life. You can set the launch position, launch angle, launch velocity, viscous force constant and coefficient of restitution.
Accepts a number from user. Takes a point at origin. Gives it successive unit translations along 1 of 10 different directions, depending on the value of successive digits of the number. The directions form a regular polygon with 0 upwards. Successive coordinates are printed to a file that can be plotted with gnuplot.
The zip file contains the program itself, and a PDF help file where everything has been explained.
If you modify and/or redistribute these programs, you cannot charge money for them. Also, I’d like it if you acknowledge my authorship, although I wouldn’t mind if you add your name to it.
Tags: python, programs, programming
Add comment in external guestbook (no need for Windows Live account or sign-in.)
2 thoughts on “Python Programs”
I tried to run the programs on Ubuntu 8.04 LTS edition. But didn\’t worked out. Any suggestions?
Sorry for replying so late. I wrote those programs in Windows, which might be the problem. For example, some use the commands module which doesn’t work properly on Ubuntu. And maybe some use the Gnuplot module which may not be installed on your system etc.