background preloader

Our Documentation

Our Documentation
Notice: While Javascript is not essential for this website, your interaction with the content will be limited. Please turn Javascript on for the full experience. Beginner Moderate Advanced General Python 3.x Resources Python 2.x Resources Can’t find what you’re looking for? >>> Python Needs You Open source software is made better when users can easily contribute code and documentation to fix bugs and add features. Contribute to Python Bug Tracker

Python: вещи, которых вы могли не знать Python — красивый и местами загадочный язык. И даже зная его весьма неплохо, рано или поздно находишь для себя нечто такое, что раньше не использовал. Этот пост отражает некоторые детали языка, на которые многие не обращают внимание. >>> a = [1, 2, 3, 4] >>> a.append(a) >>> a [1, 2, 3, 4, [...]] >>> a[4] [1, 2, 3, 4, [...]] >>> a[4][4][4][4][4][4][4][4][4][4] == a True То же самое со словарями: 2. >>> l = [[1, 2, 3], [4, 5], [6], [7, 8, 9]] >>> sum(l, []) [1, 2, 3, 4, 5, 6, 7, 8, 9] Генератором списков (спасибоmagic4x): [y for x in data for y in x] Альтернативные, но более длинные варианты (спасибоmonolithed): import itertools data = [[1, 2, 3], [4, 5, 6]] list(itertools.chain.from_iterable(data)) from functools import reduce from operator import add data = [[1, 2, 3], [4, 5, 6]] reduce(add, data) 3. Многие знают про генератор списков, а как насчет генераторов словарей? 4. class foo: def normal_call(self): print("normal_call") def call(self): print("first_call") self.call = self.normal_call 5.

Visual C# C# (pronounced "C sharp") is a programming language that is designed for building a variety of applications that run on the .NET Framework. C# is simple, powerful, type-safe, and object-oriented. The many innovations in C# enable rapid application development while retaining the expressiveness and elegance of C-style languages. Visual C# is an implementation of the C# language by Microsoft. Getting Started with Visual C# Introduces the features of C# for programmers who are new to the language or are new to Visual Studio, and provides a roadmap for finding Help about Visual Studio. Using the Visual C# Development Environment Introduces the Visual C# development environment. C# Programming Guide Provides information and practical examples about how to use C# language constructs. C# Reference Provides detailed reference information about C# programming concepts, keywords, types, operators, attributes, preprocessor directives, compiler switches, compiler errors, and compiler warnings.

matplotlib: python plotting — Matplotlib 1.2.1 documentation Tutorial — python-igraph v0.6 documentation This chapter contains a short overview of igraph‘s capabilities. It is highly recommended to read it at least once if you are new to igraph. I assume that you have already installed igraph; if you did not, see Installing igraph first. Familiarity with the Python language is also assumed; if this is the first time you are trying to use Python, there are many good Python tutorials on the Internet to get you started. Mark Pilgrim’s Dive Into Python is one that I personally suggest. If this is the first time you ever try to use a programming language, A Byte of Python is even better. Starting igraph igraph is a Python module, hence it can be imported exactly the same way as any other ordinary Python module at the Python prompt: $ python Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import igraph >>> import igraph>>> print igraph. Creating a graph from scratch Warning Note

Perl <div class="noscript"><p><strong>Please note: Many features of this site require JavaScript. You appear to have JavaScript disabled, or are running a non-JavaScript capable web browser.</strong></p><p> To get the best experience, please enable JavaScript or download a modern web browser such as <a href=" Explorer 8</a>, <a href=" <a href=" or <a href=" Chrome</a>. </p></div> perl - The Perl 5 language interpreter perl [ -sTtuUWX ] [ -hv ] [ -V[:configvar] ] [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ] [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ] [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ] [ -C [number/list] ] [ -S ] [ -x[dir] ] [ -i[extension] ] [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]... Overview Tutorials Miscellaneous

