background preloader


Python Wiki Python Wiki Python is a great object-oriented, interpreted, and interactive programming language. It is often compared (favorably of course ) to Lisp, Tcl, Perl, Ruby, C#, Visual Basic, Visual Fox Pro, Scheme or Java... and it's much more fun. Python combines remarkable power with very clear syntax. Getting Started Events, Courses, Conferences, Community Python Conferences - information about the Python conference scene Python Events - covers conferences, training courses and more Local User Groups - find a Python group near you Participating in the Community - where people using and producing Python get together Python Software Using this Wiki Feel free to add more useful stuff (see HelpContents and HelpOnEditing to learn how), but do us a favour and do tests in the WikiSandBox if you're not accustomed to Wiki technologies. See WikiGuidelines for details of the policies and rules governing this Wiki. See SiteImprovements for a discussion of improvements to this Wiki and other related sites.
Last week, we announced Free Dojo Support to help Dojo developers with their ongoing development efforts and improve the way they were using Dojo. Our First Question Our first question comes from Dojo user Abdullah H. Al-Shaikh who asked: I Have Been Working On Dojo For Quite Some Time Now… But I Can’t Put My Finger On The Proper Way To Start And Then Build A Stable Large Scale Dojo Project. Our Answer: It Depends First things first, we must clearly emphasize a key point in web development: There is no singular, “right” way to build a web application. Thankfully, the Dojo Toolkit, gives you many options to optimize for the specific requirements of your application. Base Assumptions First, to limit the complexity of our answer, we’ll assume that you are: Building an application from JavaScript and Dojo source without any particular server-side framework in mind. The SitePen Approach to building web apps is pragmatic and we use the following guidelines and best practices. Why this structure? What Is The Best Way To Start A Dojo Project? What Is The Best Way To Start A Dojo Project?
Description A Django external database backend for MS SQL Server that uses ODBC by employing the pyodbc library, supports SQL Server 2000 and 2005. Pyodbc seems to be a mature, viable way to access SQL Server from Python in multiple platforms and is actively maintained. Important If you are following Django trunk development and have revision 10026 or newer, the minimal development revision of django-pyodbc trunk you need to use is r157. Also, the DATABASE_ODBC_DRIVER, DATABASE_ODBC_DSN and DATABASE_ODBC_EXTRA_PARAMS settings were migrated to the DATABASE_OPTIONS dictionary setting in this revision. This is a backward-incompatible change for setups that were using at least one of these three settings. SVN trunk development follows closely Django development, so it needs a recent checkout of Django SVN trunk. See our News page. Features Works on Windows and Linux (using FreeTDS) Native Unicode support. Installation Install pyodbc. Configuration See Settings. Testing environments Tested on: Thanks django-pyodbc - MS SQL Server Django DB backend using pyodbc django-pyodbc - MS SQL Server Django DB backend using pyodbc
Floating-point representation Floating-point representation by Carl Burch, Hendrix College, September 2011 Floating-point representation by Carl Burch is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.Based on a work at Contents Representing numbers as integers in a fixed number of bits has some notable limitations. It can't handle numbers that have a fraction, like 3.14, and it isn't suitable for very large numbers that don't fit into 32 bits, like 6.02 × 1023. 1. One possibility for handling numbers with fractional parts is to add bits after the decimal point: The first bit after the decimal point is the halves place, the next bit the quarters place, the next bit the eighths place, and so on. Suppose that we want to represent 1.625(10). So the binary representation of 1.625 would be 1.101(2). The idea of fixed-point representation is to split the bits of the representation between the places to the left of the decimal point and places to the right of the decimal point. 2. 2.1. 2.2.
Python Django Software Development


