应用开发

还在用print()语句来调试Python代码?快停止吧

时间:2010-12-5 17:23:32  作者:IT科技   来源:域名  查看:  评论:0
内容摘要:用print()的缺点我就是使用print()语句调试代码的人之一。有些时候,如果代码很长,那么就会有更多的打印,需要使用多个符号来相互区分。看看下面的代码片段。(本博客中的代码片段,遵循Python

用print()的还用缺点

我就是使用print()语句调试代码的人之一。有些时候,句调如果代码很长,亿华云码快那么就会有更多的停止打印,需要使用多个符号来相互区分。还用

还在用print()语句来调试Python代码?快停止吧

看看下面的句调代码片段。站群服务器(本博客中的码快代码片段,遵循Python 3.7的停止语法)

还在用print()语句来调试Python代码?快停止吧

print(style_dict,"{ { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { }}}}}}}}}}}}}}}}}}}}}}}}}}]]]]]]]]]]]]]]]]]]]") # Adding into a dictionary res_dct = { style_dict[i]: style_dict[i + 1] for i in range(0, len(style_dict), 2)} res_dist={ res_dct[Email Address]:{ style_dict[i]: style_dict[i + 1] for i in range(0, len(style_dict), 2)}} print(res_dist,"+++++++++++++++++++++++++++++++++++++++++++++++++++++") recon_dict = res_dct print(recon_dict,"---------------------------------------------------") # Removing space so that data can be transferred to HTML fields recon_dict = { x.translate({ 32: None}): y               for x, y in list(recon_dict.items())} print("##################################################") print(recon_dict) print("################################################") # Converting to JSON r = json.dumps(recon_dict) print("

$") print(r) loaded_json = json.loads(r) print("WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWwwwwww") print("

还在用print()语句来调试Python代码?快停止吧

copyright © 2025 powered by 益强资讯全景  滇ICP备2023006006号-31sitemap