#coding=utf-8#!/usr/bin/env pythonfrom sqlalchemy import create_engineengine = create_engine('postgresql://ms:ms@localhost:5432/stockpy')from sqlalchemy.ext.declarative import declarative_baseBase = declarative_base()from sqlalchemy import Table,Column, String,Integer,Sequenceclass Test1(Base): __tablename__ = 'test1' id = Column(Integer, Sequence('test1_id_seq'), primary_key=True) name = Column(String(50))ed_t1=Test1(name='fuck python')from sqlalchemy.orm import sessionmakerSession = sessionmaker(bind=engine)session = Session()session.add(ed_t1)session.commit()