background preloader

Python

Facebook Twitter

Free Online IDE and Terminal. Www.catonmat. One of the upcoming projects I am doing (I will reveal it in one of the next blog posts.) is going to be written entirely in Python.

www.catonmat

I have a good understanding of Python but, same as I had with JavaScript, I have little experience doing projects from the ground up in it. Update: the project was redditriver.com, read designing redditriver.com (includes full source code). Before diving into the project I decided to take a look at a few Python video lectures to learn language idioms and features which I might have not heard of. 2. Built-in Functions. Open a file, returning an object of the file type described in section File Objects.

2. Built-in Functions

If the file cannot be opened, IOError is raised. When opening a file, it’s preferable to use open() instead of invoking the file constructor directly. The first two arguments are the same as for stdio‘s fopen(): name is the file name to be opened, and mode is a string indicating how the file is to be opened. The most commonly-used values of mode are 'r' for reading, 'w' for writing (truncating the file if it already exists), and 'a' for appending (which on some Unix systems means that all writes append to the end of the file regardless of the current seek position).

If mode is omitted, it defaults to 'r'. The optional buffering argument specifies the file’s desired buffer size: 0 means unbuffered, 1 means line buffered, any other positive value means use a buffer of (approximately) that size (in bytes). In addition to the standard fopen() values mode may be 'U' or 'rU'. MIT - A Gentle Introduction to Python. Python Web Development: Understanding Django for Beginners.

Learn Python The Hard Way. This exercise has no code.

Learn Python The Hard Way

It is simply the exercise you complete to get your computer to run Python. You should follow these instructions as exactly as possible. For example, Mac OS X computers already have Python 2, so do not install Python 3 (or any Python). Go to with your browser, get the Notepad++ text editor, and install it. You do not need to be the administrator to do this.Make sure you can get to Notepad++ easily by putting it on your desktop and/or in Quick Launch.

From now on, when I say "Terminal" or "shell" I mean PowerShell and that's what you should use. Warning Sometimes you install Python on Windows and it doesn't configure the path correctly. > python ActivePython 2.6.5.12 (ActiveState Software Inc.) based on Python 2.6.5 (r265:79063, Mar 20 2010, 14:22:52) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> quit()> mkdir mystuff > cd mystuff ... How to Build a Crawler in Python. Short Bytes: Web crawler is a program that browses the Internet (World Wide Web) in a predetermined, configurable and automated manner and performs given action on crawled content.

How to Build a Crawler in Python

Search engines like Google and Yahoo use spidering as a means of providing up-to-date data. Webhose.io, a company which provides direct access to live data from hundreds of thousands of forums, news and blogs, on Aug 12, 2015, posted the articles describing a tiny, multi-threaded web crawler written in python. This python web crawler is capable of crawling the entire web for you. Ran Geva, the author of this tiny python web crawler says that: I wrote as “Dirty”, “Iffy”, “Bad”, “Not very good”. The python based multi-threaded crawler is pretty simple and very fast. Save the above code with some name lets say “myPythonCrawler.py”. Cheatsheet - Python & R codes for common Machine Learning Algorithms.

In his famous book – Think and Grow Rich, Napolean Hill narrates story of Darby, who after digging for a gold vein for a few years walks away from it when he was three feet away from it!

Cheatsheet - Python & R codes for common Machine Learning Algorithms

Now, I don’t know whether the story is true or false. But, I surely know of a few Data Darby around me. These people understand the purpose of machine learning, its execution and use just a set 2 – 3 algorithms on whatever problem they are working on. They don’t update themselves with better algorithms or techniques, because they are too tough or they are time consuming. Like Darby, they are surely missing from a lot of action after reaching this close! Today’s cheat sheet aims to change a few Data Darby’s to machine learning advocates. For the super lazy Data Darbies, we will make your life even easier.

Keep this cheat sheet handy when you work on data sets. download the complete cheat sheet here: PDF Version Related Year in Review: Best of Analytics Vidhya from 2015 December 28, 2015 August 10, 2015.