import os
a = os.popen('ps axu | grep "jiaoben.py" | grep -v "grep" | wc -l').read()
b = int(a)
def ceshi():
if b == 1:
print('right')
else:
print('error')
c = ceshi()
print(c.__class__)
f = open('HHHhhw.txt','a+')
f.write(c)
我想把结果的 right 和error写入txt文件
但是print出来的c的属性是nonetype
error
Traceback (most recent call last):
File "jiankong.py", line 12, in
f.write(c)
请问大神们应该怎么处理