background preloader


Facebook Twitter

20.16. urlparse — Parse URLs into components — Python 2.7.8 documentation. Note The urlparse module is renamed to urllib.parse in Python 3.

20.16. urlparse — Parse URLs into components — Python 2.7.8 documentation

The 2to3 tool will automatically adapt imports when converting your sources to Python 3. Source code: Lib/ This module defines a standard interface to break Uniform Resource Locator (URL) strings up in components (addressing scheme, network location, path etc.), to combine the components back into a URL string, and to convert a “relative URL” to an absolute URL given a “base URL.” The module has been designed to match the Internet RFC on Relative Uniform Resource Locators.

New in version 2.5: Support for the sftp and sips schemes. The urlparse module defines the following functions: Python - How to download file from ftp? 20.5. urllib — Open arbitrary resources by URL — Python 2.7.8 documentation. Open a network object denoted by a URL for reading.

20.5. urllib — Open arbitrary resources by URL — Python 2.7.8 documentation

If the URL does not have a scheme identifier, or if it has file: as its scheme identifier, this opens a local file (without universal newlines); otherwise it opens a socket to a server somewhere on the network. If the connection cannot be made the IOError exception is raised. If all went well, a file-like object is returned. This supports the following methods: read(), readline(), readlines(), fileno(), close(), info(), getcode() and geturl(). It also has proper support for the iterator protocol. Except for the info(), getcode() and geturl() methods, these methods have the same interface as for file objects — see section File Objects in this manual. The info() method returns an instance of the class mimetools.Message containing meta-information associated with the URL. The geturl() method returns the real URL of the page.

The urlopen() function works transparently with proxies which do not require authentication. 20.8. ftplib — FTP protocol client — Python 2.7.8 documentation. Source code: Lib/ This module defines the class FTP and a few related items.

20.8. ftplib — FTP protocol client — Python 2.7.8 documentation

The FTP class implements the client side of the FTP protocol. How to download a file via FTP with Python ftplib. Python. The Python Tutorial — Python v2.6.5 documentation. Python is an easy to learn, powerful programming language.

The Python Tutorial — Python v2.6.5 documentation

It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms. The Python interpreter and the extensive standard library are freely available in source or binary form for all major platforms from the Python Web site, and may be freely distributed. The same site also contains distributions of and pointers to many free third party Python modules, programs and tools, and additional documentation. The Python interpreter is easily extended with new functions and data types implemented in C or C++ (or other languages callable from C).

This tutorial introduces the reader informally to the basic concepts and features of the Python language and system. The Glossary is also worth going through. DatabaseProgramming. Apprendre à programmer avec Python - Club des décideurs et profe. Les bases de données sont des outils de plus en plus fréquemment utilisés.

Apprendre à programmer avec Python - Club des décideurs et profe

Elles permettent de stocker des données nombreuses dans un seul ensemble bien structuré. Lorsqu'il s'agit de bases de données relationnelles, il devient en outre tout à fait possible d'éviter l'« enfer des doublons ». Vous avez sûrement été déjà confrontés à ce problème : Des données identiques ont été enregistrées dans plusieurs fichiers différents. Lorsque vous souhaitez modifier ou supprimer l'une de ces données, vous devez ouvrir et modifier tous les fichiers qui la contiennent ! Les bases de données constituent la solution à ce type de problème.

Il existe de nombreux types de bases de données. Si la liste n'est pas trop longue, et si l'on ne souhaite pas pouvoir y effectuer des recherches en fonction de critères complexes, il va de soi que l'on peut accéder à ce type de données en utilisant des instructions simples, telles celles que nous avons abordées page 108. MySQL-Python. Package Index : MySQL-python 1.1.10. Python SQL Database Access System. Python - MySQL Database Access.

DatabaseInterfaces. This page lists database interfaces available for Python.


It may also help in finding a suitable database engine for you to use in your Python database applications. The Python standard for database interfaces is the Python DB-API (PEP 249) Most Python database interfaces adhere to this standard. Most databases have ODBC support; see the section below on ODBC modules. Java databases usually support JDBC, and can be used from Jython. See also DbApiModuleComparison ODBC Support See ODBC ADO Support See ADO. How to connect to a MySQL database from python. Python Database API Specification v2.0.

PEP Index> PEP 249 -- Python Database API Specification v2.0 This API has been defined to encourage similarity between the Python modules that are used to access databases.

Python Database API Specification v2.0

By doing this, we hope to achieve a consistency leading to more easily understood modules, code that is generally more portable across databases, and a broader reach of database connectivity from Python. Comments and questions about this specification may be directed to the SIG for Database Interfacing with Python. Writing MySQL Scripts with Python DB-API. Paul Document revision: 1.02 Last update: 2006-09-17 Table of Contents Python is one of the more popular Open Source programming languages, owing largely to its own native expressiveness as well as to the variety of support modules that are available to extend its capabilities.

Writing MySQL Scripts with Python DB-API

One of these modules is DB-API, which, as the name implies, provides a database application programming interface. Command shell access within Python - comp.lang.python.