Archives
Twitter
- Installing two versions of Netbeans. 6.8 for PHP. 6.9 for Java! 2 hours ago
- Passing time on #php room on FreeNode IRC.... 12 hours ago
- Just updated my website front page :- http://masnun.com :) 13 hours ago
- http://stackoverflow.com/questions/1285871/problem-with-ie-using-960-gs 15 hours ago
- @neotushar ID: masnun . Server: FreeNode. Usual Rooms: #codeigniter & #kohana so far :) 1 day ago
- Chatting on IRC for the first time... The place of geeks... :) 1 day ago
- Maradona lost his job! :) 1 day ago
- @djseleem Call me tomorrow. 3 days ago
- Google Search Cheat Sheet -- http://www.google.com/help/cheatsheet.html 3 days ago
- Search Google for Recursion and It will suggest Recursion back -- http://bit.ly/biO4Um :D 3 days ago
Tag Archives: python
Twitter Streaming API with Python
Hasin Vai has a good post about collecting tweets in real time with php. Here’s the post: http://hasin.wordpress.com/2009/06/20/collecting-data-from-streaming-api-in-twitter/ If you are a php developer look into there. Well, I am going to cover Python for the Twitter streaming API. You … Continue reading
Tagged python, twitter
3 Comments
Python: Sending a bunch of images as email attachments
Python is just beautiful! In my last post I mentioned how you can setup an email server. Now, here’s the code I use to send a bunch of images as attachments with my outgoing emails. This code snippet was taken … Continue reading
Python: Printing without newline or space :)
While coding in Python, I have seen that the Print statement adds a newline to it’s output which is very helpful in most cases. While I have to add a newline character manually in PHP, I have to type less … Continue reading
Tagged python
3 Comments
Handling Exceptions in PHP and Python
It’s really a very important programming practice to properly handle any possible exceptions… It makes the code more stable, efficient and re-usable. PHP: PHP now has a very good exception handling mechanism. Just put a “try” block and then “catch … Continue reading
Why I like Python more than PHP ?
A friend of mine asked me a few days ago, why I like Python more than PHP given that I am more skilled in PHP than in Python. Well, here is the answer. I like Python because: – On my … Continue reading
Calling a function using string
PHP: In php, you can assign a function name as a string to a variable and call the function by adding “()” after the variable name and appending a semicolon. Like this: function masnun($str) { echo "$str \n"; } $str … Continue reading
Tagged php, python
Leave a comment
Building Command Line Interface using Python
Creating a command line interface with Python is pretty easy Python has a built in module — “cmd” to assist you in building a command line interface of your application. In this example, I have created a dummy shell that … Continue reading
Open Source and Multilingual Eid Greetings from a Programmer :)
Wishing you all a very happy Eid Day PHP: <?php class Eid { function Mubarak() { echo __CLASS__." ".__FUNCTION__; } } $eid = new Eid; $eid->Mubarak(); ?> Python: #!/usr/bin/env python import inspect class Eid: def Mubarak(self): print self.__class__.__name__, … Continue reading
Tagged php, python
3 Comments
HTML and XML Parsing in Python using BeautifulSoup :)
I have been looking for a good library in Python for handling HTML and XML. I knew about BeautifulSoup but never cared about it much. But this time, when I was looking for a way to scrape web sites and … Continue reading
Tagged python
Leave a comment
Creating Dictonaries from Arrays / Lists
PHP: In PHP, we can create a new associative array or dictionary by using the array_combine() function. Just feed two arrays as the parameters to this function and you get back a dictionary. The first array elements are converted into … Continue reading