пятница, 24 мая 2013 г.

RMAN Compatibility Table

RMAN Compatibility Table
 
Target/Auxiliary Database RMAN client Recovery Catalog Database Recovery Catalog Schema
8.0.6
8.0.6
>=8.1.7
>=8.0.6
8.1.7
8.0.6.1
>=8.1.7
>=8.1.7
8.1.7
8.1.7
>=8.1.7
>=RMAN client
8.1.7.4
8.1.7.4
>=8.1.7
8.1.7.4
8.1.7.4
8.1.7.4
>=8.1.7
>= 9.0.1.4
9.0.1
9.0.1
>=8.1.7
>= RMAN client
9.2.0
>=9.0.1.3 and <= target database executable
>=8.1.7
>= RMAN client
10.1.0
>=9.0.1.3 and <= target database executable
>=9.0.1
>= RMAN client
10.2.0
>=9.0.1.3 and <= target database executable
>=9.0.1
>= RMAN client
11.1.0
>=9.0.1.3 and <= target database executable
>=10.2.0.3
>= RMAN client
11.2.0
>=9.0.1.3 and <= target database executable
>=10.2.0.3
>= RMAN client

Deprecated RMAN Syntax

Deprecated RMAN Syntax
 
Deprecated in Release Deprecated Syntax Preferred Current Syntax
11.2.0
CONFIGURE or SET COMPRESSION ALGORITHM 'ZLIB'
CONFIGURE or SET COMPRESSION ALGORITHM 'MEDIUM'
11.2.0
CONFIGURE or SET COMPRESSION ALGORITHM 'BZIP2'
CONFIGURE or SET COMPRESSION ALGORITHM 'BASIC'
11.2.0
V$FLASH_RECOVERY_AREA_USAGE
V$RECOVERY_AREA_USAGE
11.1.0
CONVERT ON TARGET PLATFORM
CONVERT ON DESTINATION PLATFORM
11.1.0
UNTIL RESTORE POINT
TO RESTORE POINT
11.1.0
BACKUP ... AS STANDBY
n/a
11.1.0
... KEEP [LOGS | NOLOGS]
... KEEP
11.1.0
BLOCKRECOVER
RECOVER
10.0.1
BACKUP ... INCREMENTAL LEVEL [2,3,4]
Levels other than 0 and 1 are deprecated.
10.0.1
BACKUP ... PARMS
CONFIGURE CHANNEL ... PARMS
10.0.1
COPY
BACKUP AS COPY
10.0.1
CREATE CATALOG TABLESPACE
CREATE CATALOG
10.0.1
LIST ... BY BACKUP [SUMMARY]
n/a
10.0.1
LIST ... VERBOSE
n/a
10.0.1
RESTORE ... PARMS
CONFIGURE CHANNEL ... PARMS
10.0.1
SEND ... PARMS
CONFIGURE CHANNEL ... PARMS
9.2
REPLICATE
RESTORE CONTROLFILE FROM ...
9.2
SET AUTOLOCATE
Enabled by default
9.0.1
ALLOCATE CHANNEL FOR DELETE
n/a
9.0.1
ALLOCATE CHANNEL ... TYPE
CONFIGURE CHANNEL ... DEVICE TYPE
9.0.1
ALLOCATE CHANNEL ... KBYTES
CONFIGURE CHANNEL ... MAXPIECESIZE
9.0.1
ALLOCATE CHANNEL ... READRATE
CONFIGURE CHANNEL ... RATE
9.0.1
... ARCHIVELOG ... LOGSEQ
... ARCHIVELOG ... SEQUENCE
9.0.1
BACKUP ... SETSIZE
BACKUP ... MAXSETSIZE
9.0.1
CHANGE ... CROSSCHECK
CROSSCHECK
9.0.1
CHANGE ... DELETE
DELETE
9.0.1
REPORT ... AT LOGSEQ
REPORT ... AT SEQUENCE
9.0.1
SET AUXNAME
CONFIGURE AUXNAME
9.0.1
SET DUPLEX
SET BACKUP COPIES
CONFIGURE BACKUP COPIES
9.0.1
SET LIMIT CHANNEL ...
ALLOCATE CHANNEL ...
CONFIGURE CHANNEL ...
9.0.1
SET SNAPSHOT
CONFIGURE SNAPSHOT
9.0.1
UNTIL LOGSEQ (see untilClause)
UNTIL SEQUENCE (see untilClause)
8.1.7
CONFIGURE COMPATIBLE
n/a
8.1.5
ALLOCATE CHANNEL CLONE
CONFIGURE AUXILIARY CHANNEL
8.1.5
CHANGE ... VALIDATE
CROSSCHECK
8.1.5
CLONE (see RMAN)
AUXILIARY (see RMAN)
8.1.5
CONFIGURE CLONE
CONFIGURE AUXILIARY
8.1.5
MSGLOG (see RMAN)
LOG (see RMAN)
8.1.5
RCVCAT (see RMAN)
CATALOG (see RMAN)


rman backup for recover of copy

