MySQL Python with MAMP

Posted July 15th, 2010 in Blog by admin

Today, I tried to install mysql client library for python. I got client library from http://sourceforge.net/projects/mysql-python . After download and I change mysql_config in site.cfg. I gave

mysql_config= /Application/MAMP/library/bin/mysql_config

and then

$python setyp.py clean
$python setyp.py build

and the I got many errors.

gcc-4.0 failed with exit code 1

I didn’t know Why occur like that. Most of .c files are not found in error message. So, I search in My Mac and I couldn’t find it. I decied to install mysql 5 again. Only client library not include server.

sudo port install mysql5

After installation, I change site.cfg like that

mysql_config = /opt/local/lib/mysql5/bin/mysql_config

after that

$python setup.py clean
$sudo python setup.py build
$sudo python setup.py install

No problem. So, I tried in python from terminal

>>import MySQLdb

I got error again. There is no sock in /opt/local/var/run/mysql5/mysqld.sock

Ok. We can make from MAMP sock. I add following code in terminal

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /opt/local/var/run/mysql5/mysqld.sock

After that, I tried again in python and connect mysql database that from MAMP. Yayyy… it’s working fine.

Python is very faster than PHP

Posted August 31st, 2009 in Blog by admin

Today, I am reverse python code to PHP. I run php code in command line. Oh!!! python is very faster than PHP. I waited 30 seconds for convert file. When I used Python,it’s just 1 second for convert file. Same Algorithm, same idea and same file size. However, python is very faster than PHP. We shall not use PHP for search engine, crawling program and Giga bytes file converting.Imm.. I need to learn Python.

Spring Werk XSS Scanner

Posted August 28th, 2009 in Blog by admin

Today, I found XSS Scanner that written by python. It’s nice a easy to use. We need to install python and we just run in cmd like that

C:\springenwerk\>python springenwerkgui.py

 

OR

 

C:\springenwerk\>python springenwerk.py –output=result.html http://www.samplepage.com/index.php

After that you will see result in result.html.

 

http://springenwerk.org