python · Summary

Python: OverflowError: signed char is greater than maximum

Here the pseudo code about the flow: It runs into the error: with a special character ‘À’  which its binary value is 192 My way to resolve this error is to update typecode of the array from ‘b’ (signed char) to ‘B’ (unsigned char). Reason: Data from the file should not in a range which from… Continue reading Python: OverflowError: signed char is greater than maximum

python · windows

Try ansible on Windows

Background: Here is the environment about NetBrain performance testing: 1 windows server for License/Workspace server 5 windows servers for Network Server 5 windows servers for Automation server It really took us a lot of time to deploy our product/collect logs on theses servers. My colleague wrote a client-server application and try to do the things by… Continue reading Try ansible on Windows


loop a dict to update key

Source dict:              {‘keyA’: ”, ‘keyB’: ”} Expected dict:             {‘keyA/’keyA’ :’’, keyA/keyB’ : ‘’} Code1: keyPrefix = ‘keyA’ for key, value in Dict.items():     newkey = ‘/’.join([keyPrefix, key])     Dict[newkey] = Dict.pop(key) Code2: keyPrefix = ‘keyA’ for key, value in Dict.keys():     newkey = ‘/’.join([keyPrefix, key])     Dict[newkey] = Dict.pop(key)… Continue reading loop a dict to update key

Anaconda · python · sublime text

Python多版本, Sublime text, Anaconda指北

介绍 Sublime text是一款很好用的文本编辑器,更是一款先进的代码编辑器,支持通过插件进行功能扩展。在使用过UltraEditor, Notepad++, vim等等编辑器后,感觉sublime text最好用。 Sublime text是一款收费软件,但只是会弹出提示购买的窗口,功能未做任何限制,在经济能力允许时请一定要购买License。 Sublime text有两个版本sublime text2(停止维护)和sumblime text3,它们支持Linux(32/64 bit)、windows(32/64 bit),OS X(64 bit only)多操作系统,更是提供了免安装的版本(赞赞赞!) Anaconda是Sublime Text的一款插件,它对于Sublime text的Python IDLE如虎添翼。推荐特性:代码格式化、引用错误检查、Go To definition。 安装        Anaconda提供了详细的安装教程,简单的罗列如下。 安装Python我安装了Python3.1和Python3.5,不将其添加至系统path注:Anaconda使用Python3.1时会出现IDLE挂死的情况;而Sublime text + Anaconda能够灵活的设置Python版本,所以个人未不在系统Path变量中设置Python路径(稍后提供相关的配置信息) 安装Sublime text下载安装。喜欢尝试新事物,所以使用新版本 Sublime Text安装package controlSublime Text的插件安装、更新是通过package control进行,简洁、高效!package controller installation instruction 安装AnacondaSublime Text快捷键Ctrl+Shift+P (Tools -> Command Palette) 启用command Palette 回车后输入anaconda  回车,Anaconda的安装就完成了 配置    … Continue reading Python多版本, Sublime text, Anaconda指北