搜索到与相关的文章
编程技术

WinConsole中文编码问题

一天有个同学在群里问为什么他的控制台窗口无法显示中文了。尝试了不同编译器之后,控制台仍然只能输出乱码。其实控制台还有个小小的秘密。猜测编程初学者(甚至非初学者也)不一定清楚(没有具体统计数据,只能“猜测”了,申明如果与事实不符,本人不承担责任)。大家打开控制台窗口,右键,点击“默认”,可以看到这样一个对话框。对了,“默认代码页”选择语言编码。就这么简单,打完收工。WinConsole中文编码问题

系统 2019-08-12 01:32:50 2782

Python

logging - Logging facility for Python... - Python 的日志记录工具

logging-LoggingfacilityforPython-Python的日志记录工具Thismoduledefinesfunctionsandclasseswhichimplementaflexibleeventloggingsystemforapplicationsandlibraries.这个模块为应用与库定义了实现灵活的事件日志系统的函数与类。ThekeybenefitofhavingtheloggingAPIprovidedbyastand

系统 2019-09-27 17:57:39 2781

Python

selenium+python启动浏览器时可选的自定义选项

1、参数#设定浏览器调用选项,以谷歌为例options=webdriver.ChromeOptions()#设定浏览器启动模式-以iPhone6模式启动mobileEmulation={'deviceName':'iPhone6'}options.add_experimental_option('mobileEmulation',mobileEmulation)#设定浏览器全屏显示options.add_argument("start-maximized"

系统 2019-09-27 17:57:32 2781

Python

C/C++/Qt与 Python 混合编程(2):Qt 调用嵌入python

在Qt的Project中添加一个py文件。然后在test_py.py中的内容如下:#ThisPythonfileusesthefollowingencoding:utf-8#if__name__=="__main__":#passdefhello():print("helloworld!")只有一个hello()函数,Qt就是调用这个hello函数,然后执行,显示hello,world!在上一节的主文件中添加如下代码:PyRun_SimpleString(

系统 2019-09-27 17:56:32 2781

Python

Python实现Xcode自动化打包脚本

#-*-coding:utf-8-*-importrequestsimportosfrombiplistimport*frommod_pbxprojimportXcodeProjectdefCleanDirectory(dirPath):isexits=os.path.exists(dirPath)ifisexits:forroot,dirs,filesinos.walk(dirPath):forfileNameinfiles:del_file=os.pa

系统 2019-09-27 17:54:18 2781

Python

Python:给定数据集计算样本之间的距离矩阵

importnumpyasnpfromsklearn.datasetsimportload_irisiris=load_iris()#data=iris.data#print(data[0])#print(data[2])#print(type(iris.data))#print(iris.data.shape)#LenRow,LenColumn=iris.data.shape#print("LenRow={}".format(LenRow))#print

系统 2019-09-27 17:54:16 2781

Python

Python httplib模块使用实例

httplib模块是一个底层基础模块,实现的功能比较少,正常情况下比较少用到.推荐用urllib,urllib2,httplib2.HTTPConnection对象classhttplib.HTTPConnection(host[,port[,strict[,timeout[,source_address]]]])创建HTTPConnection对象HTTPConnection.request(method,url[,body[,headers]])发送请

系统 2019-09-27 17:50:21 2781

Python

python : pyecharts 1.1.0 画K线图

阅读更多pipinstallpyecharts;会安装pyecharts-1.1.0画K线图kline1.py#coding:utf-8importos,sysfrompyechartsimportoptionsasoptsfrompyecharts.chartsimportKlineiflen(sys.argv)==2:code=sys.argv[1]else:print('usage:kline1.pycode')sys.exit(1)iflen(co

系统 2019-09-27 17:50:05 2781

Python

汉字数字转阿拉伯数字。Python3实现。

可能有些情况没有考虑到。源码python3:#encoding=utf-8importmath#系数CN_NUM={'〇':0,'一':1,'二':2,'两':2,'三':3,'四':4,'五':5,'六':6,'七':7,'八':8,'九':9,'零':0,}#基数CN_UNIT={'十':10,'百':100,'千':1000,'万':10000,'亿':100000000,}#计算中文数字值,返回stringdefcalcCNNumberValue(

系统 2019-09-27 17:46:43 2781

编程技术

In-app Purchase 程序内付费

自从10月16日苹果发送给所有开发者的那一封信,通知了程序内购买将可用于免费应用,我认为这也宣告了LITE版的时代结束。成千上万的免费版的软件或游戏,将作为限制了功能的完整版免费发售,如果用户觉得有意购买,可以直接解锁完整版的功能或购买附加内容。本文讲阐述如何为你现有的应用或游戏添加程序内购买(InAppPurchase)功能。阅读前提:假设了你拥有一定的iPhoneSDK开发基础,和AppStore实践经验。你的程序需要唯一的BundleID,如果已经发

系统 2019-08-29 23:40:10 2781