$more ~/bin/pkg/rman_backup/body.sh

#!/bin/bash


#
# Check Parameters:
#

# Package Name:
tmp_string="`dirname $0`"
pkg_name="`basename ${tmp_string}`"

if [ "${pkg_name}" = "." ]; then
  tmp_string="`pwd`"
  pkg_name="`basename ${tmp_string}`"
fi

# Check for internal call:
if [ ! $1 = '_run' ]; then
  echo "`date +%Y.%m.%d" "%H:%M:%S` - ${pkg_name}: Error! (Parameter=1) Call `basename $0` from ./_run.sh" >&2
  exit 2
fi


# Check For :
if [ $2 ]
then
  echo " 2=${2} (ORACLE_SID)"
  ORACLE_SID=`echo ${2} | tr "[A-Z]" "[a-z]"`; export ORACLE_SID
else
  echo "`date +%Y.%m.%d" "%H:%M:%S` - ${pkg_name}: Error! (Parameter=2) Call `basename $0` With 2-d parameter" >&2
  exit 2
fi


#
# Define local variables:
#

# Variables:

prefix="${COMPANY_NAME}#${HOST_NAME}(${ORACLE_SID}) ${pkg_name}"
mess_theme="${prefix}:Rman backup"
log_file=${TMP_DIR}/${pkg_name}_${ORACLE_SID}.log


mail_recipients="$MAIL_DBA"
echo $mail_recipients

start_secs=$(/usr/xpg4/bin/awk 'BEGIN{srand();print srand()}')
begin_backup="`date +%Y.%m.%d" "%H:%M:%S`"

sqlplus '/ as sysdba' << EOF > /dev/null
alter database backup controlfile to trace as '$RMAN_BKP/$ORACLE_SID/oradata/ctrl_trace_${ORACLE_SID}' reuse;
create pfile='$RMAN_BKP/$ORACLE_SID/oradata/init${ORACLE_SID}.bkp' from spfile;
exit;
EOF

$UTL_RMAN target / catalog 'rman/pwd@catdb.sun.com'  cmdfile ${BIN_DIR}/_sql/backup.rman  log=${log_file}

finish_secs=$(/usr/xpg4/bin/awk 'BEGIN{srand();print srand()}')
end_backup="`date +%Y.%m.%d" "%H:%M:%S`"

let diff_secs=($finish_secs - $start_secs)

let days=$diff_secs/86400
let remainder=$diff_secs%86400
let hours=$remainder/3600
let remainder=$remainder%3600
let minutes=$remainder/60
let seconds=$remainder%60

size=$(du -sh /u09/backups/oradb/rman/testdb/oradata/ | awk '{print $1}')
echo "Begin backup:     $begin_backup" >> ${log_file}
echo "End backup:       $end_backup" >> ${log_file}
echo "Duration: Days = $days, Hours = $hours, Minutes = $minutes, Seconds = $seconds" >>${log_file}
echo "Size:             $size" >>${log_file}

cat  ${log_file}  | ${BIN_DIR}/_lib/utl_send.sh "${mess_theme}" "${mail_recipients}"
$



$more ~/bin/_sql/backup.rman

# Clear Parameters:
CONFIGURE RETENTION POLICY CLEAR;
CONFIGURE BACKUP OPTIMIZATION CLEAR;
CONFIGURE DEFAULT DEVICE TYPE CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT CLEAR;
CONFIGURE DEVICE TYPE DISK CLEAR;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK CLEAR;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT  CLEAR;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK CLEAR;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT CLEAR;
CONFIGURE ARCHIVELOG DELETION POLICY CLEAR;
CONFIGURE CHANNEL DEVICE TYPE DISK CLEAR;
CONFIGURE CHANNEL DEVICE TYPE SBT CLEAR;
CONFIGURE MAXSETSIZE CLEAR;
CONFIGURE SNAPSHOT CONTROLFILE NAME CLEAR;

CONFIGURE ENCRYPTION FOR DATABASE CLEAR;
CONFIGURE ENCRYPTION ALGORITHM CLEAR;
CONFIGURE COMPRESSION ALGORITHM CLEAR;

CONFIGURE DB_UNIQUE_NAME TESTDB_P CLEAR;
CONFIGURE DB_UNIQUE_NAME TESTDB_S CLEAR;


# Configure Parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '$RMAN_BKP/$ORACLE_SID/oradata/%d-%F';
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '$RMAN_BKP/$ORACLE_SID/oradata/db_%d_%s_%p_%t';
CONFIGURE DEVICE TYPE DISK PARALLELISM 4 BACKUP TYPE TO BACKUPSET;

CONFIGURE DB_UNIQUE_NAME TESTDB_P CONNECT IDENTIFIER 'testdb_p.sun.com';
CONFIGURE DB_UNIQUE_NAME TESTDB_S CONNECT IDENTIFIER 'testdb_s.sun.com';

#CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;

CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY FOR DB_UNIQUE_NAME TESTDB_P;  # For Catalog Only
CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY FOR DB_UNIQUE_NAME TESTDB_S;  # For Catalog Only

