Fetching dictionary result from database in Python Date: December 11, 2008 Tags: python Comments(0)
Python's current database api doesn't contain any function like "fetchDict" to get data as dictionary.I've looked for a simple solution and coded a lambda function to turn tuples into dictionaries.Example;result = [(6,'the foundation','isaac asimov')]
cols = ('book_id','book_name','author_name') # column names of "books" table
Built-in zip function merges arrays and tuples;
>>> [ dict(zip(cols,row)) for row in result ]
[{'author_name': 'isaac asimov', 'book_name': 'the foundation', 'book_id': 6}]
And here is the lambda I coded:
lambda keys,values: [ dict(zip(keys,row)) for row in values ]
pyChessEngine Date: November 24, 2008 Tags: python Comments(0)
I've developed a chess engine to validate and to analyze piece movements.It contains basic playing&testing interface, also can be implemented to chess projects easily.Feel free to use..
Links:
* Project Homepage
* Usage Example
* Browse Source
* SVN Repository
* Bug Report
gtranslate Date: September 17, 2008 Tags: python Comments(3)
Update: Now Pardus Pisi package is available too! (Thanks to uic/yns)I coded a simple desktop program that provides using Google's translate service on linux/windows desktop, named GTranslate.
Screenshot
Download
- Linux:
- Windows: 9x/2k/XP/Vista Installer (5.4mb)
- Source: gtranslate_1.0.tar.gz (17.6KB)
Available Languages
Arabic, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hindi, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish, SwedishDependencies
- Pyhon 2.5
- wxPython 2.6
Mutant Web Uygulamalari Date: August 25, 2008 Tags: cherrypy , comet , javascript , pi , python Comments(1)
RIATalks'ta yaptigim sunumun dosyasini sonunda buldum, artik indirmek mumkun; pdf | ppt | slideshare. Sunumun icerigi (40 slayt):- Teknik inceleme
- Cloudo ve Firebug Lite Nasil gelistirildi?
- DOM Teknikleri
- Veri Tasima Yontemleri
- Python ve Comet
- Comet Istegi Nasil Olusturulur?
- Server nasil yanit vermeli?
- CherryPy ile Stream Ornegi
- Gelecegin Browser Teknolojileri
- HTML5
- Javascript 2
- Tamarin,IronPython&IronRuby ve ScreamingMonkey
pi.comet's python module is available Date: March 21, 2008 Tags: cherrypy , comet , django , javascript , pi , python Comments(2)
I coded a python module to get cross browser output and a CherryPy example is available too.You can get these files in downloads list.You can use this module with any python web framework but there are some problems.Firstly, Django doesn't support multi-threading.And there is no shared hosting for CherryPy ( Webfaction runs CherryPy with CGI, sys.stdout.flush function doesn't work on that application ) I hope we have got more comet friendly web frameworks in the future.
PyWeblog: Simple&Useful Weblog Application Date: March 13, 2008 Tags: django , python Comments(0)
PyWeblog is a Django based open source blog application has written by me.Features:
- Template support (Django contains an advanced template language)
- Django administration interface
- Tagging
- Commenting
- Picture Uploading
Releases:
Installing
- Download latest version and extract anywhere.
- Create a MySQL database to use for this application
- Open settings.py to editing and set DATABASE_NAME,DATABASE_USER AND DATABASE_PASSWORD variables
- Open terminal in where you extracted the files, and type:
>>> python manage.py validate - If manage.py counted zero errors, type this:
>>> python.manage.py syncdb - That's all :)
