From 218bcf6e49646334e8b6bd9277a1f87d91aa9ce9 Mon Sep 17 00:00:00 2001 From: SumitMalhotra Date: Thu, 1 Oct 2020 22:45:14 +0530 Subject: [PATCH] Update getting_data.py For newbies, the use of certain python keywords should be mentioned in the comment. --- scratch/getting_data.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scratch/getting_data.py b/scratch/getting_data.py index 6f666d6b..68de9325 100644 --- a/scratch/getting_data.py +++ b/scratch/getting_data.py @@ -1,5 +1,6 @@ -# Just stick some data there +# Just stick some data +# with keyword will automatically close the file mentioned in open function with open('email_addresses.txt', 'w') as f: f.write("joelgrus@gmail.com\n") f.write("joel@m.datasciencester.com\n") @@ -330,4 +331,4 @@ def on_error(self, status_code, data): # if instead we wanted to start consuming a sample of *all* public statuses # stream.statuses.sample() -if __name__ == "__main__": main() \ No newline at end of file +if __name__ == "__main__": main()