分类 perl/php/python/gawk/sed articles

国内的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

python Flask框架下获取用户的IP地址

python Flask框架下获取用户的IP地址的范例代码,下面的代码包含了html页面和python代码,非常详细,如果你正使用Flask,也可以学习一下最基本的Flask使用方法。 <pre class="prettyprint linenums lang-py">from flask import Flask, render_template, request # Initialize the Flask application app = Flask(__name__) # Default route, print user's IP @app.route('/') def index(): ip = request.remote_addr return render_template('index.html', user_ip=ip) if __name__ == '__main__': app.run( host="0.0.0.0", port=int("80") ) html模板代码 <pre class="prettyprint linenums lang-py"> <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"……

Continue reading

chartkick+flask画报表

Chartkick是一个图表绘制工具,特点是UI美观、使用简单,并且支持IE6在内的大多数浏览器。chartkick 可以画 javascript 报表, 界面比较美观 ,其支持加载Google Charts 和 Highcharts图形库,而且支持集成Django, Flask/Jinja2框架 。Flask是一个轻量级的W……

Continue reading

PHP+MySQL实现简易博客

通过php+mysql 实现的简易blog,可以实现增删改查。效果如下图: 一、数据库及表结构 数据库:test 表:micro_blog(仅仅有一个表)字段:id,title,date,content,hits 表结构如下: 1CREATE TABLE `micro_blog` ( 2 `id` int(20) unsigned NOT NULL AUTO_INCREMENT, 3 `title` text NOT NULL , 4 `content` longtext NOT NULL, 5 `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 6 `hits`……

Continue reading

解决Flask-SQLAlchemy中文乱码问题

一、问题 这两天在学习使用flask + SQLAlchemy 定制一个web查询页面的demo ,在测试时,发现查询到的结果显示乱码 。这里将解决方法记录下。 二、解决思路 1、flask 程序上定位 flask的文档中提到可以通过设置SQLALCHEMY_NATIVE_UNICODE来禁止使用SQLAlchemy……

Continue reading

bootstrap+flask+mysql实现网站查询

一、需求 通过 bootstrap(ajax) + flask + mysql 实现一个简单的web查询页面。当输出身份ID信息后,可以查询到相应的结果。最终效果图如下: 二、创建库与表 这里我们先根据需要求创建一个数据库,内容如下: 1#建库 2CREATE DATABASE `web12306` DEFAULT CHARACTER SET utf8; 3#建表 4web12306 | CREATE TABLE `web12306` ( 5 `user_email` varchar(100) NOT NULL DEFAULT '', 6 `user_pass` varchar(100) NOT NULL DEFAULT '', 7 `user_name` varchar(100) NOT NULL DEFAULT '', 8 `user_id` varchar(100) NOT NULL DEFAULT '', 9 `user_nic` varchar(100) NOT NULL……

Continue reading

bootstrap+flask写登录页面

Flask是一个使用 Python 编写的轻量级 Web 应用框架。其 WSGI 工具箱采用 Werkzeug ,模板引擎则使用 Jinja2 。在一般应用或个人开发中,可以很容易的写出应用。本篇就结合bootstrap,写一个简单的login界面。 一、效果图 无图无真像,先上效果图: 二、目录结构 该代码写时采用动静分离的方法进行编写,目录树如下……

Continue reading

php用户注册入库

上一篇 bootstrap+php实现注册页面 中,通过bootstrap + html + php写了一个简单的用户注册页面。本篇结合前一篇的内容,将注册页面上提交的信息post 给后面的页面register.php ,register.php将post的信息提交入库。 一、创建数据库与表结构 1、建库……

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