包含标签 python模块 articles

python之sqlalchemy模块

一、sqlalchemy简介 SQLAlchemy是Python编程语言下的一款开源软件。提供了SQL工具包及对象关系映射(ORM)工具,使用MIT许可证发行。SQLAlchemy“采用简单的Python语言,为高效和高性能的数据库访问设计,实现了完整的企业级持久模型”。SQLAl……

Continue reading

python之pymysql模块

一、pymysql的安装 pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb几乎相同。使用pip工具可以直接进行安装: 1pip install pymysql 二、操作数据库 1、执行SQL语句 1#!/usr/bin/env python 2# -*- coding:utf-8 -*- 3import pymysql 4# 创建连接 5conn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='123', db='t1') 6# 创建游标 7cursor = conn.cursor() 8# 执行SQL,并返回收影响行数 9effect_row = cursor.execute("update hosts set host =……

Continue reading

python PAM30 IE操作模块

之前了解过有一个跨平台、跨语言的自动测试工具selenium ,其可以支持多种浏览器。今天在网上又看到一个简单版的python下的测试模块PAM30。该工具强大又鸡胁。强大之处在于支持几乎所有浏览器操作,鸡胁在于只支持IE和windows平台。以下针对几个小示例看下其功能。 一、登录……

Continue reading

python stock数据包tushare

TuShare是一个免费、开源的python财经数据接口包。主要实现对股票等金融数据从数据采集、清洗加工 到 数据存储的过程,能够为金融分析人员提供快速、整洁、和多样的便于分析的数据,为他们在数据来源方面极大地减轻工作量,使他们更加专注于策略和模型的研究与实现上。考虑到Python p……

Continue reading

国内的Python 量化交易工具

之前也在网上看到贴子有人通过IBM SPSS、pspp这类专业的统计学计算工具对采票号码进行统计计算后,进行概率分析 ,进而投注,一年赚了几万块。姑且不考虑这个故事的真实性。不过最近在知乎上又看到类似的励志故事,这里摘录了过来---科学家有了钱以后,真是挺吓人的。提了这两个引子,进入……

Continue reading

Crawl a website with scrapy

Introduction In this article, we are going to see how to scrape information from a website, in particular, from all pages with a common URL pattern. We will see how to do that with Scrapy, a very powerful, and yet simple, scraping and web-crawling framework. For example, you might be interested in scraping information about each article of a blog, and store it information in a database. To achieve such a thing, we will see how to implement a simple spider using Scrapy, which will crawl the blog and store the extracted data into a MongoDB database. We will consider that you have a working MongoDB server, and that you have installed thepymongoandscrapypython packages, both installable with pip. If you have never toyed around with Scrapy, you should first read this short tutorial. First step, identify the URL pattern(s) In……

Continue reading

Communicating with RESTful APIs in Python

REST defines a way to design an API with which you can consume its ressources using HTTP methods (GET, POST, etc) over URLs. Interacting with such an API basically comes down to sending HTTP requests. In this article, we’ll see which python modules are available to solve this problem, and which one you should use. We’ll test all modules with this simple test case: we would like to create a new Github repository using their RESTful API. Python and HTTP: too many modules One known problem with Python is the abundance of modules enabling HTTP communication: urllib2 httplib httplib2 pycurl requests If you’re totally new to Python, this might be confusing, so let me try to clarify things a little bit. First things first: httplib will not……

Continue reading

yaml在python上的使用

YAML是一种容易人类阅读、适合表示程序语言的数据结构、可用于不同程序间交换数据、支持泛型工具、支持串行处理、丰富的表达能力和可扩展性、易于使用的语言。YAML利用缩进或者是explicit indicatior(如{})来表示属性的嵌套,更为直观和simple。 一、YAML的格式……

Continue reading

python hashlib模块及md5() 、sha()

hashlib模块是python2.5 以后出现的一个包,其主要涉及安全和加密。而且hashlib 得到openssl 的“支持” ,其支持openssl 库提供的所有算法,具体包括md5、sha1、sha224、sha256、sha512等。详细用法,可以通过pydoc hashlib 查看,这里结合两……

Continue reading

python SocketServer实现传输监控数据

