项目背景:

1,有2个辅助资料的编码需要做拼接到另外一个字段。编码可能是中文也可能是英文

 

处理方式:

1,a = str(a.fnumber)+','+str(b.fnumber)  如果编码为中文会提示asciis 错误,编码错误。

2,优化的处理方式  a = '{0},{1}'.format(a.fnumber,b.fnumber)  这样就不会有任何提示。

 

相关文章:

  • 2022-01-01
  • 2022-12-23
  • 2021-11-23
  • 2022-01-07
  • 2021-08-08
  • 2022-03-05
  • 2021-10-01
  • 2021-05-07
猜你喜欢
  • 2022-02-04
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案