]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/PythonReadMe.txt
AppPkg/.../Python: Clean up and document how to escape the -# option.
[mirror_edk2.git] / AppPkg / Applications / Python / PythonReadMe.txt
index 7d8b31f74b69dbe6275a52c182d49d9cfcd18023..c8cd503b768e21446440f09cda4d63e8455a55cf 100644 (file)
@@ -1,7 +1,8 @@
                                 EDK II Python\r
-                                    ReadMe\r
-                                 Release 1.02\r
-                                 18 Jan. 2013\r
+                                   ReadMe\r
+                                Version 2.7.2\r
+                                Release 1.02\r
+                                18 Jan. 2013\r
 \r
 \r
 1. OVERVIEW\r
@@ -25,10 +26,10 @@ packages within that distribution.
 ======================================================\r
   3.1 Getting Python\r
   ==================\r
-  Currently only version 2.7.2 of the CPython distribution is supported.  For development\r
-  ease, a subset of the Python 2.7.2 distribution has been included in the AppPkg source\r
-  tree.  If a full distribution is desired, the Python-2.7.2 directory can be removed or\r
-  renamed and the full source code downloaded from http://www.python.org/ftp/python/2.7.2/.\r
+  For development ease, a subset of the Python 2.7.2 distribution has been\r
+  included in the AppPkg source tree.  If a full distribution is desired, the\r
+  Python-2.7.2 directory can be removed or renamed and the full source code\r
+  downloaded from http://www.python.org/ftp/python/2.7.2/.\r
 \r
   A.  Within your EDK II development tree, extract the Python distribution into\r
     AppPkg/Applications/Python.  This should create the\r
@@ -70,7 +71,8 @@ target system.
        |- \etc                      Configuration files used by libraries.\r
        |- \tmp                      Temporary files created by tmpfile(), etc.\r
        |- \lib                      Root of the libraries tree.\r
-           |- \python.27            Directory containing the Python library modules.\r
+           |- \python.27            Directory containing the Python library\r
+               |                    modules.\r
                |- \lib-dynload      Dynamically loadable Python extensions.\r
                |- \site-packages    Site-specific packages and modules.\r
 \r
@@ -81,7 +83,7 @@ These directories, on the target system, are populated from the development
 system as follows:\r
 \r
   * \Efi\Tools receives a copy of Build/AppPkg/DEBUG_VS2005/X64/Python.efi.\r
-                                               ^^^^^ ^^^^^^\r
+                                               ^^^^^ ^^^^^^^^^^\r
     Modify the host path to match the your build type and compiler.\r
 \r
   * The \Efi\StdLib\etc directory is populated from the StdLib/Efi/StdLib/etc\r
@@ -94,8 +96,8 @@ system as follows:
         site    types     copy_reg    linecache     genericpath\r
 \r
   * Python C Extension Modules built as dynamically loadable extensions go into\r
-    the \Efi\StdLib\lib\python.27\lib-dynload directory.  This functionality is not\r
-    yet implemented.\r
+    the \Efi\StdLib\lib\python.27\lib-dynload directory.  This functionality is\r
+    not yet implemented.\r
 \r
 \r
 6. Example: Enabling socket support\r
@@ -107,11 +109,48 @@ system as follows:
         functools, types, os, sys, warnings, cStringIO, StringIO, errno\r
 \r
   5.  build -a X64 -p AppPkg\AppPkg.dsc\r
-  6.  copy Build\AppPkg\DEBUG_VS2005\X64\Python.efi to \Efi\Tools on your target system.\r
-                                ^^^^ Modify as needed\r
-\r
-\r
-7. Supported C Modules\r
+  6.  copy Build\AppPkg\DEBUG_VS2005\X64\Python.efi to \Efi\Tools on your\r
+      target system. Replace "DEBUG_VS2005\X64", in the source path, with\r
+      values appropriate for your tool chain and processor architecture.\r
+\r
+\r
+7. Running Python\r
+=================\r
+  Python must currently be run from an EFI FAT-32 partition, or volume, under\r
+  the UEFI Shell.  At the Shell prompt enter the desired volume name, followed\r
+  by a colon ':', then press Enter.  Python can then be executed by typing its\r
+  name, followed by any desired options and arguments.\r
+\r
+  EXAMPLE:\r
+      2.0 Shell> fs0:\r
+      2.0 FS0:\> python\r
+      Python 2.7.2 (default, Oct 13 2015, 16:21:53) [C] on uefi\r
+      Type "help", "copyright", "credits" or "license" for more information.\r
+      >>> exit()\r
+      2.0 FS0:\>\r
+\r
+  NOTE:\r
+      Python, as distributed, sends its interactive prompts to stderr.  If\r
+      STDERR isn't enabled in UEFI Setup so that it's output goes to the\r
+      console, it may appear that Python hangs on startup.  If this happens,\r
+      one may be able to rectify the condition by typing "exit()" followed\r
+      by <enter> to exit out of Python.  Then, type "exit" at the Shell prompt\r
+      which should enter Setup where you can use the Boot Maintenance\r
+      Manager to modify your Console settings.\r
+\r
+  NOTE:\r
+      Some platforms don't include the Setup utility, or don't allow STDERR to\r
+      be modified.  In these cases, Python may be started with the '-#' option\r
+      which will cause stderr to be the same as stdout and should allow\r
+      Python to be used interactively on those platforms.\r
+\r
+      Depending upon the version of Shell you are using, it may be necessary\r
+      to escape the '#' character so that the Shell doesn't interpret it as\r
+      the start of a comment.  The escape character is '^'.\r
+      Example:\r
+          python -^# -V\r
+\r
+8. Supported C Modules\r
 ======================\r
     Module Name               C File(s)\r
   ===============       =============================================\r
@@ -166,7 +205,7 @@ system as follows:
   zlib                  Modules/zlibmodule.c          Modules/zlib/*\r
 \r
 \r
-8. Tested Python Library Modules\r
+9. Tested Python Library Modules\r
 ================================\r
 This is a partial list of the packages and modules of the Python Standard\r
 Library that have been tested or used in some manner.\r