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