show all;

crosscheck backup;
crosscheck copy;
crosscheck archivelog all;
CROSSCHECK BACKUP OF CONTROLFILE;
CROSSCHECK BACKUP OF SPFILE;
delete noprompt expired backup;
delete noprompt expired copy;
delete noprompt expired archivelog all;


run
{
   backup incremental level 1 for recover of copy with tag 'incr_backup_testdb' database;
   recover copy of database with tag 'incr_backup_testdb';
}

run
{
 backup archivelog all not backed up;
}

run
{
 crosscheck backup;
 crosscheck copy;
 delete noprompt expired backup;
 delete noprompt expired copy;
 delete noprompt obsolete;
}

backup current controlfile for standby tag 'standby controlfile';
report schema;
list copy;
list backup;
list backup summary;

$

среда, 22 мая 2013 г.

Установка PSU 11.2.0.3.6

Ставим  PSU 11.2.0.3.6

Patch 16083653 - 11.2.0.3.6 GI Patch Set Update (Includes Database PSU 11.2.0.3.6)

Устанавливать так:

1. Stop the CRS managed resources running from DB homes.

# su - oraagent

$ emctl stop agent

# su - oradb

$ /u01/app/oradb/product/11.2.0.3/dbhome_1/bin/srvctl stop home -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -s /export/home/oradb/state_file.oradb


2. Run the pre root script.

$su -

# /u01/app/11.2.0.3/grid/crs/install/roothas.pl -unlock



3. Unzipping

# su - oragrid

$cd /tmp

$unzip  p16083653_112030_SOLARIS64.zip


$ls -l
total 552336
drwxrwxr-x 4 oragrid oinstall 307 Jul 18 09:21 16315641
drwxr-xr-x 5 oragrid oinstall 302 Jul 18 09:21 16056266


4. Apply the CRS patch using.

Требования к OPatch version    : 11.2.0.3.4


$ /u01/app/11.2.0.3/grid/OPatch/opatch napply -oh /u01/app/11.2.0.3/grid -local /tmp/16315641

$ /u01/app/11.2.0.3/grid/OPatch/opatch apply -oh /u01/app/11.2.0.3/grid -local /tmp/16056266



5. Run the pre script for DB component of the patch.

# su - oradb

$ /tmp/16315641/custom/server/16315641/custom/scripts/prepatch.sh -dbhome /u01/app/oradb/product/11.2.0.3/dbhome_1



6. Apply the DB patch.


$ /u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch napply -oh /u01/app/oradb/product/11.2.0.3/dbhome_1 -local /tmp/16315641/custom/server/16315641
$ /u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch apply  -oh /u01/app/oradb/product/11.2.0.3/dbhome_1 -local /tmp/16056266



7. Run the post script for DB component of the patch.


$ /tmp/16315641/custom/server/16315641/custom/scripts/postpatch.sh -dbhome /u01/app/oradb/product/11.2.0.3/dbhome_1


8. Run the post script.

$su -

Run the post script.

# /u01/app/11.2.0.3/grid/rdbms/install/rootadd_rdbms.sh
# /u01/app/11.2.0.3/grid/crs/install/roothas.pl -patch


9. Start the CRS managed resources that were earlier running from DB homes.

# su - oradb

$ /u01/app/oradb/product/11.2.0.3/dbhome_1/bin/srvctl start home -o /u01/app/oradb/product/11.2.0.3/dbhome_1 -s /export/home/oradb/state_file.oradb


10. Проверяем:

$/u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch lsinventory

$su - oragrid

$/u01/app/11.2.0.3/grid/OPatch/opatch lsinventory


воскресенье, 5 мая 2013 г.

Установка Python

Скачать Python можно с сайта:

http://www.python.org/download/

Устанавливать из архива с исходными кодами примерно так:

tar xvfj  Python-3.3.1.tar.bz2
cd  Python-3.3.1
./configure
make
make test
make install


Или для локальной установки с префиксом:

./configure  --prefix=$HOME/local/python3
make
make test
make install

ln -s ~/local/python3/bin/python3.3 ~/bin/python3
ln -s ~/local/python3/bin/idle      ~/bin/idle3


Для Windows прописываем в переменную PATH путь C:\Python33\

C:\Users\angor>cd c:\projects

c:\projects>python -V
Python 3.3.1

После установки Python желательно установить пакет Distribute.
Описание смотрим на packages.python.org/distribute.
Его потребует менеджер пакетов PIP.

Устанавливаем его так:

Скачиваем скрипт:

curl -O http://python-distribute.org/distribute_setup.py

или

wget http://python-distribute.org/distribute_setup.py

c:\projects>wget http://python-distribute.org/distribute_setup.py

SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2013-05-05 23:27:22--  http://python-distribute.org/distribute_setup.py
Распознаётся python-distribute.org... 88.191.140.69
Устанавливается соединение с python-distribute.org|88.191.140.69|:80... соединение установлено.
Запрос HTTP послан, ожидается ответ... 200 OK
Длина: 17319 (17K) [text/x-python]
Сохраняется в каталог: `distribute_setup.py'.

100%[==============================================================================>] 17 319      --.-K/s   в 0,001s

2013-05-05 23:27:22 (15,2 MB/s) - `distribute_setup.py' сохранён [17319/17319]

и далее запускаем  его:

c:\projects>python distribute_setup.py

Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.38.tar.gz
Extracting in c:\users\angor\appdata\local\temp\tmpe0haa8
Now working in c:\users\angor\appdata\local\temp\tmpe0haa8\distribute-0.6.38
Installing Distribute
creating build
creating build\src
creating build\src\_markerlib
creating build\src\docs
creating build\src\docs\_templates
creating build\src\docs\_theme
creating build\src\docs\_theme\nature
creating build\src\docs\_theme\nature\static
creating build\src\docs\build
creating build\src\docs\build\html
creating build\src\docs\build\html\_sources
creating build\src\docs\build\html\_static
creating build\src\setuptools
creating build\src\setuptools\command
creating build\src\setuptools\tests
creating build\src\setuptools\tests\indexes
creating build\src\setuptools\tests\indexes\test_links_priority
creating build\src\setuptools\tests\indexes\test_links_priority\simple
creating build\src\setuptools\tests\indexes\test_links_priority\simple\foobar
creating build\src\tests
creating build\src\tests\shlib_test
copying setuptools\archive_util.py -> build\src\setuptools
copying setuptools\depends.py -> build\src\setuptools
copying setuptools\dist.py -> build\src\setuptools
copying setuptools\extension.py -> build\src\setuptools
copying setuptools\package_index.py -> build\src\setuptools
copying setuptools\sandbox.py -> build\src\setuptools
copying setuptools\script template (dev).py -> build\src\setuptools
copying setuptools\script template.py -> build\src\setuptools
copying setuptools\__init__.py -> build\src\setuptools
copying setuptools\tests\doctest.py -> build\src\setuptools\tests
copying setuptools\tests\py26compat.py -> build\src\setuptools\tests
copying setuptools\tests\server.py -> build\src\setuptools\tests
copying setuptools\tests\test_bdist_egg.py -> build\src\setuptools\tests
copying setuptools\tests\test_build_ext.py -> build\src\setuptools\tests
copying setuptools\tests\test_develop.py -> build\src\setuptools\tests
copying setuptools\tests\test_dist_info.py -> build\src\setuptools\tests
copying setuptools\tests\test_easy_install.py -> build\src\setuptools\tests
copying setuptools\tests\test_markerlib.py -> build\src\setuptools\tests
copying setuptools\tests\test_packageindex.py -> build\src\setuptools\tests
copying setuptools\tests\test_resources.py -> build\src\setuptools\tests
copying setuptools\tests\test_sandbox.py -> build\src\setuptools\tests
copying setuptools\tests\test_sdist.py -> build\src\setuptools\tests
copying setuptools\tests\test_test.py -> build\src\setuptools\tests
copying setuptools\tests\test_upload_docs.py -> build\src\setuptools\tests
copying setuptools\tests\__init__.py -> build\src\setuptools\tests
copying setuptools\command\alias.py -> build\src\setuptools\command
copying setuptools\command\bdist_egg.py -> build\src\setuptools\command
copying setuptools\command\bdist_rpm.py -> build\src\setuptools\command
copying setuptools\command\bdist_wininst.py -> build\src\setuptools\command
copying setuptools\command\build_ext.py -> build\src\setuptools\command
copying setuptools\command\build_py.py -> build\src\setuptools\command
copying setuptools\command\develop.py -> build\src\setuptools\command
copying setuptools\command\easy_install.py -> build\src\setuptools\command
copying setuptools\command\egg_info.py -> build\src\setuptools\command
copying setuptools\command\install.py -> build\src\setuptools\command
copying setuptools\command\install_egg_info.py -> build\src\setuptools\command
copying setuptools\command\install_lib.py -> build\src\setuptools\command
copying setuptools\command\install_scripts.py -> build\src\setuptools\command
copying setuptools\command\register.py -> build\src\setuptools\command
copying setuptools\command\rotate.py -> build\src\setuptools\command
copying setuptools\command\saveopts.py -> build\src\setuptools\command
copying setuptools\command\sdist.py -> build\src\setuptools\command
copying setuptools\command\setopt.py -> build\src\setuptools\command
copying setuptools\command\test.py -> build\src\setuptools\command
copying setuptools\command\upload.py -> build\src\setuptools\command
copying setuptools\command\upload_docs.py -> build\src\setuptools\command
copying setuptools\command\__init__.py -> build\src\setuptools\command
copying setuptools\tests\win_script_wrapper.txt -> build\src\setuptools\tests
copying setuptools\cli-32.exe -> build\src\setuptools
copying setuptools\cli-64.exe -> build\src\setuptools
copying setuptools\cli.exe -> build\src\setuptools
copying setuptools\gui-32.exe -> build\src\setuptools
copying setuptools\gui-64.exe -> build\src\setuptools
copying setuptools\gui.exe -> build\src\setuptools
copying setuptools\command\launcher manifest.xml -> build\src\setuptools\command
copying tests\install_test.py -> build\src\tests
copying tests\manual_test.py -> build\src\tests
copying tests\test_distribute_setup.py -> build\src\tests
copying tests\shlib_test\setup.py -> build\src\tests\shlib_test
copying tests\shlib_test\test_hello.py -> build\src\tests\shlib_test
copying tests\shlib_test\hello.c -> build\src\tests\shlib_test
copying tests\shlib_test\hellolib.c -> build\src\tests\shlib_test
copying tests\shlib_test\hello.pyx -> build\src\tests\shlib_test
copying tests\api_tests.txt -> build\src\tests
RefactoringTool: Skipping implicit fixer: buffer
RefactoringTool: Skipping implicit fixer: idioms
RefactoringTool: Skipping implicit fixer: set_literal
RefactoringTool: Skipping implicit fixer: ws_comma
RefactoringTool: Refactored build\src\tests\api_tests.txt
--- build\src\tests\api_tests.txt       (original)
+++ build\src\tests\api_tests.txt       (refactored)
@@ -39,7 +39,7 @@
     >>> dist.py_version == sys.version[:3]
     True