python利用SocketServer和multiprocessing实现传输监控数据,分为服务端和客户端,这里通过pickle模块实现数据的条带化,减少空间的占用。由于只是出于演示,这里只传uptime的值过去。 一、服务端 1#!/usr/bin/env python 2import multiprocessing 3import os,sys 4import SocketServer,time 5import pickle 6class MyTCPHandler(SocketServer.BaseRequestHandler): 7 def handle(self): 8 print 'got a connection from:',self.client_address[0] 9 self.data = self.request.recv(1024).strip() 10 if……

Continue reading

Latest articles

Categories

Tags

ACL AD AES AI AWS Ansible Atlassian Azure BMC Blockchain Brocade CDH5 CL210 Cobbler Confd C语言 DDOS DISTINCT DNS Duckdb EKS ELK GCP Ghost Git Glusterfs Go Godaddy Grafana HBA HCIE Hotspot HttpWatch IBM IIS IOS InfluxDB Ingress InnoDB JavaScript Jinja2 KVM Keepalived Mplayer MySQLdb Netlify OpenResty PM PostgreSQL QoS RH318 RH442 RHCA RHCE RHEV RSA SRE SecureCRT Statuscode SublimeText2 TC Telecom Tencentcloud VBA aira2 alpine android anpic apache apm apparmor appfog apr apt-get aria2 array atop audit awk awstats axel backdoor backup bamboo bash bat benchmark bigdata bin bind bitwise book bootstrap bsd c1000 cache capistrano catlog centos centos7 chatops chattr check_mk checkinstall cisco clearall clickhouse cloud-desktop cmdb cms collectd comm compress conver corosync cpu crontab crunchbang css curl date decode dell desktop devops df dhcp diff diskpart django docker dos2unix dpkg drupal etcd excel fail2ban fastcgi fdisk fiddler find firewalld flask flvtool ftp function fuser geek gin github gitlab glances golang google gooupadd graphviz gravatra grep grub2 hadoop haproxy hardware heartbeat helm hexdump hhvm history html http/html/web httplogs https huawei huaweicloud hugo icmp iconv ifconfig inotify iopp ipmitool iptables iredmail iscsi isito it-news java jdk jenkins jira join joomla k3s k8s kdump kernel kingate lamp last leetcode lib light-http linux linux高级篇 ln ls lsi lsof lvm lvs mac mail man mark markdown matplotlib maven memcached microservice mimikatz mkdocs mkpasswd mmonit mod_jk mongodb monit monitor mono moodle mosh mount mpm mrtg mtr my.cnf mysql mysqlbinlog mysqld_multi mysqldump mysqlhotcopy nagios nc nethogs nexus nfs nginx nmon nocatlog node.js nrpe ntfs ntop ntp obs ocr open-falcon openbox opencv openldap openssl openstack oracle oswatch paas pacemaker pam pandas parted pcp pcre pdf percona perl pexpect pgrep php php-fpm ping plsql develope postfix powershell prettify proc prometheus puppeteer pushd pwgen pxe pyecharts python python模块 radmin raid rdesktop read redhat redis redmine regex rh134 rhel7 rhel8 rm rman rootkit route rpm rpmforge rrdtool rsync rsyslog safe saltstack samba scapy screen sed selenium selinux seo seq session set shc sheepdog shell shopt sitemap skydns smokeping snffier snmp socket soft sort spider sql sqlserver squid ss ssh sshpass strace strings su sudo suse svn sysbench syslog-ng sysstat systemd t tar tcpcopy tcpdump tech telnet tengine test testlink threads time tmux tomcat touch tr tsar twisted ubuntu udev ulimit unix unixbench user-agent useradd varnish vbs vercel vi vim visudo vmstat vmware vnc voice vpn vscode vsftp vsftpd vue watchdog web webcam webistrano wget wiki windows wol wordpress workshop wsl x-windows xampp xcache xmllint xtrabackup yule yum zabbix zeromq zip zonetime zookeeper 下载工具 云主机 云原生 代理 加密 古意 吐槽 圈里圈外 娱乐 字符串函数 安全 平台架构 意林 推理 提权 故事汇 故障案例 数据结构 每日看点 民国史 生活 科学记录 站长管理工具 算法 管理 网站架构 翻墙 股票 行业 诗韵 负载均衡 远程管理 面试题

Links

Meta