Python

From Easy Develop
Jump to: navigation, search

Contents

[edit] Getting Started with Python

Create files with appropriate access permissions

touch hello.py
sudo chmod +x hello.py

File content

#!/usr/bin/python
# -*- coding: utf-8 -*-
print 'hello world!'

run python script:

./hello.py

or

python hello.py


[edit] Install

[edit] Install python packages

sudo apt-get install python-setuptools
sudo easy_install <PACKAGE_NAME>

[edit] Tools:

  • pip - A tool for installing and managing Python packages.
  • virtualenv - A tool to create isolated Python environments.
  • selenium - Web Browser Automation


[edit] Libs:


[edit] IDE:



Правила написания питон кода:

  1. использовать именованные аргументы в функциях


Redis
unittest
virtualenv
easy_install
python_libs
python_update
python_install
python_modules


[edit] TIPS:

[edit] Check type in python

type(obj) is str

http://stackoverflow.com/questions/152580/whats-the-canonical-way-to-check-for-type-in-python


[edit] Faqs:

q: How to get function name python from the inside function?


[edit] Examples:

[edit] links:

[edit] См. также

Personal tools
Namespaces

Variants
Actions
Language
RDBMS
Text editor
MY PROJECTS
other
Toolbox