Python 集成开发环境——WingIDE License Creater

STEP 1: 安装WingIDE(下载地址:http://wingide.com/downloads);

STEP 2: 新建后缀名为.py的文件(名称随便),将以下代码添加进去,保存;

import sha
import string
BASE2 = ‘01‘
BASE10 = ‘0123456789‘
BASE16 = ‘0123456789ABCDEF‘
BASE30 = ‘123456789ABCDEFGHJKLMNPQRTVWXY‘
BASE36 = ‘0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ‘
BASE62 = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz‘
BASEMAX = string.printable
def BaseConvert(number, fromdigits, todigits, ignore_negative = True):
    """ converts a "number" between two bases of arbitrary digits

    The input number is assumed to be a string of digits from the
    fromdigits string (which is in order of smallest to largest
    digit). The return value is a string of elements from todigits
    (ordered in the same way). The input and output bases are
    determined from the lengths of the digit strings. Negative
    signs are passed through.

    decimal to binary
    >>> baseconvert(555,BASE10,BASE2)
    ‘1000101011‘

    binary to decimal
    >>> baseconvert(‘1000101011‘,BASE2,BASE10)
    ‘555‘

    integer interpreted as binary and converted to decimal (!)
    >>> baseconvert(1000101011,BASE2,BASE10)
    ‘555‘

    base10 to base4
    >>> baseconvert(99,BASE10,"0123")
    ‘1203‘

    base4 to base5 (with alphabetic digits)
    >>> baseconvert(1203,"0123","abcde")
    ‘dee‘

    base5, alpha digits back to base 10
    >>> baseconvert(‘dee‘,"abcde",BASE10)
    ‘99‘

    decimal to a base that uses A-Z0-9a-z for its digits
    >>> baseconvert(257938572394L,BASE10,BASE62)
    ‘E78Lxik‘

    ..convert back
    >>> baseconvert(‘E78Lxik‘,BASE62,BASE10)
    ‘257938572394‘

    binary to a base with words for digits (the function cannot convert this back)
    >>> baseconvert(‘1101‘,BASE2,(‘Zero‘,‘One‘))
    ‘OneOneZeroOne‘

    """
    if not ignore_negative and str(number)[0] == ‘-‘:
        number = str(number)[1:]
        neg = 1
    else:
        neg = 0
    x = long(0)
    for digit in str(number):
        x = x * len(fromdigits) + fromdigits.index(digit)

    res = ‘‘
    while x > 0:
        digit = x % len(todigits)
        res = todigits[digit] + res
        x /= len(todigits)

    if neg:
        res = ‘-‘ + res
    return res

def SHAToBase30(digest):
    """Convert from a hexdigest form SHA hash into a more compact and
    ergonomic BASE30 representation.  This results in a 17 ‘digit‘
    number."""
    tdigest = ‘‘.join([ c for i, c in enumerate(digest) if i / 2 * 2 == i ])
    result = BaseConvert(tdigest, BASE16, BASE30)
    while len(result) < 17:
        result = ‘1‘ + result

    return result
def AddHyphens(code):
    """Insert hyphens into given license id or activation request to
    make it easier to read"""
    return code[:5] + ‘-‘ + code[5:10] + ‘-‘ + code[10:15] + ‘-‘ + code[15:]

LicenseID=‘CN123-12345-12345-12345‘
#Copy the Request Code from the dialog
RequestCode=‘RW517-PKJ4F-WNHT8-YE3F9‘
hasher = sha.new()
hasher.update(RequestCode)
hasher.update(LicenseID)
digest = hasher.hexdigest().upper()
lichash = RequestCode[:3] + SHAToBase30(digest)
lichash=AddHyphens(lichash)

#Calculate the Activation Code
data=[7,123,23,87]
tmp=0
realcode=‘‘
for i in data:
    for j in lichash:
        tmp=(tmp*i+ord(j))&0xFFFFF
    realcode+=format(tmp,‘=05X‘)
    tmp=0

act30=BaseConvert(realcode,BASE16,BASE30)
while len(act30) < 17:
    act30 = ‘1‘ + act30
act30=‘AXX‘+act30
act30=AddHyphens(act30)
print "The Activation Code is: "+act30

STEP3:
时间: 2024-08-06 20:03:38

Python 集成开发环境——WingIDE License Creater的相关文章

[零基础学python]集成开发环境(IDE)

当安装好python之后,其实就已经可以进行开发了.下面我们开始写第一行python代码. 值得纪念的时刻:Hello world 如果是用windows,请打开CMD,并执行python. 如果是UNIX类的,就运行shell,并执行python. 都会出现如下内容: Python 2.7.6 (default, Nov 13 2013, 19:24:16) [GCC 4.6.3] on linux2 Type "help", "copyright", "

windows和linux中搭建python集成开发环境IDE——如何设置多个python环境

本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和linux中搭建python集成开发环境IDE——如何设置多个python环境 Install Python packages on Ubuntu 14.04 from chris' sandbox In this post I will document my setup of Python 2.7

Win 8配置python集成开发环境(Eclipse Mars.1 (4.5.1) Release + python + pydev)

之前有一篇写的是mac 配置Python集成开发环境(Eclipse +Python+Pydev),在2016年来临之际,我打算给我的Windows系统也安装上python的集成开发环境,虽然工作中很少用到python但是我真的喜欢python. 但是在eclipse的官方网站下载最新版本Eclipse Mars.1 (4.5.1) Release,进行安装.安装包启动界面如下: 和以前的安装界面是有差别的,研究了一下我认为是分包处理了,不同的需求安装不同的包,但是有一个公共的插件包,是我们需要

【转】windows和linux中搭建python集成开发环境IDE

http://blog.csdn.net/pipisorry/article/details/39854707 使用的系统及软件Ubuntu / windowsPython 2.7 / python 3Pycharm 2.6.3Openjdk Postgresql 9.1VirtualenvVirtualenvwrapper{开始之前,可以给系统做一下备份.如误安装了Postgresql,出现了大问题就不得不把系统给重装了} 安装python 安装python 1. Ubuntu 12.04系统

在Mac OSX系统中搭建Python集成开发环境

本篇博客分享如何在Mac OSX系统中搭建Python集成开发环境 首先到Python官网下载python,python官网链接 这里选择下载Python2.7.9版本,下载完成之后安装: 安装成功,打开终端: 下面下载python开发的ide,http://www.jetbrains.com/pycharm/ 下载专业版,有30天的免费试用,足够我们学习python了. 安装,将Pycharm拖动到mac应用程序中 创建第一个Python项目: 运行python文件

mac 配置Python集成开发环境

mac 配置Python集成开发环境(Eclipse +Python+Pydev) 1.下载Mac版64位的Eclipse. 进入到Eclipse官方网站的下载页面(http://www.eclipse.org/downloads/),我选择了下图所示的软件包, 浏览器在下载过程中使用的超链接 http://ftp.daum.net/eclipse//technology/epp/downloads/release/mars/R/eclipse-jee-mars-R-macosx-cocoa-x

Python集成开发环境(Eclipse+Pydev)

刚開始学习python,就用Editplus, Notepad++来写小程序, 后来接触了Sublime Text2.认为很不错,没事写写代码.就用编辑器Sublime Text2,最好再配搭一个aptana studio用于调试,很好用. Sublime Text具有美丽的用户界面和强大的功能,比如代码缩略图,Python的插件,代码段等. 还可自己定义键绑定.菜单和工具栏. Sublime Text 的主要功能包含:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切

10个好用的Python集成开发环境简析

Python IDE工具是每个Python工程师必须使用的开发工具,选择正确的编辑器对Python编程效率的影响是非常大的,因此选择合适的Python开发工具十分重要,以下是通过长期实践发掘的好用的Python IDE,它们功能丰富,性能先进,能够帮助开发人员快速的进行应用程序开发. 1. Pydev + Eclipse – 最好的免费python IDE Pydev的是Python IDE中使用最普遍的,原因很简单,它是免费的,同时还提供很多强大的功能来支持高效的Python编程.Pydev是

Python集成开发环境

集成开发环境 IDE:Integrated Development Environment VIM.Emacs #Linux下经典的文本编辑器Eclipse #Java IDE,支持多种语言Visual Studio #微软开发的IDE,支持多种语言notepad++,sublime等Pycharm 主要用于pyth开发的IDE Pycharm使用及相关设置(文件模板)