Python 123 获取系统的递归深度、当前执行文件路径、系统最大UNICODE编码值等3个信息


#!/usr/bin/python 3
# -*- coding: UTF-8 -*-

import sys
def maxcode():
    OK = False
    n = 100
    while not OK:
        try:
            s = chr(n)
            n = n+1
        except:
            OK  =True
    return n-1
    
print("RECLIMIT:{}, EXEPATH:{}, UNICODE:{}".format(sys.getrecursionlimit(), sys.executable, maxcode()))

居然自己定义了编码:然后发现系统里有,手动笑脸:

import sys
print("RECLIMIT:{}, EXEPATH:{}, UNICODE:{}".format(sys.getrecursionlimit(), sys.executable, sys.maxunicode))

你可能感兴趣的:(Python,基础)