Профилирование и отладка Python, отладка / Блог компании Mail.Ru Group В предыдущей статье мы закончили разговор о профилировании обзором событийных профайлеров. Сегодня я предлагаю рассмотреть методы отладки программ. Введение и теория — зачем вообще нужно профилирование, различные подходы, инструменты и отличия между нимиРучное и статистическое профилирование — переходим к практикеСобытийное профилирование — инструменты и их применениеОтладка — что делать, когда ничего не работает Прежде, чем начинать разговор об отладке, нам нужно определиться, что же это такое. По традиции, обратимся к Википедии: «Отладка — обнаружение, локализация и устранение ошибок». Вообще, для успешной отладки программы, нам необходимо (но не всегда достаточно) две вещи: значение переменных в том месте программы, в котором произошла ошибка, а так же стектрейс: порядок вызова функций, вплоть до ошибочной. Классика жанра Сюда же относится запись всей нужной для отладки программы информации в лог-файл. The Python Debugger Python имеет встроенный отладчик: модуль pdb. IPython pdb или так:

HTML 5 Reference It is useful to make a distinction between the vocabulary of an HTML document—the elements and attributes, and their meanings—and the syntax in which it is written. HTML has a defined set of elements and attributes which can be used in a document; each designed for a specific purpose with their own meaning. Consider this set of elements to be analogous to the list of words in a dictionary. This includes elements for headings, paragraphs, lists, tables, links, form controls and many other features. This is the vocabulary of HTML. Similarly, just as natural languages have grammatical rules for how different words can be used, HTML has rules for where and how each element and attribute can be used. The basic structure of elements in an HTML document is a tree structure. 3.1 Syntactic Overview There are two syntaxes that can be used: the traditional HTML syntax, and the XHTML syntax. The HTML syntax is loosely based upon the older, though very widely used syntax from HTML 4.01. <! tag name

Python Programming Language – Official Website Pearltrees Visualizes How You Organize the Web This post is part of Mashable's Spark of Genius series, which highlights a unique feature of startups. If you would like to have your startup considered for inclusion, please see the details here. The series is made possible by Microsoft BizSpark. Name: Pearltrees Quick Pitch: Pearltrees is a new visual way to organize content on the Web and connecting people's interests. Genius Idea: How do you organize the web on the browser? Signing up for Pearltrees is simple, but getting used to the interface and all of its features is not as easy. Now for the organization part: you can create complex systems of pearls, known as pearltrees. Clicking on a pearl gives you a range of options that go beyond visiting your favorite website. Pearltrees takes a time investment to make it useful. Spark of Genius Series Sponsored by Microsoft BizSpark Entrepreneurs can take advantage of the Azure Services platform for their website hosting and storage needs.

C++ This website uses cookies. By continuing, you give permission to deploy cookies, as detailed in our privacy policy. ok Search: Not logged in C++ Language These tutorials explain the C++ language from its basics up to the newest features introduced by C++11. Introduction Compilers Basics of C++ Program structure Compound data types Classes Other language features C++ Standard Library Input/Output with files Tutorials C++ LanguageAscii CodesBoolean OperationsNumerical Bases C++ Language Introduction:CompilersBasics of C++:Program structure:Compound data types:Classes:Other language features:Standard library:Input/output with files PyExecJS 1.1.0 Run JavaScript code from Python PyExecJS Run JavaScript code from Python. PyExecJS is a porting of ExecJS from Ruby. PyExecJS automatically picks the best runtime available to evaluate your JavaScript program, then returns the result to you as a Python object. A short example: >>> import execjs >>> execjs.eval("'red yellow blue'.split(' ')") ['red', 'yellow', 'blue'] >>> ctx = execjs.compile(""" ... function add(x, y) { ... return x + y; ... } ... """) >>> ctx.call("add", 1, 2) 3 Of course, you can pick particular JavaScript runtime by get() function: >>> default = execjs.get() # the automatically picked runtime >>> default.eval("1 + 2") 3 >>> jscript = execjs.get("JScript") >>> jscript.eval("1 + 2") 3 >>> node = execjs.get("Node") >>> node.eval("1 + 2") 3 If EXECJS_RUNTIME environment variable is specified, PyExecJS pick the JavaScript runtime as a default: PyExecJS supports these runtimes: Installation $ pip install PyExecJS or $ easy_install PyExecJS License Copyright (c) 2012 Omoto Kenji. Changes

Related: