background preloader

The Hitchhiker’s Guide to Python!

The Hitchhiker’s Guide to Python!
Greetings, Earthling! Welcome to The Hitchhiker’s Guide to Python. This is a living, breathing guide. This handcrafted guide exists to provide both novice and expert Python developers a best practice handbook to the installation, configuration, and usage of Python on a daily basis. This guide is opinionated in a way that is almost, but not quite, entirely unlike Python’s official documentation. Let’s get started! Getting Started with Python New to Python? Properly Install Python Writing Great Python Code This part of the guide focuses on the best-practices for writing Python code. Scenario Guide for Python Applications This part of the guide focuses on tool and module advice based on different scenarios. Shipping Great Python Code This part of the guide focuses on deploying your Python code. Python Development Environments This part of the guide focus on the Python development environment, and the best-practice tools that are available for writing Python code. Additional Notes Note Related:  Python

OverAPI.com | Collecting all the cheat sheets Twisted Twisted is an event-driven networking engine written in Python and licensed under the open source ​MIT license. Twisted runs on Python 2 and an ever growing subset also works with Python 3. Twisted makes it easy to implement custom network applications. from twisted.internet import protocol, reactor, endpoints class Echo(protocol.Protocol): def dataReceived(self, data): self.transport.write(data) class EchoFactory(protocol.Factory): def buildProtocol(self, addr): return Echo() endpoints.serverFromString(reactor, "tcp:1234").listen(EchoFactory()) reactor.run() Learn more about ​writing servers, ​writing clients and the ​core networking libraries , including support for SSL, UDP, scheduled events, unit testing infrastructure, and much more. Twisted includes an event-driven web server. Learn more about ​web application development, ​templates and Twisted's ​HTTP client. Here's a simple publish/subscribe server, where clients see all messages posted by other clients:

5 Reasons Why Python Is a Great First Programming Language - Mikke Goes Coding Choosing your first programming language can be a difficult decision to make. You’ll be spending a lot of time with it and it’s not always just a walk in the park along the way. There are plenty of suitable languages for a beginner with enough resources online alone for learning pretty much any language out there. For me, Python was the first language I became acquainted with. — See also: How to Choose Your First Programming Language Python is administered by the non-profit Python Software Foundation. Python was first released in 1991. Are you just getting started with coding? Please note that some of the links below are affiliate links, meaning that if you choose to buy a product using them, at no extra cost to you I will receive a small commission for referring you to cover the costs from running this website. Why Python Is a Great First Programming Language First off: everything you need for writing Python is free and available online! Let’s get started! 1. >>>import this 2. 3. 4. 5.

Grunt: The JavaScript Task Runner PythonBooks - Learn Python the easy way ! Homepage | Celery: Distributed Task Queue First steps — pygal 2.0.0 documentation Caution First you need to install pygal, see installing. When it’s done, you are ready to make your first chart: import pygal # First import pygalbar_chart = pygal.Bar() # Then create a bar graph objectbar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]) # Add some valuesbar_chart.render_to_file('bar_chart.svg') # Save the svg to a file Now you should have a svg file called bar_chart.svg in your current directory. You can open it with various programs such as your web browser, inkscape or any svg compatible viewer. The resulting chart will be tho following: bar_chart = pygal.Bar()bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55])bar_chart.render() pygal relies on svg css styling. To make a multiple series graph just add another one: bar_chart = pygal.Bar()bar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55])bar_chart.add('Padovan', [1, 1, 1, 2, 2, 3, 4, 5, 7, 9, 12])bar_chart.render() If you want to stack them, use StackedBar instead of Bar:

Environment Variables There are a handful of environment variables that you can set that will have an effect on your ability to compile software. These are: For compiling C code: CC, CFLAGS For compiling C++ code: CXX, CPPFLAGS For the linking stage: LDFLAGS For compiling any code: TMPDIR After the code is compiled: LD_LIBRARY_PATH export CC CFLAGS CXX CPPFLAGS TMPDIR LDFLAGS LD_LIBRARY_PATH You don't have to set environment variables for GCC to use them. . There is one more option to passing variables to gcc and that's to use the variable CONFIG_SITE. Let's take a look at what each of these do: CC=gcc, tells configure that your C Compiler (CC) is gcc. CC=/usr/sfw/bin/gcc CFLAGS=-O3 (oh three), tells configure that you want the compiler to use the following optimization flag. If you are currently running SPARC hardware it is strongly suggested that you set at least -mv8 so GCC can use some hardware registers that it otherwise would not be able to use. CFLAGS=-I/usr/local/include LDFLAGS="-L/usr/sfw/lib -R/usr/sfw/lib"

PHP: The Right Way alyssa frazee Thu 02 January 2014 | -- (permalink) My sister is a senior undergraduate majoring in sociology. She just landed an awesome analyst job for next semester and was told she'll be using some R in the course of her work. She asked me to show her the ropes during winter vacation, and of course I said yes! What better way to while away the days of a Minnesota winter?! One catch: the day we planned to work, it turned out we only had an hour of overlapping free time. Challenge accepted. (1) download R and RStudio I'm impressed that RStudio is both accessible/helpful for beginners and useful for experts. (2) console and script The first thing we did after getting set up was type two lines into the console: It wasn't exactly "hello world", but it illustrated some concepts like "assignment" and "variables" and "evaluation"2. The next thing I had my sister do was save those two lines of code in an R script. (3) comments # COMMENTS ARE SUPER IMPORTANT so we learned about them (4) graphics (5) getting help

python - How to merge two dictionaries in a single expression? How gzip compression works - Make the Web Faster Authors: Kevin Khaw & Eric Higgins, Google Webmasters Recommended experience: Working knowledge of HTTP and HTML High level overview of a browser request with and without gzip compression Server without gzip: Browser: Connects to server and requests page.Server that browser supports gzip "Accept-Encoding: gzip".Server:No gzip support. Server with gzip: Connects to server.Notifies server that browser supports gzip "Accept-Encoding: gzip".Server:Acknowledges gzip support.Sends gzip encoded page with header "Content-Encoding: gzip".Browser:Receive page.Decode gzip encoded page based on header "Content-Encoding: gzip".Display page. How gzip compresses Simply put, gzip compression works by finding similar strings within a text file, and replacing those strings temporarily to make the overall file size smaller. Example In this example, I'll demonstrate how using identical tags will compress a snippet of code further than using different tags. Uncompressed: 69 bytes Compressed: 85 bytes

AppCoda Community - Learn iOS Programming and Build iPhone App Open Source Finance 1. QuantLib - An Interview with Luigi Ballabio This is the first in a new series of interviews with leading developers involved in open source financial software. In the first interview I talk to Luigi Ballabio about QuantLib, a free software framework for Quantitative Finance which he has been involved with since it's original launch in the year 2000. Luigi currently participates in the design, maintenance and development of the core C++ library for QuantLib, including the review and management of the contributions from users. In his day job, Luigi is Senior Quantitative Developer at StatPro Italia where he designs and implements the C++ financial libraries used in the StatPro Risk Management (SRM) and Complex Asset Pricing (CAP) applications. In this interview, Luigi also talks about his 3-day training course, Introduction to QuantLib Development, which is next due to take place in London, 22-24th September 2014 and costs £1900 per person + VAT. JB: And how did QuantLib come about originally? LB: I think so. LB: Yes.

Related: