企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` import http.server import socketserver #import base64 import os import json import pickle PORT = 8000 jsonok = open("treeyuan.json",encoding="utf-8") jsonoka = json.load(jsonok) print(type(jsonoka)) bytejson=pickle.dumps(jsonoka) file = open("test.json","wb+").write(bytejson) #unjson = pickle.load("test.json") with open('test.json', 'rb') as f: model = pickle.load(f) print(type(model)) #en = base64.b64encode(bytejson) Handler = http.server.SimpleHTTPRequestHandler import webbrowser webbrowser.open("http://127.0.0.1:8000") with socketserver.TCPServer(("", PORT), Handler) as httpd: print("serving at port", PORT) httpd.serve_forever() ```