Python Programming Tutorials

Python Programming Tutorials And Articles
  Title / Author Replies
Views Reverse Sort Order
Introduction There are two basic methods for sending an email with Python. If a mail server is running on the machine where Python is installed, simply open a pipe to the mail server and write the email as a file to that pipe. This is usually done on *nix type systems such as Linux. ...
1
43,796
Python supports a couple of looping constructs. The for statement is most commonly used. It loops over the elements of a sequence, assigning each to the loop variable. If the body of your loop is simple, the interpreter overhead of the for loop itself can be a substantial amount of the overhead....
0
13,226
Earlier today, I had posted a code snippet to print all the CGI environment variables in CGI-Perl. Well, I recently started learning Python too, so thought of doing the same in Python. Checkout the code below. #!/usr/bin/python import sys, os print "Content-Type: text/html\n\n"; ...
0
9,163
HMAC stands for Hash-base Message Authentication Code, it is key based message digest algorithm which can be used for verifying the integrity of the message (i.e. the original message from which the hash is generated) or to verify the authenticity of the sender of the message or both. Nowadays,...
0
7,679
A few years ago, people who wished to study programming as a hobby had an important decision to make: Which programming language would they study for their first? Many people chose to start with BASIC or Pascal, because they were easier. Indeed, those languages are fairly well-suited to...
8
7,163
Python urllib2 library contains functions with enables programmers to access remote URLs by helping out in the operations like HTTP Basic Authentication, cookies, redirects etc. It's Python's equivalent to Perl's LWP or ASP's XMLHttpRequest etc. The library allows you to add HTTP headers to...
0
6,822
Amazon's Simple Queue Service is a highly scalable service to help cloud-based applications use a queuing system which is reliable & scalable. Amazon's queue has it's pros & cons, like the messages may not be received in the order they were queued, and you may receive duplicates, I had written an...
0
6,817
Strings and Lists are 2 important data types in the suite of structured data types in python. Strings and lists are similar, but they are not same and many people donít know the main difference between a string and a list in python. One simple difference between strings and lists is that lists can...
1
5,809
Well, I was trying to use regular expressions in Python. I wrote a small script, so I thought I'll will post it and make it open for discussion. As I learn more I'll keep them posted too, and if anyone has any comments please do let me know. #!/usr/bin/python import re print...
1
5,374
Link Extractor as the name suggests, scrapes all the URLs from a particular webpage. In the following code the extractor can extract relative as well as absolute URL's from a HTML webpage, and outputs them is a more readable and useful format. The Code from BeautifulSoup import...
2
4,211
Signals are a limited form of inter-process communication, it analogous to hardware interrupts. It is generally used by the operating system to notify processes about certain issues/states/errors, like division by zero, etc. In case, you want to know read more about signals read Signal and...
1
3,664
In this tutorial we'll be making a small yet effective application rather code snippet to Lookup Any Username on Facebook. The Code Below Uses the Graph API, The Graph API (as defined by Facebook) is the core of Facebook Platform , It allows reading and Writing access to Facebook. It provides a...
2
3,284
Run length Encoding also known as RLE is probably the most basic encoding method that's being used in different fields of computing like, Multimedia Formats etc. In this tutorial we'll be looking at how RLE works and a basic python example which implements RLE. How does it works Run length...
3
3,224
Internet Message Access Protocol better known as IMAP is one of the most popular & widely used protocols for accessing emails from remote servers, the other one being POP (Post Office Protocol), and almost all modern email clients support both these protocols. IMAP works on TCP/IP stack, and...
0
2,964
Geolocation software/services are used to find the actual geographic location of an IP address, the geographic information may be accurate till city/ZIP code level. Maxmind's GeoIP is one such provider of IP address geographic information, they have both free and paid data subscriptions which...
0
2,932
Sudoku is a logic based number-placement puzzle, The objective of the puzzle is to fill a n * n grid with digits so that :- Each column of the square contains each of the numbers from 1 to n exactly once. Each row of the square contains each of the numbers from 1 to n exactly once. The...
0
2,868
In a previous article Access MySQL Databases in Python few months back, in that I had discussed using MySQLdb python module to access MySQL in Python scripts, though that being easy & good lacked many important features like placeholders/parameterization, lazy execute & fetch, buffering of large...
0
2,702
Image manipulation is an interesting subject, as well almost inevitable in today's websites, you can use it to render CAPTCHA, crop & resize images, convert between image formats and many more advanced functions. Python with it's growing popularity has encouraged the community & enterprises to...
1
2,668
Post Office Protocal version 3 (POP3) is protocol of the TCP/IP stack's application layer, used to fetch email from remote mail servers. POP is one of the most used protocols for email retrieval, other one being IMAP. Virtually every email application, be it in the desktop or mobile supports the...
2
2,638
Being in the era of instant updates & notifications one would at some point or the other would need to parse/format date & time, be it any language. Here, we'll see how we can parse & format date/time with Python. Python is natively equipped with the functions to make our job easier, the...
0
2,604