-    >>> print dist.platform
+    >>> print(dist.platform)
     None

 Including various computed attributes::
@@ -199,7 +199,7 @@
 You can ask a WorkingSet to ``find()`` a distribution matching a requirement::

     >>> from pkg_resources import Requirement
-    >>> print ws.find(Requirement.parse("Foo==1.0"))    # no match, return None
+    >>> print(ws.find(Requirement.parse("Foo==1.0")))    # no match, return None
     None

     >>> ws.find(Requirement.parse("Bar==0.9"))  # match, return distribution
@@ -211,7 +211,7 @@
     >>> try:
     ...     ws.find(Requirement.parse("Bar==1.0"))
     ... except VersionConflict:
-    ...     print 'ok'
+    ...     print('ok')
     ok

 You can subscribe a callback function to receive notifications whenever a new
@@ -219,7 +219,7 @@
 once for each existing distribution in the working set, and then is called
 again for new distributions added thereafter::

-    >>> def added(dist): print "Added", dist
+    >>> def added(dist): print("Added", dist)
     >>> ws.subscribe(added)
     Added Bar 0.9
     >>> foo12 = Distribution(project_name="Foo", version="1.2", location="f12")
RefactoringTool: Files that were modified:
RefactoringTool: build\src\tests\api_tests.txt
copying setuptools\tests\indexes\test_links_priority\external.html -> build\src\setuptools\tests\indexes\test_links_prio
rity
copying setuptools\tests\indexes\test_links_priority\simple\foobar\index.html -> build\src\setuptools\tests\indexes\test
_links_priority\simple\foobar
copying docs\conf.py -> build\src\docs
copying docs\easy_install.txt -> build\src\docs
copying docs\index.txt -> build\src\docs
copying docs\pkg_resources.txt -> build\src\docs
copying docs\python3.txt -> build\src\docs
copying docs\roadmap.txt -> build\src\docs
copying docs\setuptools.txt -> build\src\docs
copying docs\using.txt -> build\src\docs
copying docs\build\html\_sources\easy_install.txt -> build\src\docs\build\html\_sources
copying docs\build\html\_sources\index.txt -> build\src\docs\build\html\_sources
copying docs\build\html\_sources\pkg_resources.txt -> build\src\docs\build\html\_sources
copying docs\build\html\_sources\python3.txt -> build\src\docs\build\html\_sources
copying docs\build\html\_sources\roadmap.txt -> build\src\docs\build\html\_sources
copying docs\build\html\_sources\setuptools.txt -> build\src\docs\build\html\_sources
copying docs\build\html\_sources\using.txt -> build\src\docs\build\html\_sources
copying docs\_theme\nature\theme.conf -> build\src\docs\_theme\nature
copying docs\_theme\nature\static\pygments.css -> build\src\docs\_theme\nature\static
copying docs\build\html\_static\basic.css -> build\src\docs\build\html\_static
copying docs\build\html\_static\nature.css -> build\src\docs\build\html\_static
copying docs\build\html\_static\pygments.css -> build\src\docs\build\html\_static
copying docs\_theme\nature\static\nature.css_t -> build\src\docs\_theme\nature\static
copying docs\Makefile -> build\src\docs
copying docs\_templates\indexsidebar.html -> build\src\docs\_templates
copying _markerlib\markers.py -> build\src\_markerlib
copying _markerlib\__init__.py -> build\src\_markerlib
copying distribute_setup.py -> build\src
copying easy_install.py -> build\src
copying pkg_resources.py -> build\src
copying release.py -> build\src
copying setup.py -> build\src
copying site.py -> build\src
copying CHANGES.txt -> build\src
copying CONTRIBUTORS.txt -> build\src
copying DEVGUIDE.txt -> build\src
copying README.txt -> build\src
copying MANIFEST.in -> build\src
copying launcher.c -> build\src
Skipping implicit fixer: buffer
Skipping implicit fixer: idioms
Skipping implicit fixer: set_literal
Skipping implicit fixer: ws_comma
Before install bootstrap.
Scanning installed packages
No setuptools distribution found
running install
running bdist_egg
running egg_info
writing top-level names to distribute.egg-info\top_level.txt
writing dependency_links to distribute.egg-info\dependency_links.txt
writing distribute.egg-info\PKG-INFO
writing entry points to distribute.egg-info\entry_points.txt
reading manifest file 'distribute.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'distribute.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build\lib
copying build\src\pkg_resources.py -> build\lib
copying build\src\easy_install.py -> build\lib
copying build\src\site.py -> build\lib
creating build\lib\setuptools
copying build\src\setuptools\archive_util.py -> build\lib\setuptools
copying build\src\setuptools\depends.py -> build\lib\setuptools
copying build\src\setuptools\dist.py -> build\lib\setuptools
copying build\src\setuptools\extension.py -> build\lib\setuptools
copying build\src\setuptools\package_index.py -> build\lib\setuptools
copying build\src\setuptools\sandbox.py -> build\lib\setuptools
copying build\src\setuptools\script template (dev).py -> build\lib\setuptools
copying build\src\setuptools\script template.py -> build\lib\setuptools
copying build\src\setuptools\__init__.py -> build\lib\setuptools
creating build\lib\_markerlib
copying build\src\_markerlib\markers.py -> build\lib\_markerlib
copying build\src\_markerlib\__init__.py -> build\lib\_markerlib
creating build\lib\setuptools\command
copying build\src\setuptools\command\alias.py -> build\lib\setuptools\command
copying build\src\setuptools\command\bdist_egg.py -> build\lib\setuptools\command
copying build\src\setuptools\command\bdist_rpm.py -> build\lib\setuptools\command
copying build\src\setuptools\command\bdist_wininst.py -> build\lib\setuptools\command
copying build\src\setuptools\command\build_ext.py -> build\lib\setuptools\command
copying build\src\setuptools\command\build_py.py -> build\lib\setuptools\command
copying build\src\setuptools\command\develop.py -> build\lib\setuptools\command
copying build\src\setuptools\command\easy_install.py -> build\lib\setuptools\command
copying build\src\setuptools\command\egg_info.py -> build\lib\setuptools\command
copying build\src\setuptools\command\install.py -> build\lib\setuptools\command
copying build\src\setuptools\command\install_egg_info.py -> build\lib\setuptools\command
copying build\src\setuptools\command\install_lib.py -> build\lib\setuptools\command
copying build\src\setuptools\command\install_scripts.py -> build\lib\setuptools\command
copying build\src\setuptools\command\register.py -> build\lib\setuptools\command
copying build\src\setuptools\command\rotate.py -> build\lib\setuptools\command
copying build\src\setuptools\command\saveopts.py -> build\lib\setuptools\command
copying build\src\setuptools\command\sdist.py -> build\lib\setuptools\command
copying build\src\setuptools\command\setopt.py -> build\lib\setuptools\command
copying build\src\setuptools\command\test.py -> build\lib\setuptools\command
copying build\src\setuptools\command\upload.py -> build\lib\setuptools\command
copying build\src\setuptools\command\upload_docs.py -> build\lib\setuptools\command
copying build\src\setuptools\command\__init__.py -> build\lib\setuptools\command
creating build\lib\setuptools\tests
copying build\src\setuptools\tests\doctest.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\py26compat.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\server.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_bdist_egg.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_build_ext.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_develop.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_dist_info.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_easy_install.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_markerlib.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_packageindex.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_resources.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_sandbox.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_sdist.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_test.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\test_upload_docs.py -> build\lib\setuptools\tests
copying build\src\setuptools\tests\__init__.py -> build\lib\setuptools\tests
copying build\src\setuptools\cli-32.exe -> build\lib\setuptools
copying build\src\setuptools\cli-64.exe -> build\lib\setuptools
copying build\src\setuptools\cli.exe -> build\lib\setuptools
copying build\src\setuptools\gui-32.exe -> build\lib\setuptools
copying build\src\setuptools\gui-64.exe -> build\lib\setuptools
copying build\src\setuptools\gui.exe -> build\lib\setuptools
copying build\src\setuptools\command\launcher manifest.xml -> build\lib\setuptools\command
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
copying build\lib\easy_install.py -> build\bdist.win-amd64\egg
copying build\lib\pkg_resources.py -> build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\archive_util.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\cli-32.exe -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\cli-64.exe -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\cli.exe -> build\bdist.win-amd64\egg\setuptools
creating build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\alias.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\bdist_egg.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\bdist_rpm.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\bdist_wininst.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\build_ext.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\build_py.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\develop.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\easy_install.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\egg_info.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\install.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\install_egg_info.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\install_lib.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\install_scripts.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\launcher manifest.xml -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\register.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\rotate.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\saveopts.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\sdist.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\setopt.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\test.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\upload.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\upload_docs.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\command\__init__.py -> build\bdist.win-amd64\egg\setuptools\command
copying build\lib\setuptools\depends.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\dist.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\extension.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\gui-32.exe -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\gui-64.exe -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\gui.exe -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\package_index.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\sandbox.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\script template (dev).py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\setuptools\script template.py -> build\bdist.win-amd64\egg\setuptools
creating build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\doctest.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\py26compat.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\server.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_bdist_egg.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_build_ext.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_develop.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_dist_info.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_easy_install.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_markerlib.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_packageindex.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_resources.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_sandbox.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_sdist.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_test.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\test_upload_docs.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\tests\__init__.py -> build\bdist.win-amd64\egg\setuptools\tests
copying build\lib\setuptools\__init__.py -> build\bdist.win-amd64\egg\setuptools
copying build\lib\site.py -> build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\_markerlib
copying build\lib\_markerlib\markers.py -> build\bdist.win-amd64\egg\_markerlib
copying build\lib\_markerlib\__init__.py -> build\bdist.win-amd64\egg\_markerlib
byte-compiling build\bdist.win-amd64\egg\easy_install.py to easy_install.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\pkg_resources.py to pkg_resources.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\archive_util.py to archive_util.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\alias.py to alias.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\bdist_egg.py to bdist_egg.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\bdist_rpm.py to bdist_rpm.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\bdist_wininst.py to bdist_wininst.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\build_ext.py to build_ext.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\build_py.py to build_py.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\develop.py to develop.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\easy_install.py to easy_install.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\egg_info.py to egg_info.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\install.py to install.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\install_egg_info.py to install_egg_info.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\install_lib.py to install_lib.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\install_scripts.py to install_scripts.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\register.py to register.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\rotate.py to rotate.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\saveopts.py to saveopts.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\sdist.py to sdist.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\setopt.py to setopt.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\test.py to test.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\upload.py to upload.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\upload_docs.py to upload_docs.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\command\__init__.py to __init__.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\depends.py to depends.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\dist.py to dist.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\extension.py to extension.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\package_index.py to package_index.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\sandbox.py to sandbox.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\script template (dev).py to script template (dev).cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\script template.py to script template.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\doctest.py to doctest.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\py26compat.py to py26compat.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\server.py to server.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_bdist_egg.py to test_bdist_egg.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_build_ext.py to test_build_ext.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_develop.py to test_develop.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_dist_info.py to test_dist_info.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_easy_install.py to test_easy_install.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_markerlib.py to test_markerlib.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_packageindex.py to test_packageindex.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_resources.py to test_resources.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_sandbox.py to test_sandbox.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_sdist.py to test_sdist.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_test.py to test_test.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\test_upload_docs.py to test_upload_docs.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\tests\__init__.py to __init__.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\setuptools\__init__.py to __init__.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\site.py to site.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\_markerlib\markers.py to markers.cpython-33.pyc
byte-compiling build\bdist.win-amd64\egg\_markerlib\__init__.py to __init__.cpython-33.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying distribute.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying distribute.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying distribute.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying distribute.egg-info\entry_points.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying distribute.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying distribute.egg-info\zip-safe -> build\bdist.win-amd64\egg\EGG-INFO
creating dist
creating 'dist\distribute-0.6.38-py3.3.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing distribute-0.6.38-py3.3.egg
creating c:\python33\lib\site-packages\distribute-0.6.38-py3.3.egg
Extracting distribute-0.6.38-py3.3.egg to c:\python33\lib\site-packages
Adding distribute 0.6.38 to easy-install.pth file
Installing easy_install-script.py script to C:\Python33\Scripts
Installing easy_install.exe script to C:\Python33\Scripts
Installing easy_install-3.3-script.py script to C:\Python33\Scripts
Installing easy_install-3.3.exe script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\distribute-0.6.38-py3.3.egg
Processing dependencies for distribute==0.6.38
Finished processing dependencies for distribute==0.6.38
After install bootstrap.
Creating C:\Python33\Lib\site-packages\setuptools-0.6c11-py3.3.egg-info
Creating C:\Python33\Lib\site-packages\setuptools.pth

