码迷,mamicode.com
首页 >  
搜索关键字:python input raw_input    ( 165575个结果
Python3.2官方文档翻译--作用域和命名空间实例
6.2.1 作用域和命名空间实例 下面的实例主要用来示范如何引用不同的作用域和命名空间,关键字global和nonlocalru如何影响变量绑定。     实例运行结果是: After local assignment: test spam After nonlocal assignment: nonlocal spam After global assignment: no...
分类:编程语言   时间:2014-04-28 10:46:42    阅读次数:356
Hdu 1042 N! (高精度数)
Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!   Input One N in one line, process to the end of file.   Output For each N, output N! i...
分类:其他好文   时间:2014-04-28 10:36:41    阅读次数:341
Python将JSON格式数据转换为SQL语句以便导入MySQL数据库
前文中我们把网络爬虫爬取的数据保存为JSON格式,但为了能够更方便地处理数据,我们希望把这些数据导入到MySQL数据库中。phpMyadmin可以把MySQL数据库中的数据导出为JSON格式文件,但却不能把JSON格式文件导入到MySQL数据库。为了实现这个目标,可以编写Python脚本将JSON格式数据转换为SQL语句以便导入MySQL数据库。 JSON文件tencent.json...
分类:数据库   时间:2014-04-28 10:33:41    阅读次数:479
Python3.2官方文档翻译--作用域和命名空间
6.2 Python作用域和命名空间 在介绍类之前,首先我想告诉你一些关于python作用域的规则。类的定义非常巧妙地运用了命名空间,你需要知道范围和命名空间的工作原理以能全面了解接下来发生的。 顺便说一下,关于这节讲到的知识对于任何优秀的python程序员非常有用。 让我们开始以一些定义开始。 命名空间(namespace)是一个从名称到对象的映射。大多命名空间目前用Python字典实现的...
分类:编程语言   时间:2014-04-28 10:31:42    阅读次数:309
paip.utf-8,unicode编码的本质输出unicode文件原理 python
paip.utf-8,unicode编码的本质输出unicode文件原理 python      #别的语言,java php都是unicode,走十python不一样.    #enddef  #todo write to unicode encode fileHandle = open ( r"c:\fmtSmpEnRst.txt", 'w',encoding="UTF-16"...
分类:编程语言   时间:2014-04-28 10:28:42    阅读次数:374
Python,带你从小白到Python HelloWorld
写在前面: Why to learn Python?All in picture: 开始正文啦,本文截取了笔记中的部分,其他详细内容稍微会整理呈现在博客中... 本文解决以下问题: 一、什么是Python 二、配置Windows Python环境 三、配置Python的Eclipse开发环境 四、Hello World,Python,waiting f...
分类:编程语言   时间:2014-04-28 10:12:41    阅读次数:400
PyDev的安装(编写Python的Eclipse插件)
PyDev for Eclipse是一个功能强大且易用的Eclipse Python IDE插件,在安装PyDev之前,要保证您已经安装了Java 1.4或更高版本、Eclipse以及Python。接下来,开始安装PyDev插件。   1、启动Eclipse,在Eclipse菜单栏中找到Help栏,选择Help > Eclipse Marketplace   2、在...
分类:编程语言   时间:2014-04-27 22:27:18    阅读次数:437
简洁的BP及RBF神经网络代码
BP神经网络 function [W,err]=BPTrain(data,label,hiddenlayers,nodes,type) %Train the bp artial nueral net work %input data,label,layers,nodes,type %data:dim*n %label:1*n %layers:m:number of hidden layers %...
分类:其他好文   时间:2014-04-27 21:48:00    阅读次数:460
Timus 1120. Sum of Sequential Numbers 数学题
There is no involute formulation concerning factitiously activity of SKB Kontur in this problem. Moreover, there is no formulation at all. Input There is the only number N, 1 ≤ N ≤ 109. O...
分类:其他好文   时间:2014-04-27 21:38:05    阅读次数:544
python获得bing壁纸,并下载到本地
微软bing搜索每天都会换一张壁纸,而且分辨率都高,很适合当做壁纸,写了一个python去获取张壁纸,代码很简单 import urllib import re import time def getHtml(url): return urllib.urlopen(url).read() def getImgUrl(html): reg=re.compile(r'(http:/...
分类:编程语言   时间:2014-04-27 21:31:06    阅读次数:558
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!