Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Browsing all 9596 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

[Python] 网络爬虫实战:网站链接的初级爬取

[python] 网络爬虫实战:网站链接的初级爬取 3小时前来源:cnblogs 闲来无事,想要学习一下Python,十月初的时候搭好了ubuntu的环境,用的是Ubuntu 16.04 32位+sublime...

View Article


Python内置函数(26)――globals

英文文档: globals ( ) Return a dictionary representing the current global symbol table. This is always the dictionary of the current module (inside a function or method, this is the module where it is...

View Article


Python内置函数(27)――hasattr

英文文档: hasattr ( object , name ) The arguments are an object and a string. The result is True if the string is the name of one of the object’s attributes, False if not. (This is implemented by calling...

View Article

scriptworker 0.8.2 and 0.7.2

Tl;dr: I shipped scriptworker 0.8.2 ( changelog ) ( github ) ( pypi ) and scriptworker 0.7.2 ( changelog ) ( github ) ( pypi ) last Monday (Oct 24), and am only now getting around to blogging about...

View Article

uWSGI and Nginx deploy Django project

version django version:1.6 os version: Centos 6.2 nginx version: 1.4.2 uwsgi version: 2.0.8 python version: 2.7.5 directory django project is in /home/erya/hawk and settings.py is at...

View Article


我们为什么从Python转到go?

说完了python,现在来说说为什么我们选择go。其实除了Python,我们也有其他的选择,Java、php、Lua(openresty),但最终我们选择了go。...

View Article

Image may be NSFW.
Clik here to view.

微博话题爬取与存储分析

大数据社会数据就是黄金,新浪微博作为一个国内网络社交早就意识到这一点,本着资本家和商人的心态给你提供的开放API接口只可以获得少量无关紧要的数据(想要数据,money来换),对比国外Twitte等社交平台会提供一些数据接口供研究人员获取大量研究数据。那我们GEEK的口号是,凡是网上能显示数据的朕兼“可取”(v_v…为什么加个引号呢,因为虽然出于技术角度是都可取得,但出于道德方面考虑也要尊重数据作者的...

View Article

Image may be NSFW.
Clik here to view.

周末小课堂:大数据除了Hadoop,还有Scrapy

1、先来扯扯 大数据 互联网+概念的兴起,中国的创业者几乎把互联网+这趟车开进了所有领域,传统领域的商家人心惶惶,言必谈互联网+,仿佛不套点互联网的概念都不好意思宣传自家产品;而赶在这波潮流之前的正是燥热至今的“ 大数据 ”。 在这个上到各界研究机构、管理部门、企业,下到各大论坛、媒体、甚至商贩都能跟你聊“大数据”,你是不是觉得不拽点词儿都不敢出门。...

View Article


Image may be NSFW.
Clik here to view.

Deform 2.0

Deform 2.0 has been released. Deform is a python form library for generating HTML forms on the server side. Date and time picking widgets , rich text editors , forms with dynamically added and removed...

View Article


Image may be NSFW.
Clik here to view.

Python 抓取微信公众号账号信息

搜狗微信搜索提供两种类型的关键词搜索,一种是搜索公众号文章内容,另一种是直接搜索微信公众号。通过微信公众号搜索可以获取公众号的基本信息及最近发布的10条文章,之前写过一篇《 python 抓取微信公众号文章 》,今天来抓取一下微信公众号的账号信息( 先看结果(2998条) :查看原文 )。 爬虫 首先通过首页进入,可以按照类别抓取,通过“查看更多”可以找出页面链接规则: import...

View Article

在Python中调用Java扩展包:HanLP

最近在研究中文分词及自然语言相关的内容,关注到JAVA环境下的 HanLP...

View Article

Image may be NSFW.
Clik here to view.

The Python 2.6 Tipping Point Has Arrived

It’s been exactly three years since the last release of python 2.6, and yet it’s still hanging around like some kind of living-dead zombie. What should we do about it? A few months ago I was working on...

View Article

Watching You Drink Beer

I noticed that many people on Twitter publish when they use the Untappd.com application. This app allows a user to “check-in” when they drink beer. They get badges, the dates and times of their...

View Article


Image may be NSFW.
Clik here to view.

Discussing The Basics of Django With You

You:Django?? What is it? Me:Do you know about python? You:Yes, I have abasic idea of python. It is a scripting language. Me:Yes, and? You:It is a multi-paradigm, object-oriented, structured...

View Article

Image may be NSFW.
Clik here to view.

说说Python中的闭包 - Closure

python中的闭包不是一个一说就能明白的概念,但是随着你往学习的深入,无论如何你都需要去了解这么一个东西。 闭包的概念 我们尝试从概念上去理解一下闭包。 在一些语言中,在函数中可以(嵌套)定义另一个函数时,如果内部的函数引用了外部的函数的变量,则可能产生闭包。闭包可以用来在一个函数与一组“私有”变量之间创建关联关系。在给定函数被多次调用的过程中,这些私有变量能够保持其持久性。 ―― 维基百科 )...

View Article


python之文件

文件打开函数:f = open 表1-1:open函数中模式参数常用值 打开模式 描述 ‘r’ 读模式 ‘w’ 写模式 ‘a’ 追加模式 ‘b’ 二进制模式 ‘+‘ 读/写模式 表1-2:文件对象方法 文件对象方法 执行操作 f.close() 关闭文件 f.read(size = -1) 从文件中读取size个字符,当未给定size或给定负值的时候,读取剩余的所有字符,然后作为字符串返回...

View Article

一个命令行的 TexturePacker 拆解工具 (二)

距离第一版的 untp 发布已经有一年半的时间了, 在这个项目上我收获了很多的第一次: 第一次有一个项目的 star 数超过 50 第一次往 pypi 上上传项目 第一次如此认真的维护一个项目 … 这篇文章已经是关于 untp 的第三篇文章了, 所有的文章列表可以查看这里. 下面我来讲讲 untp 最近的几次更新以及后续的一个维护计划. 一. 更新 1.0.5 拆解单个文件时支持 -o...

View Article


Image may be NSFW.
Clik here to view.

Python开发程序:学员管理系统(mysql)

主题:学员管理系统 需求: 用户角色,讲师\学员, 用户登陆后根据角色不同,能做的事情不同,分别如下 讲师视图: 管理班级,可创建班级,根据学员qq号把学员加入班级 可创建指定班级的上课纪录,注意一节上课纪录对应多条学员的上课纪录, 即每节课都有整班学员上, 为了纪录每位学员的学习成绩,需在创建每节上课纪录是,同时为这个班的每位学员创建一条上课纪录 为学员批改成绩, 一条一条的手动修改成绩...

View Article

Image may be NSFW.
Clik here to view.

How I accidentally deleted all my Python modules and got it back in 20 minutes

Today I was careless and it made me some trouble. I was working on a Flask web app and wasn’t using virtualenv due to my laziness. I just wanted a prototype up-and-running ASAP on Heroku. In order to...

View Article

JSON Web Tokens in django application- part three

As we have working application now it's high time to make it more secure by authenticating users. To do this I will use JSON Web Tokens. Table of Contents: JWT in Django Rest Framework Implementing JWT...

View Article
Browsing all 9596 articles
Browse latest View live