c:\projects>

После этого в каталоге  C:\Python33\Scripts\
появится утилита  easy_install

Далее прописываем в переменную PATH путь C:\Python33\Scripts\

Проверяем версию  easy_install:

c:\projects>easy_install --version

distribute 0.6.38

c:\projects>

и устанавливаем менеджер пакетов PIP с помощью easy_install:

c:\projects>easy_install pip

Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://www.pip-installer.org
Reading http://pip.openplans.org
Best match: pip 1.3.1
Downloading http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz#md5=cbb27a191cebc58997c4da8513863153
Processing pip-1.3.1.tar.gz
Writing c:\users\angor\appdata\local\temp\easy_install-znorvx\pip-1.3.1\setup.cfg
Running pip-1.3.1\setup.py -q bdist_egg --dist-dir c:\users\angor\appdata\local\temp\easy_install-znorvx\pip-1.3.1\egg-d
ist-tmp-5hfmrt
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.txt' found under directory 'docs\_build'
no previously-included directories found matching 'docs\_build\_sources'
Adding pip 1.3.1 to easy-install.pth file
Installing pip-3.3-script.py script to C:\Python33\Scripts
Installing pip-3.3.exe script to C:\Python33\Scripts
Installing pip-script.py script to C:\Python33\Scripts
Installing pip.exe script to C:\Python33\Scripts

