Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
python read file to variable
user61301
Programming language:
Python
2021-08-09 19:50:30
0
Q:
python read file to variable
Rishabh Pratik
Code:
Python
2021-06-04 11:19:48
with open('data.txt', 'r') as file: data = file.read().replace('\n', '')
2
Tags
python
file
variable
var
read
Related
reading and writing data in a text file with python
python output to text file
save python output to text file
how to read and write from a text file in python
python save output to file
python read entire file
python save input to text file
windows how to store filepath as variabley python
read files and write into another files python
read and write to file python
python read text file look for string
how to write a python variable to a file
python get output of command to variable
read entire content of a file using infile python
how to read text file in python
python load a txt file and assign a variable
python use variable in another file
how to reference variable in another file python
python read file and return string
New to Communities?
Join the community