Interesting python code / python code you are proud of writing

If anyone has any python code that they are proud of writing or is interesting in its function and want to show it off , you can post it here .
I have been using python for about one to two years and i have experimented with both 2.7 and 3.4 and various modules for each .( my background isnt in IT industry/computer science so my python code probably isnt as clean or pythonic )
The reason for me making this topic is to create a type of thinktank for python enthusiasts where code , interesting concepts and advice can be shared .

I will start off with a concept that i was working on for a few weeks during which i hit several brick walls .
The concept was an instant messenger program that encrypts the messages to send and decrypts received messages, now for the interesting part , the encryption engine uses a hash of the current minute/hour/day/month/year ( including some obfuscation so that it is not as recognizable) the hash is edited slightly using sudo random characters so that it can be used as a 16 character encryption key for 256 bit AES which is used to encrypt and decrypt each message , the key for the previous minute is also stored in case of a message being sent on the 59th second and not being received until the first second of the next minute due to network latency .
I managed to complete a portion of this project ( encryption and forming 16 bit packets )but never quite finished it due to college exams and not being able to find laymen documentation for python socket modules .
I've seen topics like this be completely underwhelming on quora but I think it could be very successful here so happy coding all and Im sure we will all enjoy the pythonic madness that ensues

1 Like

I made minesweeper with tkinter a while back, well, started. This isn't finished, really. It works, but I'd want to do some more work on it. Can't be bothered though. It's probably written terribly FYI.

It needs cleaning up, I didn't finish that bar at the bottom with the point counter, win/lose label or restart game button on it. Plus I wanted to add flagging - so I could right click on some of the buttons and mark them as being a mine.

Enjoy, I managed to get it to generate a swastika once.

nice work , i only ever used tkinter once or twice, it was when i was making a front end for a login system which ended up working perfectly , i found it very unreliable for everything else i used it for afterwards but then again i was probably using it wrong , I find myself with the post exam student mentality when it comes to python modules i dont regularly use eg ' great i got tkinter to work now my brain doesnt need that knowledge anymore '
have you ever tried pyqt or kivy ?
haha wonderfully offensive , i once saw a custom harddrive eraser that used swastikas as its pattern for writing to the drive

Nope. A friend of mine, @anon43112114, kept rambling along about one of those and how they're supposedly better for reasons he never supplied or explained to me, lol. Never bothered looking into them myself because there's never been anything I wanted to do that I couldn't do with tkinter.

You didn't happen to be doing a GCSE computer sciences course in the UK did you? It's why I've ended up "learning" python myself, curious as to what's to come in the second year + what the exams are like. Probably a better question for my tutors but meh.

He was probably talking about kivy since it's cross platform ( windows , Linux and android )
Nope , I'm Irish , I started learning python in my first year of college , I actually just finished a degree in biochemistry , I just happen to be very into computers .
To be honest I would have preferred to do the gcse / a level system to the Irish system

I've started a calculator in tkinter...

Also @SpaceCat this is Kivy... if I haven't sent it already.

1 Like

I tried out kivy .. I wanted to make my own smartmirror with a raspberry pi ... and kivy was very frustrating to use. part of that may have been not taking a gui programming course but also the documentation got a bit flaky at times and hard to follow.

I made a youtube song downloader you all can check out.. it's probably my favorite pet project

Putting this thread back to sleep. I'd suggest making a new thread and linking back to this old one if you'd like to continue the discussion.