Installed c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg
Processing dependencies for pip
Finished processing dependencies for pip

c:\projects>

c:\projects>pip -V

pip 1.3.1 from c:\python33\lib\site-packages\pip-1.3.1-py3.3.egg (python 3.3)

c:\projects>


PIP  можно также установить и из архива с исходными кодами:

c:\projects>wget http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz

SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = C:\Program Files (x86)\GnuWin32/etc/wgetrc
--2013-05-06 00:18:05--  http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz
Распознаётся pypi.python.org... 140.211.10.69
Устанавливается соединение с pypi.python.org|140.211.10.69|:80... соединение установлено.
Запрос HTTP послан, ожидается ответ... 200 OK
Длина: 247594 (242K) [application/octet-stream]
Сохраняется в каталог: `pip-1.3.1.tar.gz'.

100%[==============================================================================>] 247 594      306K/s   в 0,8s

2013-05-06 00:18:07 (306 KB/s) - `pip-1.3.1.tar.gz' сохранён [247594/247594]

c:\projects>

tar  xzf  pip-1.3.1.tar.gz
cd  pip-1.3.1
python  setup.py  install



Distribute - это замена  Setuptools
PIP - это замена easy_install




модуль subprocess


Начиная с версии 2.4 библиотека Python включает в себя модуль subprocess.

