#1
  1. Reinvent the Circle
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Jonesville, MI
    Posts
    218
    Rep Power
    16

    What is your most complex python implementation?


    I am just starting with Python, and I want to see what this language can do.

    Let this be where you show off what you've made, and maybe get others interested in it as well! (This is not a contest)

    It might be the most complex or feature-packed script or program you ever wrote, or your favorite script of those you wrote, or even one that does more than you can believe for the number of lines it has.

    Have fun and I'll be watching for submissions!

    PS - I have a special like for extensible or pluginable programs.
    -Yanno

    "If it will have to be done more than once, don't do it. Make something that does it for you."

    "If you want to get out of the box, you must not think outside the box, you must think about the box. In fact, think about destroying the box."
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    14
    Not really mine since I've only contributed maybe 5% of the code (and maybe not even that by now), but Supybot rocks. Before that, I did a good portion (about half, maybe more) of the code on Moobot.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  4. #3
  5. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    Here's the ban command to my battle.net channel moderation bot for warcraft3.

    Code:
            # Ban (Allows Wildcarding)
            if msg == tr+"ban" and user == mt:
                banoccur = True
                print "Processing command..."
                if msg[5:6] == "*" and msg[-1] == "*":
                    if msg[6:-1] == mt:
                        pass
                    if ho == "yes":
                        for useritem in userlist:
                            if msg[6:-1] in useritem:
                                if useritem == mt:
                                    pass
                                else:
                                    q.append(ban+useritem+" (*"msg[6:-1]+"*)")
                    elif ho == "no":
                        q.append(noops)
                if msg[5:6] == "*" and msg[-1] != "*":
                    if msg[6:224] == mt:
                        pass
                    if ho == "yes":
                        for useritem in userlist:
                            if msg[6:224] in useritem[0:224]:
                                if useritem == mt:
                                    pass
                                else:
                                    q.append(ban+useritem+" (*"+msg[6:224]+"*)")
                    elif ho == "no":
                        q.append(noops)
                if msg[5:6] != "*" and msg[-1] == "*":
                    if msg[5:-1] == mt:
                        pass
                    if ho == "yes":
                        for useritem in userlist:
                            if msg[5:-1] in useritem:
                                if useritem == mt:
                                    pass
                                else:
                                    q.append(ban+useritem+" (*"+msg[5:-1]+"*)")
                else:
                    if msg[5:224] == mt:
                        pass
                    if ho == "yes":
                        q.append(ban+msg[5:224])
                    elif ho == "no":
                        q.append(noops)
                    else:
                        continue
                GetWait()
                Queue()
                banoccur = False
    ho = holdops
    holdops will either = "yes" or "no".
    msg = message
    tr = trigger
    mt = master
    user = username
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    This is not something I've done, but gives some indication of what Python is capable of. A recent survey of internet traffic showed that over a third of all internet traffic was from Bittorrent, an open source peer-to-peer file sharing program. Bittorrent is written in Python.

    Dave - The Developers' Coach
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    346
    Rep Power
    0
    i thought bittorrent was a protocol like http or ftp.
  10. #6
  11. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    Bittorent - the original client and server stuff was all written in Python by the Bittorent author. There are now ports to other languages.

    My most complex project took me at least a year to write. It was an implementation of a scripting language for controlling multiple serial devices - to run integration and soak tests. It featured a user scriptable GUI, multiple terminals, a language that supported sub-routines, nested scripts, batching of scripts, report generation, use defined language extensions, events/background routines, TCP/IP-protocols. The GUI was Tkinter based. A big beast.

    I've taken it easy since then. I've just finished a proof of concept communications application for Linux that supports PPP, GSM/GPRS and SMS functionality for a series of wireless modem datacards I have access to. I'm now going to throw that away and do it properly since I have just finished reading "Code Complete"

    grimey
    Last edited by Grim Archon; December 17th, 2004 at 08:14 AM.
  12. #7
  13. Reinvent the Circle
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Jonesville, MI
    Posts
    218
    Rep Power
    16
    Wow. Do you sell that or could I get the code somehow to study? (I learn code best by studying the code itself.)

    Thread's still open for more favorites/bests...
    -Yanno

    "If it will have to be done more than once, don't do it. Make something that does it for you."

    "If you want to get out of the box, you must not think outside the box, you must think about the box. In fact, think about destroying the box."
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    London, England
    Posts
    1,585
    Rep Power
    1373
    I am currently working at a company that has a product to help large corporations such as banks manage their networks. The product explores the network and maps the hardware and software elements on it, to allow IT managers to answer questions such as 'what Windows systems do not have the latest patches?', or 'if this server goes down, who and what will be affected?'.

    This is a big product with a team of 10+ developers and selling for megabucks. It is written in 100% pure Python - probably a few hundred thousand lines of code, although I have not measured it.

    Dave - The Developers' Coach
  16. #9
  17. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    I wrote a little language in Python once .
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    I was procrastinating to avoid studying for an exam a couple of years ago. While playing othello (also called reversi) at yahoo, I decided to write one myself with Python and GUI with Qt. I finished it all (including the gui) in about 4 hours (then went back to procrastinating some more at yahoo of course =P).
  20. #11
  21. Reinvent the Circle
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Jonesville, MI
    Posts
    218
    Rep Power
    16
    Do you have that code with you still?
    -Yanno

    "If it will have to be done more than once, don't do it. Make something that does it for you."

    "If you want to get out of the box, you must not think outside the box, you must think about the box. In fact, think about destroying the box."

IMN logo majestic logo threadwatch logo seochat tools logo