Ai
1 Star 0 Fork 1

jack2583/PythonExamples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
binod.py 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
Craig 提交于 2020-10-03 15:19 +08:00 . Merge branch 'master' into patch-3
patch-1
import os #The OS module in python provides functions for interacting with the operating system
patch-3
# function to check if 'binod' is present in the file.
def checkBinod(file):
=======
def checkBinod(file): #this function will check there is any 'Binod' text in file or not
with open(file, "r") as f: #we are opening file in read mode and using 'with' so need to take care of close()
=======
import time
import os
#Importing our Bindoer
print("To Kaise Hai Ap Log!")
time.sleep(1)
print("Chaliye Binod Karte Hai!")
def checkBinod(file):#Trying to find Binod In File Insted Of Manohar Ka Kotha
master
with open(file, "r") as f:
master
fileContent = f.read()
if 'binod' in fileContent.lower():
print(
f'**************Congratulations Binod found in {f}********************')
return True
else:
return False
if __name__ == '__main__':
print("************binod Detector********************")
dir_contents = os.listdir()
for item in dir_contents:
if item.endswith('txt'):
ans = checkBinod(item)
if(ans is False):
print('Binod not found Try Looking In Manohar Ka Kotha!!')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jack2583/pythonExamples.git
git@gitee.com:jack2583/pythonExamples.git
jack2583
pythonExamples
PythonExamples
master

搜索帮助