background preloader

Python

Facebook Twitter

GettingStarted - pyodbc - Quick Examples To Get You Started - Python ODBC library. Make a direct connection to a database and create a cursor. cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=localhost;DATABASE=testdb;UID=me;PWD=pass')cursor = cnxn.cursor() Make a connection using a DSN. Since DSNs usually don't store passwords, you'll probably need to provide the PWD keyword. cnxn = pyodbc.connect('DSN=test;PWD=password')cursor = cnxn.cursor() There are lots of options when connecting, so see the connect function and ConnectionStrings for more details. Select Basics All SQL statements are executed using the cursor.execute function. Cursor.execute("select user_id, user_name from users")row = cursor.fetchone()if row: print row Row objects are similar to tuples, but they also allow access to columns by name: cursor.execute("select user_id, user_name from users")row = cursor.fetchone()print 'name:', row[1] # access by column indexprint 'name:', row.user_name # or access by name The fetchone function returns None when all rows have been retrieved.

Parameters Some databases (e.g. Pyodbc - Python ODBC library. Pyodbc is a Python 2.x and 3.x module that allows you to use ODBC to connect to almost any database from Windows, Linux, OS/X, and more. It implements the Python Database API Specification v2.0, but additional features have been added to simplify database programming even more. pyodbc is licensed using an MIT license, so it is free for commercial and personal use. You can even use the source code in your own projects. Installers for Windows are available here and most Linux distributions are starting to provide pre-compiled packages. Full source code is also available. New to pyodbc? Added context manager support to Cursor Added padding for driver bugs writing an extra byte Cursor.executemany now accepts an iterator or generator. Compilation improvements for FreeBSD, Cygwin, and OS/X Use SQL_DATA_AT_EXEC instead of SQL_DATA_LEN_AT_EXEC when possible for driver compatibility.

Row objects can now be pickled. Added Cursor.commit() and Cursor.rollback(). Added readonly keyword to connect. PhoneGap | Home. Learn Python The Hard Way, 2nd Edition — Learn Python The Hard Way, 2nd Edition. Common ways to connect to odbc from python on windows? HowTo get CDP neighbor information through Python and SNMP. This new script is for Network Engineers and System Engineers a like. Though I must admit it is more for the System Engineers who do not have access to the command line on the CDP enabled device.

Have you ever wanted to know what CDP enabled devces ( and info related to those devices ) that were directly connected to your your Core Switch? But you just do not have the access to get that info. But you do have access to the monitoring system, which has SNMP access to the Core Switch. Well this is where my script comes into play... Stay tuned for updates, as I'm planning on adding to this script. So you can run it with the detail option and a detail port option. Revision 1.2 9/13/2009 Catch all CDP connected switches, even if there is more then 1 switch seen through 1 port. Revision 1.1 9/11/2009 Added –type option ( –type=detail ) Revision 1.0 9/10/2009 This script is the equivalent of sho cdp nei on a cisco switch, but this is using snmp.

HowTo Manage your networked devices using Python and Pexpect | LinuxDynasty. This is my first release of ldNetDeviceManager.py. The ldNetManager.py tool gives you the ability to manage your network devices with out having to purchase a product like Cisco’s LMS or go through the planning phase of deploying a product like func. Each of the tools I mentioned before, only have the ability to manage devices in their realm. Func supports Linux devices and Cisco LMS supports only Cisco devices. This tool has one goal. And that is to update your devices with out deploying any software to your remote devices.

All you need is either telnet or ssh access to your devices and Python2.4 or better with Pexpect installed. You will need Python 2.4 or better and Pexpect. ( has not been tested with Python 3+ ) You can get Python from and Pexpect ( I’m currently using Pexpect 2.3, which you can get from SourceForge. Network Device Manager Download For support. please check the forums, . Another example. Pexpect - Pure Python Expect-like module. Logo. Getting Started with Android. Welcome to Xamarin.Android! Once the installation is complete, follow these simple instructions to write and test your first Android C# code in minutes! You can also visit our Developer Center. 1.1.

Running the Sample Application First, let’s open the Tasky sample application, which can be done in either Xamarin Studio or Visual Studio. The solution and project structure in the Solution pane shows all the files in the solution and should look familiar to any Modern IDE user. If you cannot see the solution tree, choose from the menu. Check that the Debug configuration is selected in the toolbar and choose from the menu or press Command + Return to start debugging with the Android Emulator.

Before an emulator can start you need to choose an Android Virtual Device (AVD) to use, as shown in these screens: Once the emulator has started you can add some tasks to see how the application works - touch the button to begin! 1.2. User Interface - The screens, controls and data presentation code. 2.1. OpenShift by Red Hat. Code.org | Dedicated to growing computer programming education. Online Python Tutor - Learn programming by visualizing code execution.

PhoneGap | Home. Enyo JavaScript Application Framework. Udacity. GettingStarted - pyodbc - Quick Examples To Get You Started - Python ODBC library. Learn Python Programming. Pyodbc - Python ODBC library. A Byte of Python. Learn Python The Hard Way, 2nd Edition — Learn Python The Hard Way, 2nd Edition. Python.