Georg Brandl | cb7cb24 | 2009-10-27 20:20:38 +0000 | [diff] [blame] | 1 | :tocdepth: 2 |
| 2 | |
| 3 | ================== |
| 4 | General Python FAQ |
| 5 | ================== |
| 6 | |
| 7 | .. contents:: |
| 8 | |
| 9 | General Information |
| 10 | =================== |
| 11 | |
| 12 | What is Python? |
| 13 | --------------- |
| 14 | |
| 15 | Python is an interpreted, interactive, object-oriented programming language. It |
| 16 | incorporates modules, exceptions, dynamic typing, very high level dynamic data |
| 17 | types, and classes. Python combines remarkable power with very clear syntax. |
| 18 | It has interfaces to many system calls and libraries, as well as to various |
| 19 | window systems, and is extensible in C or C++. It is also usable as an |
| 20 | extension language for applications that need a programmable interface. |
| 21 | Finally, Python is portable: it runs on many Unix variants, on the Mac, and on |
| 22 | PCs under MS-DOS, Windows, Windows NT, and OS/2. |
| 23 | |
| 24 | To find out more, start with :ref:`tutorial-index`. The `Beginner's Guide to |
| 25 | Python <http://wiki.python.org/moin/BeginnersGuide>`_ links to other |
| 26 | introductory tutorials and resources for learning Python. |
| 27 | |
| 28 | |
| 29 | What is the Python Software Foundation? |
| 30 | --------------------------------------- |
| 31 | |
| 32 | The Python Software Foundation is an independent non-profit organization that |
| 33 | holds the copyright on Python versions 2.1 and newer. The PSF's mission is to |
| 34 | advance open source technology related to the Python programming language and to |
| 35 | publicize the use of Python. The PSF's home page is at |
| 36 | http://www.python.org/psf/. |
| 37 | |
| 38 | Donations to the PSF are tax-exempt in the US. If you use Python and find it |
| 39 | helpful, please contribute via `the PSF donation page |
| 40 | <http://www.python.org/psf/donations/>`_. |
| 41 | |
| 42 | |
| 43 | Are there copyright restrictions on the use of Python? |
| 44 | ------------------------------------------------------ |
| 45 | |
| 46 | You can do anything you want with the source, as long as you leave the |
| 47 | copyrights in and display those copyrights in any documentation about Python |
| 48 | that you produce. If you honor the copyright rules, it's OK to use Python for |
| 49 | commercial use, to sell copies of Python in source or binary form (modified or |
| 50 | unmodified), or to sell products that incorporate Python in some form. We would |
| 51 | still like to know about all commercial use of Python, of course. |
| 52 | |
| 53 | See `the PSF license page <http://python.org/psf/license/>`_ to find further |
| 54 | explanations and a link to the full text of the license. |
| 55 | |
| 56 | The Python logo is trademarked, and in certain cases permission is required to |
| 57 | use it. Consult `the Trademark Usage Policy |
| 58 | <http://www.python.org/psf/trademarks/>`__ for more information. |
| 59 | |
| 60 | |
| 61 | Why was Python created in the first place? |
| 62 | ------------------------------------------ |
| 63 | |
| 64 | Here's a *very* brief summary of what started it all, written by Guido van |
| 65 | Rossum: |
| 66 | |
| 67 | I had extensive experience with implementing an interpreted language in the |
| 68 | ABC group at CWI, and from working with this group I had learned a lot about |
| 69 | language design. This is the origin of many Python features, including the |
| 70 | use of indentation for statement grouping and the inclusion of |
| 71 | very-high-level data types (although the details are all different in |
| 72 | Python). |
| 73 | |
| 74 | I had a number of gripes about the ABC language, but also liked many of its |
| 75 | features. It was impossible to extend the ABC language (or its |
| 76 | implementation) to remedy my complaints -- in fact its lack of extensibility |
| 77 | was one of its biggest problems. I had some experience with using Modula-2+ |
| 78 | and talked with the designers of Modula-3 and read the Modula-3 report. |
| 79 | Modula-3 is the origin of the syntax and semantics used for exceptions, and |
| 80 | some other Python features. |
| 81 | |
| 82 | I was working in the Amoeba distributed operating system group at CWI. We |
| 83 | needed a better way to do system administration than by writing either C |
| 84 | programs or Bourne shell scripts, since Amoeba had its own system call |
| 85 | interface which wasn't easily accessible from the Bourne shell. My |
| 86 | experience with error handling in Amoeba made me acutely aware of the |
| 87 | importance of exceptions as a programming language feature. |
| 88 | |
| 89 | It occurred to me that a scripting language with a syntax like ABC but with |
| 90 | access to the Amoeba system calls would fill the need. I realized that it |
| 91 | would be foolish to write an Amoeba-specific language, so I decided that I |
| 92 | needed a language that was generally extensible. |
| 93 | |
| 94 | During the 1989 Christmas holidays, I had a lot of time on my hand, so I |
| 95 | decided to give it a try. During the next year, while still mostly working |
| 96 | on it in my own time, Python was used in the Amoeba project with increasing |
| 97 | success, and the feedback from colleagues made me add many early |
| 98 | improvements. |
| 99 | |
| 100 | In February 1991, after just over a year of development, I decided to post to |
| 101 | USENET. The rest is in the ``Misc/HISTORY`` file. |
| 102 | |
| 103 | |
| 104 | What is Python good for? |
| 105 | ------------------------ |
| 106 | |
| 107 | Python is a high-level general-purpose programming language that can be applied |
| 108 | to many different classes of problems. |
| 109 | |
| 110 | The language comes with a large standard library that covers areas such as |
| 111 | string processing (regular expressions, Unicode, calculating differences between |
| 112 | files), Internet protocols (HTTP, FTP, SMTP, XML-RPC, POP, IMAP, CGI |
| 113 | programming), software engineering (unit testing, logging, profiling, parsing |
| 114 | Python code), and operating system interfaces (system calls, filesystems, TCP/IP |
| 115 | sockets). Look at the table of contents for :ref:`library-index` to get an idea |
| 116 | of what's available. A wide variety of third-party extensions are also |
| 117 | available. Consult `the Python Package Index <http://pypi.python.org/pypi>`_ to |
| 118 | find packages of interest to you. |
| 119 | |
| 120 | |
| 121 | How does the Python version numbering scheme work? |
| 122 | -------------------------------------------------- |
| 123 | |
| 124 | Python versions are numbered A.B.C or A.B. A is the major version number -- it |
| 125 | is only incremented for really major changes in the language. B is the minor |
| 126 | version number, incremented for less earth-shattering changes. C is the |
| 127 | micro-level -- it is incremented for each bugfix release. See :pep:`6` for more |
| 128 | information about bugfix releases. |
| 129 | |
| 130 | Not all releases are bugfix releases. In the run-up to a new major release, a |
| 131 | series of development releases are made, denoted as alpha, beta, or release |
| 132 | candidate. Alphas are early releases in which interfaces aren't yet finalized; |
| 133 | it's not unexpected to see an interface change between two alpha releases. |
| 134 | Betas are more stable, preserving existing interfaces but possibly adding new |
| 135 | modules, and release candidates are frozen, making no changes except as needed |
| 136 | to fix critical bugs. |
| 137 | |
| 138 | Alpha, beta and release candidate versions have an additional suffix. The |
| 139 | suffix for an alpha version is "aN" for some small number N, the suffix for a |
| 140 | beta version is "bN" for some small number N, and the suffix for a release |
| 141 | candidate version is "cN" for some small number N. In other words, all versions |
| 142 | labeled 2.0aN precede the versions labeled 2.0bN, which precede versions labeled |
| 143 | 2.0cN, and *those* precede 2.0. |
| 144 | |
| 145 | You may also find version numbers with a "+" suffix, e.g. "2.2+". These are |
| 146 | unreleased versions, built directly from the Subversion trunk. In practice, |
| 147 | after a final minor release is made, the Subversion trunk is incremented to the |
| 148 | next minor version, which becomes the "a0" version, |
| 149 | e.g. "2.4a0". |
| 150 | |
| 151 | See also the documentation for ``sys.version``, ``sys.hexversion``, and |
| 152 | ``sys.version_info``. |
| 153 | |
| 154 | |
| 155 | How do I obtain a copy of the Python source? |
| 156 | -------------------------------------------- |
| 157 | |
| 158 | The latest Python source distribution is always available from python.org, at |
| 159 | http://www.python.org/download/. The latest development sources can be obtained |
| 160 | via anonymous Subversion at http://svn.python.org/projects/python/trunk. |
| 161 | |
| 162 | The source distribution is a gzipped tar file containing the complete C source, |
| 163 | Sphinx-formatted documentation, Python library modules, example programs, and |
| 164 | several useful pieces of freely distributable software. The source will compile |
| 165 | and run out of the box on most UNIX platforms. |
| 166 | |
Georg Brandl | 628e6f9 | 2009-10-27 20:24:45 +0000 | [diff] [blame] | 167 | .. XXX update link once the dev faq is relocated |
| 168 | |
| 169 | Consult the `Developer FAQ <http://www.python.org/dev/faq/>`__ for more |
| 170 | information on getting the source code and compiling it. |
Georg Brandl | cb7cb24 | 2009-10-27 20:20:38 +0000 | [diff] [blame] | 171 | |
| 172 | |
| 173 | How do I get documentation on Python? |
| 174 | ------------------------------------- |
| 175 | |
| 176 | .. XXX mention py3k |
| 177 | |
| 178 | The standard documentation for the current stable version of Python is available |
| 179 | at http://docs.python.org/. PDF, plain text, and downloadable HTML versions are |
Georg Brandl | 628e6f9 | 2009-10-27 20:24:45 +0000 | [diff] [blame] | 180 | also available at http://docs.python.org/download.html. |
Georg Brandl | cb7cb24 | 2009-10-27 20:20:38 +0000 | [diff] [blame] | 181 | |
| 182 | The documentation is written in reStructuredText and processed by `the Sphinx |
| 183 | documentation tool <http://sphinx.pocoo.org/>`__. The reStructuredText source |
| 184 | for the documentation is part of the Python source distribution. |
| 185 | |
| 186 | |
| 187 | I've never programmed before. Is there a Python tutorial? |
| 188 | --------------------------------------------------------- |
| 189 | |
| 190 | There are numerous tutorials and books available. The standard documentation |
| 191 | includes :ref:`tutorial-index`. |
| 192 | |
| 193 | Consult `the Beginner's Guide <http://wiki.python.org/moin/BeginnersGuide>`_ to |
| 194 | find information for beginning Python programmers, including lists of tutorials. |
| 195 | |
| 196 | |
| 197 | Is there a newsgroup or mailing list devoted to Python? |
| 198 | ------------------------------------------------------- |
| 199 | |
| 200 | There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, |
| 201 | `python-list <http://mail.python.org/mailman/listinfo/python-list>`_. The |
| 202 | newsgroup and mailing list are gatewayed into each other -- if you can read news |
| 203 | it's unnecessary to subscribe to the mailing list. |
| 204 | :newsgroup:`comp.lang.python` is high-traffic, receiving hundreds of postings |
| 205 | every day, and Usenet readers are often more able to cope with this volume. |
| 206 | |
| 207 | Announcements of new software releases and events can be found in |
| 208 | comp.lang.python.announce, a low-traffic moderated list that receives about five |
| 209 | postings per day. It's available as `the python-announce mailing list |
| 210 | <http://mail.python.org/mailman/listinfo/python-announce-list>`_. |
| 211 | |
| 212 | More info about other mailing lists and newsgroups |
| 213 | can be found at http://www.python.org/community/lists/. |
| 214 | |
| 215 | |
| 216 | How do I get a beta test version of Python? |
| 217 | ------------------------------------------- |
| 218 | |
| 219 | Alpha and beta releases are available from http://www.python.org/download/. All |
| 220 | releases are announced on the comp.lang.python and comp.lang.python.announce |
| 221 | newsgroups and on the Python home page at http://www.python.org/; an RSS feed of |
| 222 | news is available. |
| 223 | |
Georg Brandl | 628e6f9 | 2009-10-27 20:24:45 +0000 | [diff] [blame] | 224 | .. XXX update link once the dev faq is relocated |
| 225 | |
Georg Brandl | cb7cb24 | 2009-10-27 20:20:38 +0000 | [diff] [blame] | 226 | You can also access the development version of Python through Subversion. See |
Georg Brandl | 628e6f9 | 2009-10-27 20:24:45 +0000 | [diff] [blame] | 227 | http://www.python.org/dev/faq/ for details. |
Georg Brandl | cb7cb24 | 2009-10-27 20:20:38 +0000 | [diff] [blame] | 228 | |
| 229 | |
| 230 | How do I submit bug reports and patches for Python? |
| 231 | --------------------------------------------------- |
| 232 | |
| 233 | To report a bug or submit a patch, please use the Roundup installation at |
| 234 | http://bugs.python.org/. |
| 235 | |
| 236 | You must have a Roundup account to report bugs; this makes it possible for us to |
| 237 | contact you if we have follow-up questions. It will also enable Roundup to send |
| 238 | you updates as we act on your bug. If you had previously used SourceForge to |
| 239 | report bugs to Python, you can obtain your Roundup password through Roundup's |
| 240 | `password reset procedure <http://bugs.python.org/user?@template=forgotten>`_. |
| 241 | |
| 242 | .. XXX adapt link to dev guide |
| 243 | |
| 244 | For more information on how Python is developed, consult `the Python Developer's |
| 245 | Guide <http://python.org/dev/>`_. |
| 246 | |
| 247 | |
| 248 | Are there any published articles about Python that I can reference? |
| 249 | ------------------------------------------------------------------- |
| 250 | |
| 251 | It's probably best to cite your favorite book about Python. |
| 252 | |
| 253 | The very first article about Python was written in 1991 and is now quite |
| 254 | outdated. |
| 255 | |
| 256 | Guido van Rossum and Jelke de Boer, "Interactively Testing Remote Servers |
| 257 | Using the Python Programming Language", CWI Quarterly, Volume 4, Issue 4 |
| 258 | (December 1991), Amsterdam, pp 283-303. |
| 259 | |
| 260 | |
| 261 | Are there any books on Python? |
| 262 | ------------------------------ |
| 263 | |
| 264 | Yes, there are many, and more are being published. See the python.org wiki at |
| 265 | http://wiki.python.org/moin/PythonBooks for a list. |
| 266 | |
| 267 | You can also search online bookstores for "Python" and filter out the Monty |
| 268 | Python references; or perhaps search for "Python" and "language". |
| 269 | |
| 270 | |
| 271 | Where in the world is www.python.org located? |
| 272 | --------------------------------------------- |
| 273 | |
| 274 | It's currently in Amsterdam, graciously hosted by `XS4ALL |
| 275 | <http://www.xs4all.nl>`_. Thanks to Thomas Wouters for his work in arranging |
| 276 | python.org's hosting. |
| 277 | |
| 278 | |
| 279 | Why is it called Python? |
| 280 | ------------------------ |
| 281 | |
| 282 | When he began implementing Python, Guido van Rossum was also reading the |
| 283 | published scripts from `"Monty Python's Flying Circus" |
| 284 | <http://pythonline.com/>`__, a BBC comedy series from the 1970s. Van Rossum |
| 285 | thought he needed a name that was short, unique, and slightly mysterious, so he |
| 286 | decided to call the language Python. |
| 287 | |
| 288 | |
| 289 | Do I have to like "Monty Python's Flying Circus"? |
| 290 | ------------------------------------------------- |
| 291 | |
| 292 | No, but it helps. :) |
| 293 | |
| 294 | |
| 295 | Python in the real world |
| 296 | ======================== |
| 297 | |
| 298 | How stable is Python? |
| 299 | --------------------- |
| 300 | |
| 301 | Very stable. New, stable releases have been coming out roughly every 6 to 18 |
| 302 | months since 1991, and this seems likely to continue. Currently there are |
| 303 | usually around 18 months between major releases. |
| 304 | |
| 305 | The developers issue "bugfix" releases of older versions, so the stability of |
| 306 | existing releases gradually improves. Bugfix releases, indicated by a third |
| 307 | component of the version number (e.g. 2.5.3, 2.6.2), are managed for stability; |
| 308 | only fixes for known problems are included in a bugfix release, and it's |
| 309 | guaranteed that interfaces will remain the same throughout a series of bugfix |
| 310 | releases. |
| 311 | |
R. David Murray | 999df78 | 2009-12-14 17:31:22 +0000 | [diff] [blame] | 312 | The latest stable releases can always be found on the `Python download page |
| 313 | <http://python.org/download/>`_. There are two recommended production-ready |
| 314 | versions at this point in time, because at the moment there are two branches of |
| 315 | stable releases: 2.x and 3.x. Python 3.x may be less useful than 2.x, since |
| 316 | currently there is more third party software available for Python 2 than for |
| 317 | Python 3. Python 2 code will generally not run unchanged in Python 3. |
Georg Brandl | cb7cb24 | 2009-10-27 20:20:38 +0000 | [diff] [blame] | 318 | |
| 319 | |
| 320 | How many people are using Python? |
| 321 | --------------------------------- |
| 322 | |
| 323 | There are probably tens of thousands of users, though it's difficult to obtain |
| 324 | an exact count. |
| 325 | |
| 326 | Python is available for free download, so there are no sales figures, and it's |
| 327 | available from many different sites and packaged with many Linux distributions, |
| 328 | so download statistics don't tell the whole story either. |
| 329 | |
| 330 | The comp.lang.python newsgroup is very active, but not all Python users post to |
| 331 | the group or even read it. |
| 332 | |
| 333 | |
| 334 | Have any significant projects been done in Python? |
| 335 | -------------------------------------------------- |
| 336 | |
| 337 | See http://python.org/about/success for a list of projects that use Python. |
| 338 | Consulting the proceedings for `past Python conferences |
| 339 | <http://python.org/community/workshops/>`_ will reveal contributions from many |
| 340 | different companies and organizations. |
| 341 | |
| 342 | High-profile Python projects include `the Mailman mailing list manager |
| 343 | <http://www.list.org>`_ and `the Zope application server |
| 344 | <http://www.zope.org>`_. Several Linux distributions, most notably `Red Hat |
| 345 | <http://www.redhat.com>`_, have written part or all of their installer and |
| 346 | system administration software in Python. Companies that use Python internally |
| 347 | include Google, Yahoo, and Lucasfilm Ltd. |
| 348 | |
| 349 | |
| 350 | What new developments are expected for Python in the future? |
| 351 | ------------------------------------------------------------ |
| 352 | |
| 353 | See http://www.python.org/dev/peps/ for the Python Enhancement Proposals |
| 354 | (PEPs). PEPs are design documents describing a suggested new feature for Python, |
| 355 | providing a concise technical specification and a rationale. Look for a PEP |
| 356 | titled "Python X.Y Release Schedule", where X.Y is a version that hasn't been |
| 357 | publicly released yet. |
| 358 | |
| 359 | New development is discussed on `the python-dev mailing list |
| 360 | <http://mail.python.org/mailman/listinfo/python-dev/>`_. |
| 361 | |
| 362 | |
| 363 | Is it reasonable to propose incompatible changes to Python? |
| 364 | ----------------------------------------------------------- |
| 365 | |
| 366 | In general, no. There are already millions of lines of Python code around the |
| 367 | world, so any change in the language that invalidates more than a very small |
| 368 | fraction of existing programs has to be frowned upon. Even if you can provide a |
| 369 | conversion program, there's still the problem of updating all documentation; |
| 370 | many books have been written about Python, and we don't want to invalidate them |
| 371 | all at a single stroke. |
| 372 | |
| 373 | Providing a gradual upgrade path is necessary if a feature has to be changed. |
| 374 | :pep:`5` describes the procedure followed for introducing backward-incompatible |
| 375 | changes while minimizing disruption for users. |
| 376 | |
| 377 | |
| 378 | Is Python Y2K (Year 2000) Compliant? |
| 379 | ------------------------------------ |
| 380 | |
| 381 | .. remove this question? |
| 382 | |
| 383 | As of August, 2003 no major problems have been reported and Y2K compliance seems |
| 384 | to be a non-issue. |
| 385 | |
| 386 | Python does very few date calculations and for those it does perform relies on |
| 387 | the C library functions. Python generally represents times either as seconds |
| 388 | since 1970 or as a ``(year, month, day, ...)`` tuple where the year is expressed |
| 389 | with four digits, which makes Y2K bugs unlikely. So as long as your C library |
| 390 | is okay, Python should be okay. Of course, it's possible that a particular |
| 391 | application written in Python makes assumptions about 2-digit years. |
| 392 | |
| 393 | Because Python is available free of charge, there are no absolute guarantees. |
| 394 | If there *are* unforeseen problems, liability is the user's problem rather than |
| 395 | the developers', and there is nobody you can sue for damages. The Python |
| 396 | copyright notice contains the following disclaimer: |
| 397 | |
| 398 | 4. PSF is making Python 2.3 available to Licensee on an "AS IS" |
| 399 | basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY |
| 400 | WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY |
| 401 | REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR |
| 402 | PURPOSE OR THAT THE USE OF PYTHON 2.3 WILL NOT INFRINGE ANY THIRD PARTY |
| 403 | RIGHTS. |
| 404 | |
| 405 | 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON |
| 406 | 2.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS |
| 407 | A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.3, |
| 408 | OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. |
| 409 | |
| 410 | The good news is that *if* you encounter a problem, you have full source |
| 411 | available to track it down and fix it. This is one advantage of an open source |
| 412 | programming environment. |
| 413 | |
| 414 | |
| 415 | Is Python a good language for beginning programmers? |
| 416 | ---------------------------------------------------- |
| 417 | |
| 418 | Yes. |
| 419 | |
| 420 | It is still common to start students with a procedural and statically typed |
| 421 | language such as Pascal, C, or a subset of C++ or Java. Students may be better |
| 422 | served by learning Python as their first language. Python has a very simple and |
| 423 | consistent syntax and a large standard library and, most importantly, using |
| 424 | Python in a beginning programming course lets students concentrate on important |
| 425 | programming skills such as problem decomposition and data type design. With |
| 426 | Python, students can be quickly introduced to basic concepts such as loops and |
| 427 | procedures. They can probably even work with user-defined objects in their very |
| 428 | first course. |
| 429 | |
| 430 | For a student who has never programmed before, using a statically typed language |
| 431 | seems unnatural. It presents additional complexity that the student must master |
| 432 | and slows the pace of the course. The students are trying to learn to think |
| 433 | like a computer, decompose problems, design consistent interfaces, and |
| 434 | encapsulate data. While learning to use a statically typed language is |
| 435 | important in the long term, it is not necessarily the best topic to address in |
| 436 | the students' first programming course. |
| 437 | |
| 438 | Many other aspects of Python make it a good first language. Like Java, Python |
| 439 | has a large standard library so that students can be assigned programming |
| 440 | projects very early in the course that *do* something. Assignments aren't |
| 441 | restricted to the standard four-function calculator and check balancing |
| 442 | programs. By using the standard library, students can gain the satisfaction of |
| 443 | working on realistic applications as they learn the fundamentals of programming. |
| 444 | Using the standard library also teaches students about code reuse. Third-party |
| 445 | modules such as PyGame are also helpful in extending the students' reach. |
| 446 | |
| 447 | Python's interactive interpreter enables students to test language features |
| 448 | while they're programming. They can keep a window with the interpreter running |
| 449 | while they enter their program's source in another window. If they can't |
| 450 | remember the methods for a list, they can do something like this:: |
| 451 | |
| 452 | >>> L = [] |
| 453 | >>> dir(L) |
| 454 | ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', |
| 455 | 'reverse', 'sort'] |
| 456 | >>> help(L.append) |
| 457 | Help on built-in function append: |
| 458 | |
| 459 | append(...) |
| 460 | L.append(object) -- append object to end |
| 461 | >>> L.append(1) |
| 462 | >>> L |
| 463 | [1] |
| 464 | |
| 465 | With the interpreter, documentation is never far from the student as he's |
| 466 | programming. |
| 467 | |
| 468 | There are also good IDEs for Python. IDLE is a cross-platform IDE for Python |
| 469 | that is written in Python using Tkinter. PythonWin is a Windows-specific IDE. |
| 470 | Emacs users will be happy to know that there is a very good Python mode for |
| 471 | Emacs. All of these programming environments provide syntax highlighting, |
| 472 | auto-indenting, and access to the interactive interpreter while coding. Consult |
| 473 | http://www.python.org/editors/ for a full list of Python editing environments. |
| 474 | |
| 475 | If you want to discuss Python's use in education, you may be interested in |
| 476 | joining `the edu-sig mailing list |
| 477 | <http://python.org/community/sigs/current/edu-sig>`_. |
| 478 | |
| 479 | |
| 480 | Upgrading Python |
| 481 | ================ |
| 482 | |
| 483 | What is this bsddb185 module my application keeps complaining about? |
| 484 | -------------------------------------------------------------------- |
| 485 | |
| 486 | .. XXX remove this question? |
| 487 | |
| 488 | Starting with Python2.3, the distribution includes the `PyBSDDB package |
| 489 | <http://pybsddb.sf.net/>` as a replacement for the old bsddb module. It |
| 490 | includes functions which provide backward compatibility at the API level, but |
| 491 | requires a newer version of the underlying `Berkeley DB |
| 492 | <http://www.sleepycat.com>`_ library. Files created with the older bsddb module |
| 493 | can't be opened directly using the new module. |
| 494 | |
| 495 | Using your old version of Python and a pair of scripts which are part of Python |
| 496 | 2.3 (db2pickle.py and pickle2db.py, in the Tools/scripts directory) you can |
| 497 | convert your old database files to the new format. Using your old Python |
| 498 | version, run the db2pickle.py script to convert it to a pickle, e.g.:: |
| 499 | |
| 500 | python2.2 <pathto>/db2pickley.py database.db database.pck |
| 501 | |
| 502 | Rename your database file:: |
| 503 | |
| 504 | mv database.db olddatabase.db |
| 505 | |
| 506 | Now convert the pickle file to a new format database:: |
| 507 | |
| 508 | python <pathto>/pickle2db.py database.db database.pck |
| 509 | |
| 510 | The precise commands you use will vary depending on the particulars of your |
| 511 | installation. For full details about operation of these two scripts check the |
| 512 | doc string at the start of each one. |