Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
python read text file look for string
Anon
Programming language:
Python
2021-08-13 21:03:04
0
Q:
python read text file look for string
xizdaqrian
Code:
Python
2021-07-11 13:54:03
f = open(filename, "r") whattoReturn = "None" if strToFind in f.read(): whattoReturn = strToFind
1
Tags
string
python
file
text
read
text file
Related
python output to text file
Write a Python program to read an entire text file
read txt file pandas
reading and writing data in a text file with python
how to get python to extract information from a text file
how to read text file in python
python reading lines from a text file
how to read a text file line by line in python
how to read and write from a text file in python
python read file in string list
save python output to text file
getting vocab from a text file python
python read text file into a list
how to read a specific line from a text file in python
python save input to text file
python glob how to read all txt files in folder
python read text file into string
python read file and return string
New to Communities?
Join the community