Skip to content

Instantly share code, notes, and snippets.

@zagfai
zagfai / centpy.sh
Last active Aug 29, 2015
CentOS release 6.3 (Final) INSTALL python 2.7 env including pip mysqldb and do the links.
View centpy.sh
#!/bin/bash
# system packages =============================================================
yum -y install python-devel openssl openssl-devel gcc sqlite sqlite-devel mysql-devel libxml2-devel libxslt-devel
# Python ======================================================================
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz
tar -xzf Python-2.7.6.tgz
cd Python-2.7.6
./configure --prefix=/usr/local/python2.7 --with-threads --enable-shared
@zagfai
zagfai / py-non-blocking-input
Created Sep 25, 2013
python non blocking input
View py-non-blocking-input
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" python non blocking input
"""
__author__ = 'Zagfai'
__version__= '2013-09-13'
import sys
import select
from time import sleep
@zagfai
zagfai / MyBot.py
Created Dec 24, 2011
My BOT which got the 800th place in the Ants ( AI Challenge ). Have fun.
View MyBot.py
#!/usr/bin/env python
import math
import heapq
from ants import *
class MyBot:
def __init__(self):
pass
def do_setup(self, ants):