Python Re Match, Search Examples
How can I make a chain of function decorators in Python?
Improve Your Python: Decorators Explained Improve Your Python: Decorators Explained I've previously written about "yield" and generators. In that article, I mention it's a topic that novices find confusing. The purpose and creation of decorators is another such topic (using them, however, is rather easy). In this post, you'll learn what decorators are, how they're created, and why they're so useful. A Brief Aside... Passing Functions Before we get started, recall that everything in Python is an object that can be treated like a value (e.g. functions, classes, modules). def is_even(value): """Return True if *value* is even.""" return (value % 2) == 0 def count_occurrences(target_list, predicate): """Return the number of times applying the callable *predicate* to a list element returns True.""" return sum([1 for e in target_list if predicate(e)]) my_predicate = is_evenmy_list = [2, 4, 6, 7, 9, 11]result = count_occurrences(my_list, my_predicate)print(result) The magic is in the lines my_predicate = is_even. Hopefully, this is all old hat to you. Returning Functions Raw Power
BeginnersGuide New to programming? Python is free and easy to learn if you know where to start! This guide will help you to get started quickly. Chinese Translation New to Python? Read BeginnersGuide/Overview for a short explanation of what Python is. Getting Python Next, install the Python interpreter on your computer. There are also Python interpreter and IDE bundles available which are meant specifically for beginners. There are currently two major versions of Python available: Python 2 and Python 3. See BeginnersGuide/Download for instructions for downloading the correct version of Python. At some stage, you'll want to edit and save your program code. Learning Python Next, read a tutorial and try some simple experiments with your new Python interpreter. If you've never programmed before, see BeginnersGuide/NonProgrammers for a list of suitable tutorials. Most tutorials assume you know how to run a program on your computer. When you are ready to write your first program you will need a text editor. BeginnersGuide
About - Project Euler
GCSE Computing Python Programming Resources
Writing your first Django app, part 1 Let’s learn by example. Throughout this tutorial, we’ll walk you through the creation of a basic poll application. It’ll consist of two parts: A public site that lets people view polls and vote in them.An admin site that lets you add, change, and delete polls. We’ll assume you have Django installed already. $ python -c "import django; print(django.get_version())" If Django is installed, you should see the version of your installation. This tutorial is written for Django 1.9 and Python 3.4 or later. See How to install Django for advice on how to remove older versions of Django and install a newer one. Where to get help: If you’re having trouble going through this tutorial, please post a message to django-users or drop by #django on to chat with other Django users who might be able to help. Creating a project¶ If this is your first time using Django, you’ll have to take care of some initial setup. $ django-admin startproject mysite Note Where should this code live? These files are: Writing your first Django app, part 1
Virtual Environments virtualenv is a tool to create isolated Python environments. virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need. Basic Usage Create a virtual environment for a project: $ cd my_project_folder $ virtualenv venv virtualenv venv will create a folder in the current directory which will contain the Python executable files, and a copy of the pip library which you can use to install other packages. This creates a copy of Python in whichever directory you ran the command in, placing it in a folder named venv. You can also use a Python interpreter of your choice. $ virtualenv -p /usr/bin/python2.7 venv This will use the Python interpreter in /usr/bin/python2.7 To begin using the virtual environment, it needs to be activated: $ source venv/bin/activate The name of the current virtual environment will now appear on the left of the prompt (e.g. Install packages as usual, for example: Other Notes $ pip freeze > requirements.txt Virtual Environments
¿Cómo funciona Internet? | Django Girls Tutorial ¿Cómo funciona Internet? | Django Girls Tutorial Este capitulo está inspirado por la charla "How the Internet works" de Jessica McKellar ( Apostamos que utilizas Internet todos los días. Pero, ¿sabes lo que pasa cuando escribes una dirección como en tu navegador y presionas 'Enter'? Lo primero que tienes que entender es que un sitio web es sólo un montón de archivos guardados en un disco duro. Al igual que tus películas, música o fotos. Si no estás familiarizada con la programación, puede ser difícil de captar HTML al principio, pero tus navegadores web (como Chrome, Safari, Firefox, etc.) lo aman. Como cualquier otro archivo, tenemos que guardar los archivos HTML en algún lugar de un disco duro. Ok, quizás te preguntes cómo luce Internet, ¿cierto? ¡Te hemos hecho una imagen! Parece un lío, ¿no? Es fascinante, ¿no? Se parece a esto: Tu carta va hacia la oficina de correo más cercana. Sí, es tan simple como eso. Basta de charlas, ¡pongamos manos a la obra!
The Django admin site The Django admin site One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin’s recommended use is limited to an organization’s internal management tool. It’s not intended for building your entire front end around. The admin has many hooks for customization, but beware of trying to use those hooks exclusively. If you need to provide a more process-centric interface that abstracts away the implementation details of database tables and fields, then it’s probably time to write your own views. In this document we discuss how to activate, use, and customize Django’s admin interface. Overview¶ The admin is enabled in the default project template used by startproject. For reference, here are the requirements: After you’ve taken these steps, you’ll be able to use your Django admin site by visiting the URL you hooked it into (/admin/, by default). Other topics¶
Dominio | Django Girls Tutorial PythonAnywhere te ha dado un dominio gratuito, pero tal vez no quieras tener "" al final de la URL de tu blog. Quizás quiera que tu blog viva en "" o "" o "" o "", o lo que quieras que sea. Aquí hablaremos brevemente sobre cómo obtener un dominio y veremos cómo vincularlo a tu aplicación web en PythonAnywhere. Sin embargo, deberías saber que la mayoría de los dominios son pagos, y PythonAnywhere te cobrará un valor adicional para usar tu propio nombre de dominio -- no es demasiado dinero en total, pero es probablemente algo que quieras hacer sólo si estás muy comprometida con la causa. ¿Donde registrar un dominio? Un dominio típico cuesta alrededor de 15 dólares estadounidenses anuales. Nuestra opción favorita es I want my name. Cómo apuntar tu dominio a PythonAnywhere Ahora necesitas encontrar este formulario: Cuando seas redirigida a la pestaña web.

Online Python Tutor - Learn programming by visualizing code execution
Python programming

For Beginners Welcome! Are you completely new to programming? If not then we presume you will be looking for information about why and how to get started with Python. Installing Python is generally easy, and nowadays many Linux and UNIX distributions include a recent Python. If you want to know whether a particular application, or a library with particular functionality, is available in Python there are a number of possible sources of information. If you have a question, it's a good idea to try the FAQ, which answers the most commonly asked questions about Python. If you want to help to develop Python, take a look at the developer area for further information.
Good code in Python

In this interactive tutorial, we'll cover many essential Python idioms and techniques in depth, adding immediately useful tools to your belt. There are 3 versions of this presentation: ©2006-2008, licensed under a Creative Commons Attribution/Share-Alike (BY-SA) license. My credentials: I am a resident of Montreal,father of two great kids, husband of one special woman,a full-time Python programmer,author of the Docutils project and reStructuredText,an editor of the Python Enhancement Proposals (or PEPs),an organizer of PyCon 2007, and chair of PyCon 2008,a member of the Python Software Foundation,a Director of the Foundation for the past year, and its Secretary. In the tutorial I presented at PyCon 2006 (called Text & Data Processing), I was surprised at the reaction to some techniques I used that I had thought were common knowledge. Many of you will have seen some of these techniques and idioms before. These are the guiding principles of Python, but are open to interpretation. import this Code Like a Pythonista: Idiomatic Python
Python Module Import: Single-line vs Multi-line
Idiomatic Python: EAFP versus LBYL | Python Engineering at Microsoft One idiomatic practice in Python that often surprises people coming from programming languages where exceptions are considered, well, exceptional, is EAFP: “it’s easier to ask for forgiveness than permission”. Quickly, EAFP means that you should just do what you expect to work and if an exception might be thrown from the operation then catch it and deal with that fact. What people are traditionally used to is LBYL: “look before you leap”. Compared to EAFP, LBYL is when you first check whether something will succeed and only proceed if you know it will work. If this all doesn’t make sense from the prose alone, don’t worry as code will make this obvious. if "key" in dict_: value += dict_["key"] This prevents a KeyError exception from being raised which seems logical. But what if the key is typically in the dictionary or shouldn’t be considered in any way exceptional? try: value += dict_["key"] except KeyError: pass Reading this code, what does it tell you?
GitHub - ebranca/owasp-pysec: OWASP Python Security Project
Please join the project's mailing lists to keep up-to-date with what's going on, and to contribute your ideas, feedback, and experience: General project Technical Roadmap Technical Roadmap or TODO on github General Roadmap - Set up website with wiki - Configure mailing list - Configure github account and create code structure - Create Project presentation and pamphlet - Publish initial batch of documents on python security issues and possible mitigations with code examples - Create python secure coding area - Introduce project to OWASP Chapters - Publish initial version of python secure coding manual - Publish hardened version of python coded for security purposes - Document usage of code security policies and call whitelisting - Document usage of message deduplication and data storage in hash rings - Document usage of ESAPI-extended security checks, including but not limited to controls applied to python internal calls, strings, processes, permissions, and low level kernel calls OWASP Python Security Project
Download Anaconda now! | Continuum
Python « Steve Byrnes's Homepage
Python quant

Clues & Hints
python code in ahk script
python code in ahk code
Python 3

Python Properties
Jupyter and the future of IPython — IPython
Requests: HTTP for Humans — Requests 2.10.0 documentation
MIT - A Gentle Introduction to Python
Learn Python The Hard Way

Introduction to the python ipaddress module | Coding Networker Blog
Tutorial 1: IP Addresses, Subnets and Ranges — netaddr 0.7.19 documentation
GitHub - autocracy/python-ipy: IPy are a Python class and tools for handling of IPv4 and IPv6 addresses and networks. It is similar to Net::IP Perl module.

Python for Scientific Computing

Python Libs

Python & VIM Resources

Langage python