1. 程式人生 > 其它 >Mac 如何生成ssh public key

Mac 如何生成ssh public key

# 把code.js放在同級目錄下
def tran(): import json import execjs import requests url = "https://fanyi.baidu.com/v2transapi?from=zh&to=en" headers = { "Cookie": "BIDUPSID=50951765EEFD98D694331B5FE6570F71; PSTM=1604473098; BDUSS=BZOFIxTlFBZGNnZ0VEemdsMWRQWUV4cUhwVXg1c0k5R3YyeUpiaE45TGRHTXRmRVFBQUFBJCQAAAAAAAAAAAEAAAACpbI0vqvA4Lj206IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN2Lo1~di6NfTz; BDUSS_BFESS=BZOFIxTlFBZGNnZ0VEemdsMWRQWUV4cUhwVXg1c0k5R3YyeUpiaE45TGRHTXRmRVFBQUFBJCQAAAAAAAAAAAEAAAACpbI0vqvA4Lj206IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN2Lo1~di6NfTz; REALTIME_TRANS_SWITCH=1; FANYI_WORD_SWITCH=1; SOUND_SPD_SWITCH=1; HISTORY_SWITCH=1; SOUND_PREFER_SWITCH=1; BAIDUID=F77F0CCDB2E957ACD87C0481ED1E465A:FG=1; __yjs_duid=1_5255133a8fe5420cb07d73ad073c7df91625632933050; MCITY=-%3A; BAIDUID_BFESS=455F525659F8FA0B42AAD27CD3ADF0A6:FG=1; BDRCVFR[iqrboYocJ-C]=kRxlD0AvOmRPjIMTz4WUvY; delPer=0; PSINO=1; H_PS_PSSID=34068_31254_34863_34711_34584_34518_34710_34812_26350_34760_34473; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; Hm_lvt_64ecd82404c51e03dc91cb9e8c025574=1634356656,1634529015,1634712873,1634807012; __yjs_st=2_NTQwOWM1MTYxYjVlNmMxNDRmYWE0ZTNlYzhhM2NmMGFiMDliMzdmN2ZjZTk5YzAxZmY3Yjc4Njk0YTNjZDk4Y2RjNjM1YTU4NTI5NTQ1YjA0MTJmNWU4ODViYjZhYmMzMzRhMjMyOWNkNjQ3YmZmNzA1NGQwYjQzYWYwMGYxMWQwZDViMTZiNDkwZjJiN2VjN2U5NDYzMjc1ZTFhZTkwYjc0YmY1YjM3YWE1MGU4NDI2NTI3YmUzNDc1Nzc4ZjE4NTc5NWJkMWU3M2ZlOGQ3YmNlODBjODdkZWY1ZjQzZjI2Y2U3OTllZTUxNWNiNzdjMzI0M2E4N2FhYWU4N2I1N183XzA0MTUyNjQ0; Hm_lpvt_64ecd82404c51e03dc91cb9e8c025574=1634807617; ab_sr=1.0.1_YzZlMmZlMDZkZDFmZjE5NTE0YjRlZTY0OGIyOTgyNWIxNzdiN2U5YmM2OThhMTU2ZjFmMjQ5MjlmYTFkNzVkODVjYTExYTU5NmI2MTU5ZmMyYjQwMDM1ZWNkODgzYTQ4ZjAxZGM3Y2YwOWU1Mzc1N2JlZTEzNmYzMDU5YWYzYjU1ZTY4M2Q2NGEyNDY0YzM1ODZmYjBkZGExNTA0M2RlMzc2NmI1YWU5ZTVmYmM2ODMxZDFlN2Y2ODEwMzAwMzlm; BA_HECTOR=a12h8k2g252h00algd1gn2bqf0q", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36" } name = input('請輸入要翻譯的單詞:') with open("code.js", "r")as f: content = execjs.compile(f.read()) sing = content.call("e", name) date = { "from": "zh", "to": "en", "query": name, "transtype": "translang", "simple_means_flag": 3, "sign": sing, "token": "bf2d9db2fec729fb1809600e94e05808", "domain": "common" } res = requests.post(url, headers=headers, json=date).content.decode() res = json.loads(res) for item in res['dict_result']['simple_means']['word_means']: print(item) if __name__ == '__main__': tran()