Это универсальное средство для:

- запуска новых процессов
- подключения к их потокам (stdin, stdout, stderr)
- получения возвращаемого кода по завершению

Класс Popen() вызывает процесс и возвращает управление программе не ожидая его завершения.

Класс subprocess.Popen

subprocess.Popen(
args,
bufsize=-1,
executable=None,
stdin=None,
stdout=None,
stderr=None,
preexec_fn=None,
close_fds=True,
shell=False,
cwd=None,
env=None,
universal_newlines=False,
startupinfo=None,
creationflags=0,
restore_signals=True,
start_new_session=False,
pass_fds=(),
*,
encoding=None,
errors=None,
text=None
)


Примеры:

subprocess.Popen('C:\\Windows\\System32\\calc.exe')

Передача аргументов в командную строку.

Мы можем передать командной строке аргументы при создании объекта Popen.
Для этого мы передаем список в аргумент Popen, содержащий имя программы и аргументы к ее запуску.

subprocess.Popen(['notepad', 'C:\\file.txt'])
subprocess.Popen(['ping', 'oracle.com'])


Если аргументу shell присвоить значение True, то команда будет выполнена через оболочку.
Эта опция наиболее характерна для Windows.
Для Windows класс Popen использует CreateProcess() для выполнения дочерней программы,
который предполагает что args - это строка.
Если args - список, то он будет преобразован в строку используя метод list2cmdline().

Если мы хотим выполнить встроенную команду оболочки Windows (например, dir или copy),
то необходимо указать shell=True
Для запуска командного файла или исполняемого файла на основе консоли shell=True указывать не нужно.
В Windows при shell=True переменная среды COMSPEC указывает оболочку по умолчанию.

subprocess.Popen(['start', 'C:\\file.txt'], shell=True)

subprocess.Popen(['dir'], shell=True)



Для Unix так:

Класс Popen использует os.execvp(), чтобы выполнить дочернюю программу.

subprocess.Popen(['ls -l'], shell=True)

Однако, эта же команда работает и без указания shell.
В случае  shell=True, необходимая команда задаётся целиком одной строкой.
А в случае  shell=False (по умолчанию), команда может задаваться в виде списка.

subprocess.Popen(['ls', '-l'], shell=False)

subprocess.Popen(['/bin/sh', '-c', args[0], args[1], ...])


Также Popen поддерживает менеджеры контекста:

with Popen(["ifconfig"], stdout=PIPE) as proc:
    log.write(proc.stdout.read())



>>> from subprocess import Popen,PIPE
>>> print Popen("echo Hello World", stdout=PIPE, shell=True).stdout.read()
Hello World

>>>


>>> from subprocess import Popen,PIPE
>>> ipaddress="10.0.2.15"
>>> p = Popen("/usr/sbin/ping -c 5 %s" % ipaddress, shell=True, stdout=PIPE)
>>> out = p.stdout.read()
>>> print out
10.0.2.15 is alive

>>> result = out.split()
>>> print result
['10.0.2.15', 'is', 'alive']