Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

advertising

related pastes to tag 'python'

2115796 - SciPy problem python scipy
preview unavailable
2101583 - Jaylon: python phonon pyqt
  1. Begun, the great internet eduatcion has.
2082978 - Miscellany: python keyboard blender
  1. import bpy
  2.  
  3. USER_KEYCONFIG = 2
  4. wm = bpy.context.window_manager
  5.  
  6. # border selection
  7. for k in wm.keyconfigs[USER_KEYCONFIG].keymaps.find('Gesture Border').keymap_items:
  8.   if k.propvalue=='SELECT' and k.type=='LEFTMOUSE' and k.value=='RELEASE':
  9.  
2063858 - Simple command line dice roller.: python dice d20
  1. import random
  2.  
  3. def d(n, sides):
  4.     roll = [random.choice(range(1, int(sides) + 1)) for x in range(int(n))]
  5.     roll.sort(reverse = True)
  6.     return(roll)
  7.  
  8. def printRoll(n, d, rollList, modifier):
  9.  
2051963 - actions.py from Doomtown CCG on : python octgn
  1. #---------------------------------------------------------------------------
  2. # Constants
  3. #---------------------------------------------------------------------------
  4. import re
  5.  
  6. phases = [
  7.     'It is currently in the Pre-game Setup Phase',
  8.     "It is now GAMBLIN' time. Play Lowball!",
  9.  
1992340 - Ananas: python fvwm xdg
  1. #!/usr/bin/python
  2. #
  3. # Author: Victor Ananjevsky, 2007 - 2010
  4. # based on xdg-menu.py, written by Piotr Zielinski (http://www.cl.cam.ac.uk/~pz215/)
  5. # License: GPL
  6. #
  7. # This script takes names of menu files conforming to the XDG Desktop
  8. # Menu Specification, and outputs their FVWM equivalents to the
  9.  
1992336 - ANanas: python fvwm xdg
  1. #!/usr/bin/python
  2. #
  3. # Author: Victor Ananjevsky, 2007 - 2010
  4. # based on xdg-menu.py, written by Piotr Zielinski (http://www.cl.cam.ac.uk/~pz215/)
  5. # License: GPL
  6. #
  7. # This script takes names of menu files conforming to the XDG Desktop
  8. # Menu Specification, and outputs their FVWM equivalents to the
  9.  
1990860 - AndrewBC: python
  1. C:\Users\AndrewBC\Desktop>python
  2. Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> i_file = open('f_madison_sucks.txt', mode='rb')
  5. >>> o_file = open('f_madison_blows.jpg', mode='wb')
  6. >>> import binascii
  7. >>> import string
  8. >>> d_table = string.maketrans(string.hexdigits, ' '*len(string.hexdigits))
  9.  
1983990 - Kyle Isom: python stocks
  1. #!/usr/bin/env python
  2. """
  3. kisom - basic utilities for dealing with ticker symbols and stocks.
  4. """
  5.  
  6. import re
  7. import urllib2
  8.  
  9.  
1979445 - wrangle pdf dump: python pdf pdftk
  1.         for (key, value) in lines:
  2.                 if key == 'InfoKey':
  3.                         last_info_key = value
  4.                 elif key == 'InfoValue':
  5.                         meta[last_info_key] = unescape(value)
  6.                 elif key in meta_keys:
  7.                         meta[key] = unescape(value)
  8.                 elif key.startswith('PageLabel'):
  9.  
1960938 - bad code: python lol obfuscation
  1. dict = {}
  2. for object in result:
  3.     k2 = {}
  4.     for id,fnct in result[object].items():
  5.         k2.setdefault(tuple(fnct), [])
  6.         k2[tuple(fnct)].append(id)
  7.     for fnct,id in k2.items():
  8.         dict.setdefault(fncts[fnct[0]][4],[])
  9.  
1950453 - PyLogo: python logo
  1. '            ';alpha,find=[(x
  2.           ,x)  for x in xrange(
  3.           256    ) if chr(x). \
  4.           isalpha() or chr(x) \
  5.                      in ', '],\
  6.    lambda c, l: reduce(lambda t,  tt: t
  7.  if (lambda (x,_): x==c)(t) else  tt, l,(
  8. 2*2==5*5,3*3==9*9+1234));unpack  =lambda(_
  9.  
1944830 - ddos.py: python script ddos riaa mpaa
  1. #!/usr/bin/env python
  2. import sys
  3.  
  4. if len(sys.argv) < 3:
  5.     sys.exit("Usage: ddos.py [spawn_limit] [target]")
  6.  
  7. import subprocess
  8. limit = int(sys.argv[1])
  9.  
1924952 - awilcox: python c log fail compile
  1. /bin/sh ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../config   -I/usr/include/python2.6 -I -I/usr/include -fopenmp -I/usr/include/ImageMagick   -g -O2 -DBOOST_PYTHON_DYNAMIC_LIB -MT libpymagick_la-_DrawableViewbox.lo -MD -MP -MF .deps/libpymagick_la-_DrawableViewbox.Tpo -c -o libpymagick_la-_DrawableViewbox.lo `test -f '_DrawableViewbox.cpp' || echo './'`_DrawableViewbox.cpp
  2. libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../config -I/usr/include/python2.6 -I -I/usr/include -fopenmp -I/usr/include/ImageMagick -g -O2 -DBOOST_PYTHON_DYNAMIC_LIB -MT libpymagick_la-_DrawableViewbox.lo -MD -MP -MF .deps/libpymagick_la-_DrawableViewbox.Tpo -c _DrawableViewbox.cpp  -fPIC -DPIC -o .libs/libpymagick_la-_DrawableViewbox.o
  3. _DrawableViewbox.cpp: In function 'void Export_pyste_src_DrawableViewbox()':
  4. _DrawableViewbox.cpp:34:95: error: no matches converting function 'x1' to type 'void (class Magick::DrawableViewbox::*)(long int)'
  5. /usr/include/ImageMagick/Magick++/Drawable.h:2074:8: error: candidates are: void Magick::DrawableViewbox::x1(ssize_t)
  6. /usr/include/ImageMagick/Magick++/Drawable.h:2078:11: error:                 ssize_t Magick::DrawableViewbox::x1() const
  7. _DrawableViewbox.cpp:35:96: error: no matches converting function 'x1' to type 'long int (class Magick::DrawableViewbox::*)()const'
  8. /usr/include/ImageMagick/Magick++/Drawable.h:2074:8: error: candidates are: void Magick::DrawableViewbox::x1(ssize_t)
  9.  
1923198 - gnu_d: python error unicode utf-8 encoding char
  1.                 ucontent = open(filename, "rb")
  2.                 content = u""
  3.                 for i in ucontent.readlines():
  4.                     c = u""
  5.                     for e in i:
  6.                         try:
  7.                             c+= e.encode("utf-8", 'ignore')
  8.                         except UnicodeDecodeError:
  9.  
1908018 - Simple Reboot Conformation v1.0: linux python ubuntu x11 debian david chapman fluxbox gpl fluxbox-menu reboot
  1. #!/usr/bin/python
  2.  
  3. """
  4.     This program is free software: you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation, either version 3 of the License, or
  7.     (at your option) any later version.
  8.  
  9.  
1908015 - Simple Reboot Conformation v1.0: linux python ubuntu x11 debian david chapman fluxbox gpl fluxbox-menu reboot
  1. #!/usr/bin/python
  2.  
  3. """
  4.     This program is free software: you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation, either version 3 of the License, or
  7.     (at your option) any later version.
  8.  
  9.  
1908013 - David A. Chapman: linux python ubuntu x11 debian david chapman fluxbox gpl fluxbox-menu reboot
  1. #!/usr/bin/python
  2.  
  3. """
  4.          This program is free software: you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation, either version 3 of the License, or
  7.     (at your option) any later version.
  8.  
  9.  
1908006 - David A. Chapman: linux python ubuntu x11 debian david chapman fluxbox shutdown gpl fluxbox-menu
  1. #!/usr/bin/python
  2.  
  3. """
  4.     This program is free software: you can redistribute it and/or modify
  5.     it under the terms of the GNU General Public License as published by
  6.     the Free Software Foundation, either version 3 of the License, or
  7.     (at your option) any later version.
  8.  
  9.  
1907221 - Python Dbus Example: python dbus api notifications
  1. import dbus, dbus.service
  2. import gobject
  3. from dbus.mainloop.glib import DBusGMainLoop
  4.  
  5. class SysTrayService(dbus.service.Object):
  6.     def __init__(self):
  7.         DBusGMainLoop(set_as_default=True)
  8.         bus_name = dbus.service.BusName("org.freedesktop.Notifications", bus=dbus.SessionBus())
  9.  
1903857 - feiosqt.py: python pyqt4
  1. #!/usr/bin/python
  2. # coding=utf-8
  3. import sys, os
  4. from PyQt4 import QtGui, QtCore
  5. import shutil
  6. import Image, ImageDraw
  7.  
  8. class CentralWidget(QtGui.QWidget):
  9.  
1903853 - feiosqt.py: python pyqt4
  1. #!/usr/bin/python
  2. # coding=utf-8
  3. import sys, os
  4. from PyQt4 import QtGui, QtCore
  5. import shutil
  6. import Image, ImageDraw
  7.  
  8. class CentralWidget(QtGui.QWidget):
  9.  
1883073 - WebSockets/AMQP chat client : python amqp websockets
  1. # -*- coding: utf-8 -*-
  2. import sys
  3. import random
  4. import time
  5. import select
  6. import logging
  7. from logging import handlers
  8. if hasattr(select, "poll"):
  9.  
1882411 - Setting up Netbeans + Google App: python tutorials browse
  1. print 'Content-Type: text/plain'
  2. print ''
  3. print 'Hello, World!'
1881774 - Plugging AMQP and WebSockets: python amqp websockets
  1. # -*- coding: utf-8 -*-
  2. import sys
  3. import time
  4. import select
  5. import logging
  6. from logging import handlers
  7. if hasattr(select, "poll"):
  8.     from asyncore import poll2 as poll
  9.  
1880591 - mona-triangle.py: python genetic
  1. # -*- coding: utf-8 -*-
  2.  
  3. """The user interface for our app"""
  4.  
  5. import os,sys, random,popen2
  6. import numpy
  7. from PIL import Image
  8.  
  9.  
1879986 - Python process management with C: python cherrypy
  1. # -*- coding: utf-8 -*-
  2. import random
  3. import string
  4. import sys
  5. from multiprocessing import Process, Queue
  6. from Queue import Empty
  7. import logging
  8. from logging import handlers
  9.  
1863132 - Random colormap for matplotlib: python matplotlib colormap basemap
  1. import matplotlib,numpy
  2. import pylab
  3. # A random colormap for matplotlib
  4. cmap = matplotlib.colors.ListedColormap ( numpy.random.rand ( 256,3))
  5. pylab.imshow ( Z, cmap = cmap)
  6. pylab.show()
1802457 - Plone Python crashing: python stop string client fg plone exception zeo cluster client1 foreground
  1. /Applications/Plone/Zope-2.10.11-final-py2.4/lib/python/OFS/SimpleItem.py:247: PendingDeprecationWarning: raising a string exception is deprecated
  2.   raise error_type, v, tb
1797550 - Ping in Python: python portable ping
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. """
  5.     A pure python ping implementation using raw socket.
  6.  
  7.  
  8.     Note that ICMP messages can only be sent from processes running as root.
  9.  
1729056 - yvonnaklonk: python
  1. Hi Everybody,
  2.  
  3. I am delighted to found this. It is a perfect forum
  4.  
  5. <a href=http://sexy-ass.assfuckdolls.com/sexy-ass>sexy ass</a>
1697218 - Stuff: python urllib
  1. Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
  2. [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
  3. Type "help", "copyright", "credits" or "license" for more information.
  4. >>> import urllib
  5. >>> s = u'\xe2'
  6. >>> urllib.quote(s)
  7. /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib.py:1223: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  8.   res = map(safe_map.__getitem__, s)
  9.  
1679797 - splunk_showsource_to_xml.py: python xml views splunk showsource
  1. #!/usr/bin/env python
  2. """
  3. A simple utility to convert Splunk's simple dashboard/form XML format used in
  4. Splunk 4.0 and help you convert it into the advanced XML view format using the
  5. provided "showsource" feature. In the future, an automated tool will most likely
  6. be available. However, in the mean time it is quite tedious to convert all of
  7. that by hand, so I wrote this to quickly convert the python dictionaries dumped
  8. on the web page into the advance XML form structure one module at a time.
  9.  
1676548 - splunk_showsource_to_xml.py: python xml views splunk showsource
  1. #!/usr/bin/env python
  2. """
  3. A simple utility to convert Splunk's simple dashboard/form XML format used in
  4. Splunk 4.0 and help you convert it into the advanced XML view format using the
  5. provided "showsource" feature. In the future, an automated tool will most likely
  6. be available. However, in the mean time it is quite tedious to convert all of
  7. that by hand, so I wrote this to quickly convert the python dictionaries dumped
  8. on the web page into the advance XML form structure one module at a time.
  9.  
1676530 - splunk_showsource_to_xml.py: python xml views splunk showsource
  1. #!/usr/bin/env python
  2. """
  3. A simple utility to convert Splunk's simple dashboard/form XML format used in
  4. Splunk 4.0 and help you convert it into the advanced XML view format using the
  5. provided "showsource" feature. In the future, an automated tool will most likely
  6. be available. However, in the mean time it is quite tedious to convert all of
  7. that by hand, so I wrote this to quickly convert the python dictionaries dumped
  8. on the web page into the advance XML form structure one module at a time.
  9.  
1609860 - MizardX: python pyparsing parser-generator stackoverflow
  1. import tokenize
  2. import pyparsing as p
  3. from operator import itemgetter
  4.  
  5. def parse_grammar(text):
  6.     """Parses the grammar.
  7.  
  8.     # Valid constructs:
  9.  
1590195 - Python backup: python backup
  1. import sys
  2. import os
  3. import os.path
  4. import tarfile
  5. import time
  6. import gzip
  7. import copy
  8. import shutil
  9.  
1590194 - Python backup: python backup
  1. import sys
  2. import os
  3. import os.path
  4. import tarfile
  5. import time
  6. import gzip
  7. import copy
  8. import shutil
  9.  
1580071 - Plasma segfault on python plasmo: python crash backtrace plasma segfault kde4.3.1 plasmoid
  1. Application: Spazio di lavoro di Plasma (plasma-desktop), signal: Segmentation fault
  2. [Current thread is 1 (Thread 0x7f6d875f0790 (LWP 5364))]
  3.  
  4. Thread 3 (Thread 0x7f6d62fdf950 (LWP 5421)):
  5. #0  0x00007f6d825ffd59 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
  6. #1  0x00007f6d82870e19 in QWaitCondition::wait (this=0xd15200, mutex=0xd151f8, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:87
  7. #2  0x00007f6d85fef87c in QHostInfoAgent::run (this=0xd151e0) at kernel/qhostinfo.cpp:260
  8. #3  0x00007f6d8286fe65 in QThreadPrivate::start (arg=0xd151e0) at thread/qthread_unix.cpp:188
  9.  
1542596 - supybot plugin no swearing: python ban kick supybot swear
  1. import time
  2. import supybot.utils as utils
  3. from supybot.commands import *
  4. import supybot.plugins as plugins
  5. import supybot.ircutils as ircutils
  6. import supybot.schedule as schedule
  7. from supybot.ircmsgs import kick, ban, unban
  8. import supybot.callbacks as callbacks
  9.  
1537318 - Python script to mount ISO file: python iso mount zenith
  1. #!/usr/bin/env python
  2.  
  3. import os
  4.  
  5. iso_file = os.popen("zenity --file-selection").read().strip()
  6. if not iso_file: exit(0)
  7.  
  8. mount_point=os.popen("zenity --file-selection --directory").read().strip()
  9.  
1523340 - torrents.py: python bittorrent
  1. #!/usr/bin/python3.1 -O
  2.  
  3. '''
  4.     Library for making torrent files
  5. '''
  6.  
  7. from functools import reduce
  8. from hashlib   import sha1
  9.  
1522193 - getProgIDsFromRegistry.py: python windows com
  1. # Filename: getProgIDsFromRegistry.py
  2. # Roy H. Han (http://us.pycon.org/2008/tutorials/AutomatingWindows/)
  3.  
  4. # Import other modules
  5. from _winreg import *
  6.  
  7. # Initialize list of keys of search
  8. keysToSearch = [
  9.  
1522189 - getProgIDsFromWBEM.py: python windows com
  1. # Filename: getProgIDsFromWBEM.py
  2. # Roy H. Han (http://us.pycon.org/2008/tutorials/AutomatingWindows/)
  3.  
  4. import win32com.client
  5.  
  6. # Dispatch WBEM
  7. wbem = win32com.client.Dispatch('WbemScripting.SWbemLocator')
  8. wbemServer = wbem.ConnectServer('.', 'root\cimv2')
  9.  
1518306 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright (c) 2009 Vindemiatrix Almuredin, Jimmy Skull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518205 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright (c) 2009 Vindemiatrix Almuredin, Jimmy Skull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518200 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright (c) 2009 Vindemiatrix Almuredin, Jimmy Skull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518193 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright (c) 2009 Vindemiatrix Almuredin, Jimmy Skull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518180 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright (c) 2009 Vindemiatrix Almuredin, Jimmy Skull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518178 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright (c) 2009 Vindemiatrix Almuredin, Jimmy Skull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518170 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright(c) 2009 Vindemiatrix Almuredin, JimmySkull <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518169 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright(c) 2009 Vindemiatrix Almuredin, <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1518161 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright(c) 2009 Vindemiatrix Almuredin, <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1517430 - Zipando arquivos com python: python zip
  1. #-*- coding:utf-8 -*-
  2.  
  3. import os.path as path
  4. import sys
  5. import zipfile
  6. import getopt
  7.  
  8. def help():
  9.  
1511403 - Random colormaps with matplotlib: python matplotlib scipy pylab colormaps
  1. import matplotlib,numpy
  2. import pylab
  3.  
  4. #Generate some example data... From http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html
  5. delta = 0.025
  6. x = numpy.arange(-3.0, 3.0, delta)
  7. y = numpy.arange(-2.0, 2.0, delta)
  8. X, Y = numpy.meshgrid(x, y)
  9.  
1504465 - Bindings: python closure pain binding scope
  1. contains = {}
  2. for c in 'aeiou':
  3.   contains[c] = lambda s: c in s
  4.  
  5.  
  6. contains['u']('food')     # => False   ( expected)
  7. contains['u']('zuul')     # => True    ( expected)
  8.  
  9.  
1504459 - Bindings: python closure pain binding scope
  1. contains = {}
  2. for c in 'aeiou':
  3.   contains[c] = lambda s: c in s
  4.  
  5.  
  6. contains['u']('food')     # => False   ( expected)
  7. contains['u']('zuul')     # => True    ( expected)
  8.  
  9.  
1500549 - Django view processing ImageFiel: python django imagefield
  1. def photo_input(request):
  2.     if request.method == 'POST':
  3.         form = PhotoForm(request.POST, request.FILES)
  4.         if form.is_valid():
  5.             profile = User.objects.get('noel').get_profile()
  6.             profile.picture = request.FILES['picture']
  7.             profile.save()
  8.             return HttpResponseRedirect('/next/page/')
  9.  
1500545 - Django view processing ImageFiel: python django imagefield
  1. def photo_input(request):
  2.     if request.method == 'POST':
  3.         form = PhotoForm(request.POST, request.FILES)
  4.         if form.is_valid():
  5.             profile = User.objects.get('noel').get_profile()
  6.             profile.picture = request.FILES['picture']
  7.             profile.save()
  8.             return HttpResponseRedirect('/next/page/')
  9.  
1494254 - Xchatwitter: python xchat twitter
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. ##*MIT License. Copyright(c) 2009 Vindemiatrix Almuredin, <vndmtrx@gmail.com>
  5. ##*
  6. ##* Permission is hereby granted, free of charge, to any person obtaining a copy of this
  7. ##* software and associated documentation files (the "Software"), to deal in the Software
  8. ##* without restriction, including without limitation the rights to use, copy, modify, merge,
  9.  
1490142 - supybot plugin no swearing: python ban kick supybot swear
  1. import time
  2. import supybot.utils as utils
  3. from supybot.commands import *
  4. import supybot.plugins as plugins
  5. import supybot.ircutils as ircutils
  6. import supybot.schedule as schedule
  7. from supybot.ircmsgs import kick, ban, unban
  8. import supybot.callbacks as callbacks
  9.  
1478907 - ppt2twitter: python twitter powerpoint
  1. # Copyright (c) 2009 Andreas Schreiber <Andreas.Schreiber@dlr.de>
  2.  
  3. # uses python-twitter http://code.google.com/p/python-twitter
  4.  
  5. import twitter
  6.  
  7. api = twitter.Api(username='python_demo', password='*')
  8.  
  9.  
1478897 - tail2twitter: python twitter
  1. # based on http://code.activestate.com/recipes/157035/
  2. # uses python-twitter http://code.google.com/p/python-twitter
  3.  
  4. import time, os
  5. import twitter
  6.  
  7. api = twitter.Api(username='python_demo', password='*')
  8.  
  9.  
1478780 - sms2twitter: python sms smartphone pys60
  1. # Copyright (c) 2009 Andreas Schreiber <Andreas.Schreiber@dlr.de>
  2.  
  3. import sys
  4. sys.path.append("e:\\Python")
  5.  
  6. # PyS60
  7. import appuifw
  8. import e32
  9.  
1462408 - Strip IRC Color: python irc strip color
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. '''
  5.   Esta função para retirada dos caracteres de cor se baseia em um autômato construído
  6.   para este propósito, utilizando-se dos conceitos da Máquina de Turing.
  7.  
  8.   Correção do código:
  9.  
1451040 - huy: python
  1. """Модуль для уникального вывода хуйцов"""
  2.  
  3. def huy(n = 1e9000):
  4.   """Выводит Хуйцы в фибоначчевской последовательности"""
  5.   s, a, b, c = '', 0, 1, 0
  6.   while c < n:
  7.     for foo in range(0, b - a):
  8.       s += 'ХУЙ'
  9.  
1450976 - Mine: python
  1. """Модуль для уникального вывода хуйцов"""
  2.  
  3. def fibo(n = 1e9000):
  4.   """Возвращает словарь с числами Фибоначчи (n штук)"""
  5.   result, a, b, c = {}, 0, 1, 0
  6.   while c < n:
  7.     result[c], a, b, c = b, b, a + b, c + 1
  8.   return result
  9.  
1407998 - [phear]crippler: python updater
  1. #!/usr/bin/python
  2. #Update cleaner for Debian Linux based systems
  3. __module_name__ = "Update Cleaner"
  4. __module_version__ = "1.0"
  5. __module_description__ = "Updates software sources list and packages. This program even removes obsolete packages."
  6.  
  7. #Import the string and os functions
  8. import string
  9.  
1407987 - [phear]crippler: python irc
  1. #!/usr/bin/python
  2. #Auto-Auth Script for XChat
  3. __module_name__ = "Auto-Auth Script"
  4. __module_version__ = "1.0"
  5. __module_description__ = "Hides identity on XChat IRC client networks and joins channels."
  6.  
  7. #import the client
  8. import xchat
  9.  
1395411 - modplug.py: python libmodplug modplug py
  1. from ctypes import *
  2.  
  3.  
  4.  
  5. MODPLUG_RESAMPLE_NEAREST = 0
  6. MODPLUG_ENABLE_SURROUND = 16
  7. MODPLUG_ENABLE_MEGABASS = 8
  8. MODPLUG_ENABLE_OVERSAMPLING = 1
  9.  
1377989 - gray2.py - Gray code gen'r: python graycode
  1. #!/usr/bin/python
  2.  
  3. # Gray code by iterative approach. Public domain. pearfalse.co.uk
  4.  
  5. class GrayCode:
  6.         """
  7.         Creates a GrayCode proxy object. This object is iterable.
  8.        
  9.  
1377988 - gray2.py - Iterative Gray code g: python graycode
  1. #!/usr/bin/python
  2.  
  3. # Gray code by iterative approach. Public domain. pearfalse.co.uk
  4.  
  5. class GrayCode:
  6.         """
  7.         Creates a GrayCode proxy object. This object is iterable.
  8.        
  9.  
1374145 - [phear]crippler: python
  1. __module_name__ = "AmarokNP For XChat"
  2. __module_version__ = "1.5"
  3. __module_description__ = "Displays the current song playing in amarok. Has a nice gui for configuring how/what is output"
  4.  
  5. import xchat
  6. import commands
  7.  
  8. def amarok_is_playing():
  9.  
1362335 - Bablyon AD Test #2: python phonon pyqt
  1. from PyQt4 import QtCore, QtGui, QtOpenGL
  2. from PyQt4.phonon import *
  3. from MainWindow import *
  4.  
  5. import sys
  6.  
  7. class VideoPreviewWidget(Phonon.VideoWidget):
  8.     def __init__(self, source, aspect = Phonon.VideoWidget.AspectRatioWidget):
  9.  
1362244 - All unique values of an LDAP att: python ldap
  1. import ldap
  2. from sets import Set
  3.  
  4. config = {'host': 'ldap://ldap.example.com', 'base': 'ou=People,dc=example,dc=com', 'attr': 'l'}
  5.  
  6. data = Set()
  7.  
  8. result = ldap.initialize(config['host']).search_s(config['base'], ldap.SCOPE_SUBTREE, '(%s=*)' % config['attr'], [ config['attr'] ] )
  9.  
1351983 - [phear]crippler: python
  1. #!/bin/bash
  2.  
  3. '''
  4. AUTHOR: [phear]crippler
  5. FILE: updateClean.py
  6. PURPOSE: This Python program is for Debian based systems running apt-get.
  7. It will update your sources, packages, and even remove the obsolete apps.
  8. NOTE: root privileges required.
  9.  
1351981 - [phear]crippler: python
  1. #!/bin/bash
  2.  
  3. '''
  4. AUTHOR: [phear]crippler
  5. FILE: updateClean.py
  6. PURPOSE: This Python program is for Debian based systems running apt-get.
  7. It will update your sources, packages, and even remove the obsolete apps.
  8. NOTE: root privleges required.
  9.  
1330108 - MumPy: python mumpy
  1. *** Logfile started
  2. *** on Sat Feb 7 09:49:22 2009
  3.  
  4. [Sat Feb 7 2009] [09:49:22] Join        You have joined the channel #mumpy (n=sathya@rrcs-24-227-153-240.sw.biz.rr.com).
  5. [Sat Feb 7 2009] [09:49:22] Mode        Channel modes: topic protection, no messages from outside, no colors allowed
  6. [Sat Feb 7 2009] [09:49:22] Created     This channel was created on 02/07/2009 03:45:52 PM.
  7. [Sat Feb 7 2009] [09:49:45] Quit        pulsar has left this server ("Leaving.").
  8. [Sat Feb 7 2009] [09:51:46] Join        The_Pot has joined this channel (n=The_Pot@unaffiliated/chinmay).
  9.  
1203319 - Primeiro Python do PacMan: test python unit
  1. #!/usr/bin/python
  2.  
  3. import unittest
  4.  
  5. class CalculadoraDeQuadrados:
  6.         def quadradoDe(this,x):
  7.                 return x*x
  8.  
  9.  
1181574 - Strip IRC Color: python irc strip color
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. '''
  5.   Esta função para retirada dos caracteres de cor se baseia em um autômato construído
  6.   para este propósito, utilizando-se dos conceitos da Máquina de Turing.
  7.  
  8.   Correção do código:
  9.  
1181084 - Strip IRC Color: python irc strip color
  1. #!/usr/bin/env python
  2. # -*- coding: iso-8859-1 -*-
  3.  
  4. '''
  5.   Esta função para retirada dos caracteres de cor se baseia em um autômato construído
  6.   para este propósito, utilizando-se dos conceitos da Máquina de Turing.
  7.  
  8.   Correção do código:
  9.  
983570 - asd: python
  1. #! /usr/bin/env python
  2. import time
  3. import os
  4. import sys
  5. print "hello in program copy-numbers 0.0.4"
  6. time.sleep(2)
  7. print "This program copies numbers from file 'xD' to file 'lmao.txt'"
  8. time.sleep(2)
  9.  
983496 - Copy-num.py: python
  1. #! /usr/bin/env python
  2.         import time
  3.         import os
  4.         import sys
  5.         print "hello in program copy-numbers 0.0.3"
  6.         time.sleep(2)
  7.         print "This program copies numbers from file 'xD' to file 'lmao.txt'"
  8.         time.sleep(2)
  9.  
970427 - BHB's Code python bhb ajmorris
preview unavailable
970409 - BHB's Code python bhb ajmorris
preview unavailable
968376 - BHB's Code python bhb ajmorris
preview unavailable
968371 - BHB's Code python bhb ajmorris
preview unavailable
966220 - Brainf*ck to Unary converter in : python
  1. # Brainfuck to Unary converter(well, in part) v.0.1
  2.  
  3. def unaryconvert():
  4.     source = raw_input(">") #prompt for entering code
  5.     z = "1" #make sure output starts with a 1
  6.     for y in range(0, len(source)):
  7.         code_input = source[(y):(y+1)] #process a single character at a time
  8.         if code_input == ">": #elif sequence to add binary numbers
  9.  
963544 - pysmsd 0.2: python openmoko sms ira gsm underground-os zad
  1. Index: pyneod.py
  2. ===================================================================
  3. --- pyneod.py   (revision 116)
  4. +++ pyneod.py   (working copy)
  5. @@ -33,6 +33,11 @@
  6.                from pygsmd import GsmPhone
  7.                daemons.append(GsmPhone(bus))
  8.         except Exception, e: LOG(LOG_ERR, __name__, 'pygsmd', e)
  9.  
963485 - pysmsd 0.1: python openmoko sms ira gsm underground-os zad
  1. Index: pyneod.py
  2. ===================================================================
  3. --- pyneod.py   (revision 111)
  4. +++ pyneod.py   (working copy)
  5. @@ -33,6 +33,11 @@
  6.                from pygsmd import GsmPhone
  7.                daemons.append(GsmPhone(bus))
  8.         except Exception, e: LOG(LOG_ERR, __name__, 'pygsmd', e)
  9.  
929725 - mithro: python immutable pointer
  1. def nochange(y):
  2.         y = 1
  3.  
  4. x = 2
  5. nochange(x)
  6. print x # prints 2
  7.  
  8. def nochange(y):
  9.  
925826 - PyGTK Tab-completion: python pygtk tab-completion completion
  1. #!/usr/bin/env python
  2.  
  3. import time
  4. import pygtk
  5. pygtk.require('2.0')
  6. import gtk
  7.  
  8. KEY_TAB = 65289
  9.  
924360 - parser_test.py python html parser
preview unavailable
920522 - GASP error: python gasp
  1. from gasp import *
  2. def play_game():
  3.     Text("Foobar", (20,570), size=24)
  4.  
  5. begin_graphics(800, 600, title="Catch", background=color.yellow)
  6. Text("barfoo", (20,570), size=24)
  7. result = play_game()
915050 - Harsh: python problem bitwise iitk
  1. #!/usr/bin/env python
  2.  
  3. import sys
  4.  
  5. def CreateGraph(graphlist):
  6.         # Split the node entry, i.e. ['1 0'] is split to ['1','0'].
  7.         graphlist = [each.split() for each in graphlist]
  8.         graph = {}
  9.  
893914 - Astor: python
  1. #!/usr/bin/python
  2. # -*- coding: UTF-8 -*-
  3.  
  4. import re
  5.  
  6.  
  7. def NumberOfOccurencesOfWordInText(word,text):
  8.     """Returns the nb. of occurences of whole word(s) (case insensitive) in a text"""
  9.  
893909 - Astor: python
  1. #!/usr/bin/python
  2. # -*- coding: UTF-8 -*-
  3.  
  4. import re
  5.  
  6.  
  7. def NumberOfOccurencesOfWordInText(word,text):
  8.     """Returns the nb. of occurences of whole word(s) (case insensitive) in a text"""
  9.  
884614 - dbobjects.py python debug
preview unavailable
865008 - Vasily: python trivia parser funtrivia funtrivia.com
  1. #QUIZ = 176706
  2.  
  3. # http://www.funtrivia.com/quizzes/music/music_mixture/rap_r_and_b.html
  4. # http://www.funtrivia.com/trivia-quiz/Music/Rap-Albums-96-05-243790.html
  5. # http://www.funtrivia.com/submitquiz.cfm?quiz=243790
  6. import web
  7. #import string
  8. import re
  9.  
864968 - Vasily: python parser funtricia
  1. #QUIZ = 176706
  2.  
  3. # http://www.funtrivia.com/quizzes/music/music_mixture/rap_r_and_b.html
  4. # http://www.funtrivia.com/trivia-quiz/Music/Rap-Albums-96-05-243790.html
  5. # http://www.funtrivia.com/submitquiz.cfm?quiz=243790
  6. import web
  7. #import string
  8. import re
  9.  
856445 - Fabien Devaux: python mplayer from generator wrapper
  1. #!/usr/bin/env python2.5
  2. import os
  3. import select
  4. import subprocess
  5.  
  6. class_code = """# Access MPlayer from python
  7. import os
  8. import select
  9.  
855238 - Fabien Devaux: python mplayer from
  1. from select import select
  2. import subprocess
  3.  
  4. mplayer = subprocess.Popen(['mplayer', '-input', 'cmdlist'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
  5.  
  6. class MPlayer(object):
  7.     def __init__(self):
  8.         self._mplayer = subprocess.Popen(['mplayer', '-slave', '-quiet', '-idle'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, bufsize=1)
  9.  
854087 - cody-somerville: python pygtk glade
  1. #!/usr/bin/env python
  2. #
  3. # Reddit View V0.01
  4. # Author: Cody A.W. Somerville <cody-somerville@ubuntu.com>
  5. # Copyright (C) 2008 Cody A.W. Somerville
  6. # Released under the Open Source BSD Revised license
  7. #
  8.  
  9.  
852381 - Simple parser: python html parser url
  1. # code adapted from:
  2. # http://diveintopython.org/html_processing/extracting_data.html
  3. from sgmllib import SGMLParser
  4.  
  5. TEXT = """
  6. <div id="categories">
  7.   <div id="cat-undo">
  8.     <ul>
  9.  
844472 - wfarr: python banshee
  1. #!/usr/bin/python
  2.  
  3. # Banshee Plugin for Xchat
  4. # Copyright (C) 2007  Will Farrington <wcfarrington@gmail.com>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9.  
837396 - Any idea what is wrong here?: python gstreamer gnonlin
  1. import sys
  2. import pygst
  3. pygst.require("0.10")
  4. import gst
  5. import pygtk
  6. import gtk
  7.  
  8.  
  9.  
822436 - CopyRenderSettings: python blender
  1. #CopyRenderSettings 0.1
  2.  
  3. from Blender import Scene as Sc
  4.  
  5. curscene= Sc.GetCurrent()
  6. context= curscene.getRenderingContext()
  7. ivars= dir(context)
  8. scenes= Sc.Get()
  9.  
807097 - get_dirnames: python foot-shooting
  1. from os import path
  2.  
  3. def get_dirlist(folder, depth=0, include=None, exclude=None):
  4.         """
  5.         Return a list of absolute paths in folder
  6.         include, exclude: a function returning a boolean
  7.         def include(filename):
  8.                 return ShouldInclude
  9.  
790267 - pyslob: python music flac mp4 m4a m4p
  1. #!/usr/bin/python -OO
  2.  
  3. import os.path
  4. import sys
  5.  
  6. import mutagen.easyid3
  7. import mutagen.id3
  8. import mutagen.mp4
  9.  
790171 - Brandon Barker / Random BioSeq G: python random dna protein sequence generate
  1. #!/usr/bin/python
  2.  
  3. import sys
  4. import random
  5.  
  6. def print_help():
  7.   print "syntax is: randseq2.py {protX,prot,dna,dnan} length"
  8.  
  9.  
757704 - PYTHON10SCRIPT: python script cool fun profiler
  1. def promptab(prompt):
  2.     input = raw_input(prompt)
  3.     if input[0].lower() == "a": # this takes the first charcter and makes it lower case, so A, a, and aardvark all register as "a"
  4.         return 0
  5.     elif input[0].lower() == "b": ## same thing
  6.         return 1
  7.     else:
  8.         return -1  ## if the first character is not a or b, return an error code
  9.  
757691 - PYTHON10SCRIPT: python script cool fun profiler
  1. print ("Welcome!")
  2. print ("So what will you be catagorized? EMO,PUNK,HICK,GANGSTA,Hacker,ROCKER,Prep OR GEEK?")
  3. print ("Lets find out")
  4. s= raw_input("Whats your name?:")
  5. print ("Well lets get started:"),s
  6. b= raw_input("Chinese or Mcdonalds:")
  7. c= raw_input("Tennis,Hockey,Soccer,Danceing,Football,or Basketball?:")
  8. d= raw_input("Whats your favorite type of music?:")
  9.  
757689 - PYTHON10SCRIPT: python script cool fun profiler
  1. print ("Welcome!")
  2. print ("So what will you be catagorized? EMO,PUNK,HICK,GANGSTA,Hacker,ROCKER,Prep OR GEEK?")
  3. print ("Lets find out")
  4. s= raw_input("Whats your name?:")
  5. print ("Well lets get started:"),s
  6. b= raw_input("Chinese or Mcdonalds:")
  7. c= raw_input("Tennis,Hockey,Soccer,Danceing,Football,or Basketball?:")
  8. d= raw_input("Whats your favorite type of music?:")
  9.  
751270 - Connect Four: python
  1. class ConnectFour(object):
  2.    
  3.     def __init__(object):
  4.         gameBoard = [[0]*7]*7
  5.         turn = 1
  6.        
  7.     def printBoard(self):
  8.         print "\n"
  9.  
751268 - Connect Four: python
  1. class ConnectFour(object):
  2.        
  3.         def __init__(object):
  4.                 gameBoard = [[0]*7]*7
  5.                 turn = 1
  6.                
  7.         def printBoard(self):
  8.                 print "\n"
  9.  
751258 - Connect Four: python
  1. class ConnectFour(object):
  2.        
  3.         def __init__():
  4.                 gameBoard = [[0]*7]*7
  5.                 turn = 1
  6.                
  7.         def printBoard():
  8.                 print "\n"
  9.  
751257 - Connect Four: python
  1. class ConnectFour(object):
  2.        
  3.         def __init__():
  4.                 gameBoard = [[0]*7]*7
  5.                 turn = 1
  6.                
  7.         def printBoard():
  8.                 print "\n"
  9.  
745860 - lejocelyn: python turtle
  1. [lejocelyn@localhost Documents]$ python dessintriangle.py
  2. ['/home/lejocelyn/Documents',
  3.  '/usr/lib/python25.zip',
  4.  '/usr/lib/python2.5',
  5.  '/usr/lib/python2.5/plat-linux2',
  6.  '/usr/lib/python2.5/lib-tk',
  7.  '/usr/lib/python2.5/lib-dynload',
  8.  '/usr/lib/python2.5/site-packages',
  9.  
731525 - popt: python
  1. -----------------------
  2. in urls.py
  3. -----------------------
  4. from django.views.generic.date_based import object_detail
  5. from django.contrib.auth.decorators import login_required
  6.  
  7. urlpatterns = patterns('',
  8.     (r'^archive/$', login_required(object_detail)),
  9.  
708323 - hdh: python kde4
  1. Index: kdebindings/python/pykde4/sip/kio/global.sip
  2. ===================================================================
  3. --- kdebindings/python/pykde4/sip/kio/global.sip        (revision 714691)
  4. +++ kdebindings/python/pykde4/sip/kio/global.sip        (working copy)
  5. @@ -272,13 +272,13 @@
  6.      QMap<QString,QString> *cppmap = new QMap<QString,QString>;
  7.  
  8.      PyObject *aelem, *belem;
  9.  
652543 - markuz vimrc: python vim vimrc hightlight
  1. " An example for a vimrc file.
  2. "
  3. " Maintainer:   Bram Moolenaar <Bram@vim.org>
  4. " Last change:  2002 Sep 19
  5. "
  6. " To use it, copy it to
  7. "     for Unix and OS/2:  ~/.vimrc
  8. "             for Amiga:  s:.vimrc
  9.  
646378 - py_gen_opt.py: python clutter opt
  1. #!/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4. #Générateur de fichier xml pour opt
  5.  
  6. import glob
  7.  
  8. #nom du fichier xml
  9.  
646376 - py_gen_opt.py: python clutter opt
  1. #!/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4. #Générateur de fichier xml pour opt
  5.  
  6. import glob, string
  7.  
  8. #nom du fichier xml
  9.  
637080 - wfarr: python banshee
  1. #!/usr/bin/python
  2.  
  3. # Banshee Plugin for Xchat
  4. # Copyright (C) 2007  Will Farrington <wcfarrington@gmail.com>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9.  
636867 - mon code: omg python string letter array
  1. # -*- coding: cp1252 -*-
  2. #mon script python
  3. tab = ''
  4. chaine = 'texte'
  5. a = 0
  6. while a < len(chaine) :
  7.     lettre = chaine[a]
  8.     if voy(lettre) == 1 :
  9.  
636859 - mon code: omg python string letter array
  1. chaine = 'texte'
  2. a = 0
  3. while a < len(chaine) :
  4.     lettre = chaine[a]
  5.     a += 1
636857 - mon code: omg python string letter array
  1. chaine = 'texte'
  2. a = 0
  3. while a < len(chaine) :
  4.     lettre = chaine[a]
635458 - UnboundMethod: python
  1. class Map:
  2.     def __init__(self, arg1, arg2, arg3):
  3.         #Some stuff here
  4.     @classmethod
  5.     def from_xml(cls, xml):
  6.         #Parses xml and returns new instance, without being bound
  7.         a, b, c = parse_xml(xml)
  8.         return cls(a,b,c)
632796 - flickrlite.py: python flickr easy lazy
  1. MY_USER_ID=''
  2. MY_API_KEY=''
  3.  
  4. from pyflickr import flickr
  5. getR=flickr.utils.flickr_get
  6.  
  7. class FlickrLiteError:
  8.     def __init__(self,message):
  9.  
630175 - trevarthan: python on maemo dbus display off
  1. #!/usr/bin/python
  2. import dbus.glib,gobject
  3.  
  4. def handler(sender=None):
  5.     print "got signal from %r" % sender
  6.  
  7. def catchall_signal_handler(*args, **kwargs):
  8.     print ("Caught signal (in catchall handler) " + kwargs['dbus_interface'] + "." + kwargs['member'])
  9.  
630173 - trevarthan: python on maemo dbus display off
  1. #!/usr/bin/python
  2. import dbus.glib,gobject
  3.  
  4. def handler(sender=None):
  5.     print "got signal from %r" % sender
  6.  
  7. def catchall_signal_handler(*args, **kwargs):
  8.     print ("Caught signal (in catchall handler) " + kwargs['dbus_interface'] + "." + kwargs['member'])
  9.  
616066 - ikks: python command line sample
  1. #!/usr/bin/python
  2. import sys
  3.  
  4. if __name__ == '__main__':
  5.  
  6.         if len(sys.argv) > 1:
  7.             for i in sys.argv:
  8.                 print i
  9.  
601969 - wfarr: python banshee
  1. #!/usr/bin/python
  2.  
  3. # Banshee Plugin for Xchat
  4. # Copyright (C) 2007  Will Farrington <wcfarrington@gmail.com>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9.  
597872 - wfarr: python banshee
  1. #!/usr/bin/python
  2.  
  3. # Banshee Plugin for Xchat
  4. # Copyright (C) 2007  Will Farrington <wcfarrington@gmail.com>
  5. #
  6. # This program is free software: you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9.  
587595 - Project Euler 1-17: project euler python
  1. #!/usr/bin/python
  2. # -*- coding: iso-8859-15 -*-
  3. import math,sys,time,operator
  4.  
  5. # Simple primality check (slow)
  6. # Basic optimization in place: only check up to sqrt(n)
  7. def isprime_basic(n):
  8.         if n == 1: # Special case
  9.  
587586 - Project Euler 1-17: project euler python
  1. #!/usr/bin/python
  2. # -*- coding: iso-8859-15 -*-
  3. import math,sys,time,operator
  4.  
  5. # Simple primality check (slow)
  6. # Basic optimization in place: only check up to sqrt(n)
  7. def isprime_basic(n):
  8.         if n == 1: # Special case
  9.  
worth-right
fantasy-obligation