python - 文件描述符使用什么变量名?

标签 python file naming-conventions explicit variable-names

一个非常愚蠢的琐碎问题。典型的例子是 f = open('filename'),但是

  • f 描述性不强。一段时间不看代码后, 你可以忘记它是否意味着 "file"或“函数 f(x)”或“傅里叶 转换结果”或其他东西。EIBTI。
  • 在 Python 中,file 已被函数占用。

你还用什么?

最佳答案

 data_file
 settings_file
 results_file
 .... etc

关于python - 文件描述符使用什么变量名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1419039/

相关文章:

c# - 私有(private)方法的命名约定 C# - Visual Studio 2017

python - python中的列表索引比较

python - 这个密码重置过程有什么问题吗?

iphone - 如何在 iPhone 上读取设备控制台的内容?

java - 无法生成文件 java.io.IOException : No such file or directory

ruby - 相当于其他语言ruby中方法名的感叹号

c# - 命名局部常量 : UpperCamelCase or lowerCamelCase?

python - 使用 Runge-Kutta 求解耦合微分方程

python - 使用 Python 将 Excel 中的图表导出为图像

python - 需要在 Python 中使用多个文件进行编程方面的帮助