•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 403,567 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,258 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
•
•
•
•
•
•
•
•
A little program to convert angles to and from Decimal degrees, Degrees decimal minutes and Degrees minutes decimal seconds. (View Snippet)
Written using Boa Constructor, with code added to do the conversion from C to F or F to C.
The code has been altered to give a single file so don't open it in Boa Constructor. (View Snippet)
Generators are essentially dynamic sequences, making their official debut in Python 2.5.
That got me to thinking: can we make a circular list with them?
Why yes, we can... (View Snippet)
A simple example of applying a font to a text displayed with wxPython's wx.StaticText widget. (View Snippet)
Another application of Python module base64, this time to embed midi music data in your program. You also need the module pygame to execute this Python code. Enjoy the music! (View Snippet)
Just bouncing a red ball within the frame of a window, the twist here is that the image is stored within the code as a base64 encoded string of the gif image. This way you only have to distribute one file. The Python code is heavily commented, so you can follow what is going on. (View Snippet)
Here is a short Python program using the module pygame that lets you play a midi music file. Midi files are instrumental music files that pack a lot of good sound into a small file. They are very popular with web page designers. (View Snippet)
The Python module datetime allows you to calculate the days between two given dates with relative ease. I am using the US date format month/day/year, but you can change that by giving attention to the order of the extracted tuple. (View Snippet)
Using count() from Python's itertools module and the Tkinter GUI toolkit's after() function, you can create a simple counter that counts up the seconds until the Stop button is pressed. (View Snippet)
This code takes a string a cyphers it by shifting it's position in the alphabet. I've gotten it so it can pretty much take paragraphs. It's quite neat to play with.
For example the above when shifted to 5, would be:
Ymnx htij yfpjx f xywnsl f hDumjwx ny gD xmnkynsl ny,x utxnynts ns ymj fqumfgjy=... (View Snippet)