Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
| # -*- coding:utf-8 -*- | |
| from pdb import set_trace | |
| from sqlalchemy import create_engine, MetaData | |
| from sqlalchemy import Column, Integer, String, Table, Text | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker | |
| metadata = MetaData() | |
| FIREBIRD = 'firebird+fdb://sysdba:[email protected]:3050//var/lib/firebird/2.5/data/millenium.fdb?charset=ISO8859_1' |
| # -*- coding:utf-8 -*- | |
| ''' | |
| (py3) hdias@hdias-SUPPORT:~/Downloads$ pip install flask | |
| (py3) hdias@hdias-SUPPORT:~/Downloads$ pip install gunicorn | |
| Collecting gunicorn | |
| Using cached gunicorn-19.6.0-py2.py3-none-any.whl | |
| Installing collected packages: gunicorn | |
| Successfully installed gunicorn-19.6.0 | |
| (py3) hdias@hdias-SUPPORT:~/Downloads$ gunicorn exemplo:app |
| # Acertar no standalone.conf.bat | |
| set LC_ALL=pt_BR.UTF-8 | |
| set LANG=pt_BR.UTF-8 | |
| set LANGUAGE=pt_BR.UTF-8 | |
| -Dfile.encoding=UTF-8 -Dclient.encoding.override=UTF-8 |
Goal: Connect to MSSQL using FreeTDS / ODBC in Python.
Host: Ubuntu 11.10 x86_64
Install:
sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy
In /etc/odbcinst.ini:
| <?xml version="1.0" encoding="UTF-8"?> | |
| <kml xmlns="http://earth.google.com/kml/2.0"> | |
| <Document><name><![CDATA[Barraca da Limeira :wikiloc.com]]></name><Style id="lineStyle"><LineStyle><color>F03399FF</color><width>4</width></LineStyle></Style><Style id="waypointStyle"><IconStyle><Icon><href>http://s0.wklcdn.com/wikiloc/images/pictograms/ge/wpt.png</href></Icon></IconStyle><BalloonStyle><text>$[description]</text></BalloonStyle></Style><Folder><name>Trails</name><open>true</open><Folder><open>false</open><name><![CDATA[Barraca da Limeira]]></name><Placemark><name><![CDATA[Barraca da Limeira]]></name><Snippet maxLines="0"/><styleUrl>#m2448438</styleUrl><description><table width="400" style="color:#666"><tr><td colspan="2" align="left"><a href="http://www.wikiloc.com"><img src="http://s0.wklcdn.com/wikiloc/images/wikiloc.png" alt="Wikiloc" /></a></td></tr><tr><td colspan="2"><font style="font-size:14pt;color:#2B60DE"><![CDATA[Barraca da Limeira]]></font></td></tr><tr><td width="40"><img src="http://s0.wklcdn.com |
| -- FALHAS | |
| ALTER TABLE falhas ADD COLUMN id bigserial; | |
| ALTER TABLE falhas ADD CONSTRAINT falhas_pkey PRIMARY KEY (id); | |
| -- CADPECAS | |
| ALTER TABLE cadpecas DROP CONSTRAINT cadpecas_pkey; | |
| ALTER TABLE cadpecas ADD COLUMN id bigserial; | |
| ALTER TABLE cadpecas ADD CONSTRAINT cadpecas_pkey PRIMARY KEY (id); |
| #Matriz visual usada pra montar a matris de adjacência | |
| matriz = [ [0, 1, 2], | |
| [3, 4, 5], | |
| [6, 7, 8], ] | |
| ''' | |
| 0 | 1 2 | |
| --- | |
| 3 4 5 | |
| --- |
| wsimport -keep -verbose <WSDL_URL> |
git config --global core.editor "vim"