global x file = open(x , "r") extension = file.suffix if extension == '.textmd': Bold = re.search('<bold>(.*)<bold;>', file).group(1) Italic = re.search('<italic>(.*)<italic;>', file).group(1) Underline = re.search('<underline>(.*)<underline;>', file).group(1) Crossout = re.search('<crossout>(.*)<crossout;>', file).group(1) # ... blah blah blah the rest of code else: raise Error("invalid file !!!")
import xyz global x x = "testing.file" print(Italic)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)