包含标签 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 Alpine Android Anpic Ansible Apache Apm Apparmor Appfog Apr Apt-Get Aria2 Array Atlassian Atop Audit Awk AWS Awstats Axel Azure Backdoor Backup Bamboo Bash Bat Benchmark Bigdata Bin Bind Bitwise Blockchain BMC Book Bootstrap Brocade Bsd C1000 Cache Capistrano Catlog CDH5 Centos Centos7 Chatops Chattr Check_mk Checkinstall Cisco CL210 Clickhouse Cloud Cloud-Desktop Cmdb Cms Cobbler Collectd Comm Compress Confd Conver Corosync Cpu Crontab Crunchbang Css Curl C语言 Date DDOS Decode Dell Desktop Devops Df Dhcp Diff Diskpart DISTINCT Django DNS Docker Dos2unix Dpkg Drupal Duckdb EKS ELK Etcd Excel Fail2ban Fastcgi Fdisk Fiddler Find Firewalld Flask Flvtool Ftp Function Fuser GCP Geek Ghost Gin Git Github Gitlab Glances Glusterfs Go Godaddy Golang Google Gooupadd Grafana Graphviz Gravatra Grep Grub2 Hadoop Haproxy Hardware HBA HCIE Heartbeat Helm Hexdump Hhvm History Hotspot Html Http/Html/Web Http/Html/Web Httplogs Https HttpWatch Huawei Huaweicloud Hugo IBM Icmp Iconv Ifconfig IIS InfluxDB Ingress InnoDB Inotify Iopp IOS Ipmitool Iptables Iredmail Iscsi Isito It-News Java JavaScript Jdk Jenkins Jinja2 Jira Join Joomla K3s K8s Kdump Keepalived Kernel Kingate KVM Lamp Last Leetcode Lib 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 Mplayer Mpm Mrtg Mtr My.cnf Mysql Mysqlbinlog Mysqld_multi MySQLdb Mysqldump Mysqlhotcopy Nagios Nc Nethogs Netlify Nexus Nfs Nginx Nmon Nocatlog Node.js Nrpe Ntfs Ntop Ntp Obs Ocr Open-Falcon Openbox Opencv Openldap OpenResty Openssl Openstack Oracle Oswatch Paas Pacemaker Pam Pandas Parted Pcp Pcre Pdf Percona Perl Pexpect Pgrep Php Php-Fpm Ping Plsql Develope PM Postfix PostgreSQL Powershell Prettify Proc Prometheus Puppeteer Pushd Pwgen Pxe Pyecharts Python Python模块 QoS Radmin Raid Rdesktop Read Redhat Redis Redmine Regex Rh134 RH318 RH442 RHCA RHCE Rhel7 Rhel8 RHEV Rm Rman Rootkit Route Rpm Rpmforge Rrdtool RSA Rsync Rsyslog Safe Saltstack Samba Scapy Screen SecureCRT Sed Selenium Selinux Seo Seq Session Set Shc Sheepdog Shell Shopt Sitemap Skydns Smokeping Snffier Snmp Socket Soft Sort Spider Sql Sqlserver Squid SRE Ss Ssh Sshpass Statuscode Strace Strings Su SublimeText2 Sudo Suse Svn Sysbench Syslog-Ng Sysstat Systemd T Tar TC Tcpcopy Tcpdump Tech Telecom Telnet Tencentcloud Tengine Test Testlink Threads Time Tmux Tomcat Touch Tr Tsar Twisted Ubuntu Udev Ulimit Unix Unixbench User-Agent Useradd Varnish VBA 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