SHARE
TWEET

syntax error

krein Oct 22nd, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import re
  2. import os
  3.  
  4.  
  5. basedir = os.path.abspath(os.path.dirname(__file__))
  6. basename = "datafile.txt"
  7. try:
  8.     with open(f"{basedir}/{basename}", "r") as f:
  9.         raw_text = f.read()
  10. except FileNotFoundError:
  11.     print('No file')
  12.  
  13. var = re.findall(r"<html(.*)</html>", raw_text, re.DOTALL)
  14. print(len(var))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top