Skip to content

Instantly share code, notes, and snippets.

View baijum's full-sized avatar
🏠
Working from home

Baiju Muthukadan baijum

🏠
Working from home
  • Red Hat
  • India
View GitHub Profile
import sys
sys.path.append(r"C:\webp")
from hello import app as application
from .application import db
from werkzeug import generate_password_hash, check_password_hash
class Distribution(db.Model):
__tablename__ = 'distribution'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(50), unique=True)
url = db.Column(db.String(50))
from py3k.application import db
from py3k.model import Distribution
import xmlrpclib
client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
# XXX: Remove these hard-coding later
package_names = ['zope.interface', 'Twisted']
#package_names = client.list_packages()
for name in package_names:
@baijum
baijum / horror.py
Created March 10, 2011 18:44
Exception alias and variable scope
>>> e = "Hello"
>>> try:
x = int("foo")
except ValueError as e:
print("Horror!")
print(e)
Horror!
invalid literal for int() with base 10: 'foo'
@baijum
baijum / .vimrc
Created April 28, 2011 07:38
VIM Configuration
set ts=4
set sw=4
set expandtab
syntax on
set history=50
set autoindent smartindent
set smarttab
set backspace=eol,start,indent
@baijum
baijum / test_python_org_search.py
Created June 25, 2011 11:13
Selenium TestCase using Python binding
import unittest
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class PythonOrgSearch(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
@baijum
baijum / selenium_with_python.rst
Last active April 19, 2024 14:37
Selenium with Python
@baijum
baijum / flask.rst
Created July 10, 2011 18:03
Flask Notes
@baijum
baijum / why-not-python2.7-yet.rst
Created July 20, 2011 06:42
Why not Python 2.7 yet ?

What are the possible reasons for not using Python 2.7 yet ?

  1. Google App Engine does not support Python 2.7
  2. The GNU/Linux stable distributions doesn't support Python 2.7 eg:- Ubuntu 10.04 LTS, Debian 6.0, RHEL 6, CentOS 6, Slackware 13.37
  3. Using Python 3.x and no plan to support older Python versions
  4. IPython is not yet supported
  5. Some hosting sites like iPage doesn't support Python 2.7
  6. To keep Jython compatibility (Jython doesn't have Python 2.7 support)
  7. OSX 10.6 doesn't support Python 2.7