A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Monthly Archives: October 2010

File Streaming in Django (Sending large files through Django)

I am planning to build something involving serving large files over HTTP. Putting the files in a public accessible directory is not an option since I need to monitor the users who download the file. Users will need to login … Continue reading

Posted in General | Tagged , , , | 3 Comments

A Simple Tkinter Example (Python)

What is Tkinter? Tkinter is Python’s de-facto standard GUI (Graphical User Interface) package. It is a thin object-oriented layer on top of Tcl/Tk. Here is a simple Tkinter example. The code below should generate a very simple GUI with a … Continue reading

Posted in General | Tagged , | 2 Comments

A Basic Python Class

This is the basic structure of a Python class. >>> class Simplex: … "An example class""" … def __init__(self, x, y): … self.a = x … self.b = y … def addition(self): … return self.a + self.b … >>> z … Continue reading

Posted in General | Tagged , , , | 1 Comment

My notes for Lists in Python

Lists A list is a sequence of values. [ and ] like numerically indexed arrays in PHP >>> # a list of numbers >>> my_numbers = [10, 15, 20, 25] >>> print my_numbers [10, 15, 20, 25] >>> >>> #a … Continue reading

Posted in General | Tagged , | 2 Comments

Basic Python: Filenames and paths

Another Python post! I am still learning the language. Since I cannot remember everything, I am posting it here for future reference. Get the Current Working Directory To get the “current working directory” do this: import os current_dir = os.getcwd() … Continue reading

Posted in General | Tagged , , , , , , , | Leave a comment