code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
from django.http import HttpResponse
from django.template import Context
from django.template.loader import get_template
from django.http import HttpResponse, Http404
from django.contrib.auth.models import User
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.co... | Python |
#!/usr/bin/python
import random
import time
import os
import yaml
class RandomVerse:
menu_options = ["",'Verse', "Add Verse", "Delete Verse"]
verse_list = {}
def __init__(self):
print ""
print ""
print "Welcome to a random verse generator!"
time.sleep(1)
def LoadVer... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of FORTAX Calculator;
# (c) 2009 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Calculator 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, eithe... | Python |
# -*- coding: utf-8 -*-
# This file is part of FORTAX Calculator;
# (c) 2009 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Calculator 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... | Python |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of FORTAX Calculator;
# (c) 2009 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Calculator 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, eithe... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of FORTAX Systems;
# (c) 2010 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Systems 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,... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of FORTAX Systems;
# (c) 2010 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Systems 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,... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of FORTAX Systems;
# (c) 2010 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Systems 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,... | Python |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of FORTAX Systems;
# (c) 2010 Andrew Shephard; andrubuntu@gmail.com
#
# FORTAX Systems 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,... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
#!/usr/bin/python
#
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | Python |
# This is the version of this source code.
manual_verstr = "1.5"
auto_build_num = "211"
verstr = manual_verstr + "." + auto_build_num
try:
from pyutil.version_class import Version as pyutil_Version
__version__ = pyutil_Version(verstr)
except (ImportError, ValueError):
# Maybe there is no pyutil insta... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | Python |
"""
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
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 ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off o... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | Python |
# Copyright (C) 2011 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright 2011 Google Inc. All Rights Reserved.
"""Locked file interface that should work on Unix and Windows pythons.
This module first tries to use fcntl locking to ensure serialized access
to a file, then falls back on a lock file if that is unavialable.
Usage:
f = LockedFile('filename', 'r+b', 'rb')
f.... | Python |
__version__ = "1.0c2"
| Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
import Cookie
import datetime
import time
import email.utils
import calendar
import base64
import hashlib
import hmac
import re
import logging
# Ripped from the Tornado Framework's web.py
# http://github.com/facebook/tornado/commit/39ac6d169a36a54bb1f6b9bf1fdebb5c9da96e09
#
# Tornado is licensed under the Apache Licen... | Python |
# Copyright (C) 2007 Joe Gregorio
#
# Licensed under the MIT License
"""MIME-Type Parser
This module provides basic functions for handling mime-types. It can handle
matching mime-types against a list of media-ranges. See section 14.1 of the
HTTP specification [RFC 2616] for a complete explanation.
http://www.w3.o... | Python |
# Copyright (C) 2012 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
#!/usr/bin/python2.4
#
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | Python |
__version__ = "1.0c2"
| Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Python |
# Early, and incomplete implementation of -04.
#
import re
import urllib
RESERVED = ":/?#[]@!$&'()*+,;="
OPERATOR = "+./;?|!@"
EXPLODE = "*+"
MODIFIER = ":^"
TEMPLATE = re.compile(r"{(?P<operator>[\+\./;\?|!@])?(?P<varlist>[^}]+)}", re.UNICODE)
VAR = re.compile(r"^(?P<varname>[^=\+\*:\^]+)((?P<explode>[\+\*])|(?P<part... | Python |
#!/usr/bin/env python
# Copyright (c) 2010, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | Python |
"""SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... | Python |
"""
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | Python |
from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | Python |
#!/usr/bin/env python
#
# Copyright (c) 2002, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"Creador de instalador para PyAfipWs (WSMTXCA)"
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
from distutils.core import setup
import py2exe
import glob, sys
# includes for py2e... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"""
__version__ = "$Revision: 1.3 $"
__date__ = "$Date: 2005/04/05 18:44:54 $"
"""
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2008 Mariano Reingart"
from distutils.core import setup
import py2exe
import... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"Creador de instalador para PyAfipWs (WSAA)"
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
from distutils.core import setup
import py2exe
import glob, sys
# includes for py2exe
... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"Creador de instalador para PyAfipWs"
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2008 Mariano Reingart"
from distutils.core import setup
import py2exe
import sys
# includes for py2exe
includes=['e... | Python |
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed in ... | Python |
import wsaa
import os,sys
from subprocess import Popen, PIPE
from base64 import b64encode
def sign_tra(tra,cert,privatekey):
"Firmar PKCS#7 el TRA y devolver CMS (recortando los headers SMIME)"
# Firmar el texto (tra)
out = Popen(["openssl", "smime", "-sign",
"-signer", cert,... | Python |
# Para hacer el ejecutable:
# python setup.py py2exe
#
"Creador de instalador para PyAfipWs (WSMTXCA)"
__author__ = "Mariano Reingart (mariano@nsis.com.ar)"
__copyright__ = "Copyright (C) 2010 Mariano Reingart"
from distutils.core import setup
import py2exe
import glob, sys
# includes for py2e... | Python |
#!/usr/bin/python
# -*- coding: latin-1 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3, or (at your option) any later
# version.
#
# This program is distributed in t... | Python |
#!/usr/bin/env python
import sys
from PyQt4 import Qt
# We instantiate a QApplication passing the arguments of the script to it:
a = Qt.QApplication(sys.argv)
# Add a basic widget to this application:
# The first argument is the text we want this QWidget to show, the second
# one is the parent widget. Since Our "hel... | Python |
#!/usr/bin/env python
import sys
from PyQt4 import Qt
a = Qt.QApplication(sys.argv)
# Our function to call when the button is clicked
def sayHello():
print "Hello, World!"
# Instantiate the button
hellobutton = Qt.QPushButton("Say 'Hello world!'",None)
# And connect the action "sayHello" to the event "but... | Python |
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class HelloWorld:
def on_combo_changed(self, widget, data=None):
print self.combo.get_active_text()
def on_window_destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self... | Python |
#!/usr/bin/env python
import sys
from PyQt4 import Qt
# We instantiate a QApplication passing the arguments of the script to it:
a = Qt.QApplication(sys.argv)
# Add a basic widget to this application:
# The first argument is the text we want this QWidget to show, the second
# one is the parent widget. Since Our "hel... | Python |
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class HelloWorld:
def on_button_clicked(self, widget, data=None):
print "Hello World"
def on_window_destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connec... | Python |
#!/usr/bin/env python
import sys
from PyQt4 import Qt
a = Qt.QApplication(sys.argv)
# Our function to call when the button is clicked
def sayHello():
print "Hello, World!"
# Instantiate the button
hellobutton = Qt.QPushButton("Say 'Hello world!'",None)
# And connect the action "sayHello" to the event "but... | Python |
import pygtk
pygtk.require('2.0')
import gtk
class Conversion:
def on_convert_clicked(self,widget):
usd = self.usd_entry.get_text()
usd = int(usd)
inr = usd * 44.75
self.inr_entry.set_text(str(inr))
def on_window_destroy(self, widget, data=None):
gtk.main_quit()... | Python |
import pygtk
pygtk.require('2.0')
import gtk
import pango
class SysInfo:
def on_button_clicked(self, button, filename):
text = open("/proc/" + filename).read()
self.info_view.get_buffer().set_text(text)
def on_window_destroy(self, window):
gtk.main_quit();
def __init__(self):
... | Python |
import pygtk
pygtk.require('2.0')
import gtk
class HelloWorld:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_border_width(5)
self.button = gtk.Button("Hello World!")
self.window.add(self.button)
self.window.show_all()
def main(self):
gtk.main()
if __name__ == "__... | Python |
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class HelloWorld:
def on_button_clicked(self, widget, data=None):
print "Hello World"
def on_window_destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connec... | Python |
#!/usr/bin/env python
import pygtk
pygtk.require('2.0')
import gtk
class HelloWorld:
def on_combo_changed(self, widget, data=None):
print self.combo.get_active_text()
def on_window_destroy(self, widget, data=None):
gtk.main_quit()
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self... | Python |
import sys
import random
def open_capitals():
try:
# Throws IOError, if open fails.
return open("capitals.txt")
except IOError as e:
print "error opening capitals.txt: %s" % e.strerror
sys.exit(1)
def parse_capitals(cfile):
capitals = {}
for i, line in enumerate(cfile):... | Python |
import MySQLdb as db
import sys
import conf
conn = db.connect("shark", conf.username, conf.password, conf.database)
cursor = conn.cursor()
cursor.execute("DROP TABLE IF EXISTS accounts")
# Create Tables
sql = """CREATE TABLE accounts (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VA... | Python |
import MySQLdb as db
import conf
from decimal import Decimal
def input_num(msg, numtype):
while True:
try:
num = raw_input(msg)
num = numtype(num)
return num
except ValueError, e:
print "Invalid number."
def get_balance(accno):
cursor.execute("SE... | Python |
server = "shark"
username = "erp1"
password = "erp1"
database = "erp1"
| Python |
import pygame, sys, math, random, time
pygame.init()
from Block import Block
from Player import Player
from HardBlock import HardBlock
from Enemy import Enemy
from Background import Background
from Bullet import Bullet
from transportblock import TransportBlock
clock = pygame.time.Clock()
width = 800
height = 600
si... | Python |
import pygame, sys, math
class Background(pygame.sprite.Sprite):
def __init__(self, image, size):
pygame.sprite.Sprite.__init__(self, self.containers)
self.image = pygame.image.load(image)
self.image = pygame.transform.scale(self.image, size)
self.rect = self.image.get_rect()
... | Python |
import pygame, sys, math
class Player(pygame.sprite.Sprite):
def __init__(self, health, pos = (0,0), blocksize = [50,50], screensize = [800,600]):
pygame.sprite.Sprite.__init__(self, self.containers)
self.screensize = screensize
self.upImages = [pygame.image.load("rsc/player/playerBall_up1.... | Python |
import pygame, sys, math
class Bullet(pygame.sprite.Sprite):
def __init__(self, direction, pos = (0,0)):
if direction == "right":
image = "rsc/weapons/bulletR.png"
else:
image = "rsc/weapons/bulletL.png"
pygame.sprite.Sprite.__init__(self, self.containers)
se... | Python |
import pygame, sys, math
from Block import Block
class TransportBlock(Block):
def __init__(self, pos = (0,0), blocksize = [50,50]):
Block.__init__(self, "rsc/blocks/transportblock.png", pos, blocksize) | Python |
import pygame, sys, math
from Block import Block
class HardBlock(Block):
def __init__(self, image, pos = (0,0), blocksize = [50,50]):
Block.__init__(self, image, pos, blocksize)
| Python |
import pygame, sys, math
from Block import Block
class HardBlock(Block):
def __init__(self, image, pos = (0,0), blocksize = [50,50]):
Block.__init__(self, image, pos, blocksize)
| Python |
import pygame, sys, math
class Block(pygame.sprite.Sprite):
def __init__(self, image, pos = (0,0), blocksize = [50,50]):
pygame.sprite.Sprite.__init__(self, self.containers)
self.image = pygame.image.load(image)
self.image = pygame.transform.scale(self.image, blocksize)
self.rect = ... | Python |
import pygame, sys, math, random
from Block import Block
class Enemy(Block):
def __init__(self, image, pos = (0,0), blocksize = [50,50]):
Block.__init__(self, image, pos, blocksize)
self.maxSpeed = blocksize[0]/14.0
self.living = True
self.detectRange = 100
self.seePlayer =... | Python |
'''OpenAnything: a kind and thoughtful library for HTTP web services
This program is part of 'Dive Into Python', a free Python book for
experienced programmers. Visit http://diveintopython.org/ for the
latest version.
'''
__author__ = 'Mark Pilgrim (mark@diveintopython.org)'
__version__ = '$Revision: 1.6 $'[11:-2]
_... | Python |
#!/usr/bin/python
"""
Manipulates Fortran Namelists
Defines
Namelist class
TODO: == As a Stand alone program ==
Print info about Fortran Namelists
Usage: namelist.py -f FILENAME [-n NAMELIST [-p PARNAME]]
FILENAME: path/name of config file
NAMELIST: namelist name (since a... | Python |
#!/usr/bin/python
"""
General settings class to read/manipulate data from settings file
This class is meant to be subclassed to parse the settings file data, print the settings...
"""
__author__ = 'Stephane Chamberland (stephane.chamberland@ec.gc.ca)'
__version__ = '$Revision: 1.0 $'[11:-2]
__date__ = '$Date: 2006/08/... | Python |
#!/usr/bin/python
"""
Manipulates Fortran Namelists
Defines
Namelist class
TODO: == As a Stand alone program ==
Print info about Fortran Namelists
Usage: namelist.py -f FILENAME [-n NAMELIST [-p PARNAME]]
FILENAME: path/name of config file
NAMELIST: namelist name (since a... | Python |
#!/usr/bin/python
"""
General settings class to read/manipulate data from settings file
This class is meant to be subclassed to parse the settings file data, print the settings...
"""
__author__ = 'Stephane Chamberland (stephane.chamberland@ec.gc.ca)'
__version__ = '$Revision: 1.0 $'[11:-2]
__date__ = '$Date: 2006/08/... | Python |
#!/usr/bin/env python
""" Test Viewer Application for Foscam Camera module """
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
import foscam
import Image
from StringIO import StringIO
ImageReadyEventId = 1382
class ImageReadyEvent(QEvent):
def __init__(self, image):
QEvent.__init__(self,... | Python |
#!/usr/bin/env python
"""
A simple module to exploit my Foscam F1891W pan/tilt camera.
I obtained information on the CGI interface from Foscam's document
entitled "MJPEG Camera CGI v1.21.pdf" from www.foscam.com
Only the functionality that interested me is implemented here.
Additional functions can be easily added b... | Python |
#!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python |
#!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python |
#!/usr/bin/python2.5
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | Python |
#! /usr/bin/env python
from PyQt4 import QtGui,QtCore
import heapq
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWindow,self).__init__()
self.setGeometry(100,100,1000,800)
self.MasterWidget=QtGui.QWidget(self)
self.MasterLayout = QtGui.QHBoxLayout(self.MasterW... | Python |
#! /usr/bin/env python
from PyQt4 import QtGui,QtCore
import heapq
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWindow,self).__init__()
self.setGeometry(100,100,1000,800)
self.MasterWidget=QtGui.QWidget(self)
self.MasterLayout = QtGui.QHBoxLayout(self.MasterW... | Python |
'''
Created on May 6, 2013
@author: lord voltron
'''
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtDeclarative import *
import myAstar
class ImageProvider(QDeclarativeImageProvider):
# changed = Signal()
def __init__(self,parent... | Python |
import Image
im = Image.open("hurga.png")
sizex,sizey = im.size
count = 0
for i in range(sizex):
for j in range(sizey):
pixel = im.getpixel((i,j))
if pixel != (0,0,0,0):
count += 1
print count
| Python |
#! /usr/bin/env python
import heapq
import Image
import sys
from time import time
from PySide import QtCore,QtGui
class Cell(object):
def __init__(self, x, y, reachable):
"""
the cell ansich, x und y sind selbsterklaerend
type ist walkable,impassable, some kind of walkable
"""
... | Python |
#! /usr/bin/env python
import heapq
import Image
import sys
from time import time
from PySide import QtCore,QtGui
class Cell(object):
def __init__(self, x, y, reachable):
"""
the cell ansich, x und y sind selbsterklaerend
type ist walkable,impassable, some kind of walkable
"""
... | Python |
#! /usr/bin/env python
version="Alpha 1.0"
from PyQt4 import QtGui
Application=QtGui.QApplication([])
from ftllibs.FTL import CHAMPS as CHAMPS
from ftllibs.ui.ChampionsTab import ChampTab
from ftllibs.ui.BuildTab import BuildTab
from ftllibs.ui.CompareTab import CompareTab
from ftllibs.ui.MasteriesTab import Masteri... | Python |
#! /usr/bin/env python
version="Alpha 1.0"
from PyQt4 import QtGui
Application=QtGui.QApplication([])
from ftllibs.FTL import CHAMPS as CHAMPS
from ftllibs.ui.ChampionsTab import ChampTab
from ftllibs.ui.BuildTab import BuildTab
from ftllibs.ui.CompareTab import CompareTab
from ftllibs.ui.MasteriesTab import Masteri... | Python |
class Item_3001():
def __init__(self):
self.parent=False
self.Name="Abyssal Scepter"
self.Icon="3001.png"
self.Stack=0
self.MaxStack=0
self.Built_From=['1026','1057']
self.Builds_Into=[]
self.Tags=['spell_block','spell_damage']
self.Costs = 105... | Python |
#! /usr/bin/env python
from bs4 import BeautifulSoup
import re
import sys
import os
#passive_error_list = ['3174','3005','3028','3186','3126','3004','3089','3141','3072','3134','3077','3142']
filename=sys.argv[1]
soup = BeautifulSoup(open(filename))
#print soup.prettify()
tagtags = soup.find_all('table',{ 'class':'c... | Python |
#class hurga():
def Custom(self):
self.MaxStack=250
self.Stack=250
def UpdateStats_Custom(self):
temp=self.Stack * 4
self.parent.Mana += temp | Python |
#! /usr/bin/env python
from bs4 import BeautifulSoup
import re
import sys
import os
#passive_error_list = ['3174','3005','3028','3186','3126','3004','3089','3141','3072','3134','3077','3142']
filename=sys.argv[1]
soup = BeautifulSoup(open(filename))
#print soup.prettify()
tagtags = soup.find_all('table',{ 'class':'c... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.