有没有办法检查Python中的文本文件是否为空而不使用操作系统?
到目前为止我尝试过的
x = open("friends.txt") friendsfile = x.readlines() if friendsfile == None
但我不认为这是正确的方法.
python
python ×1