The problem of python regularization

clipboard.png

-sharp! /usr/bin/env python
-sharp -*- coding:utf-8 -*-
from  selenium  import webdriver
from lxml import etree
import xml.dom
from config import *
import xlrd
import re
class qichacha:
     def __init__(self):
         option=webdriver.ChromeOptions()
         option.add_argument("--start-maximized")
         option.add_argument("--headless")
         self.driver=webdriver.Chrome(chrome_options=option)
     def read_data(self):
         try:
             with open("data.xls","r")as f:

                print(f.read())
                str=f.read()
                company_name=re.findall(r"""<ss:Cell><.*?>(.*?)</ss:Data></ss:Cell>""",str)
                print ("asdasdasd")
                print (company_name)
                -sharp for name in company_name:
                -sharp     if name=="":
                -sharp         pass
                -sharp     else :
                -sharp        print (name)






         finally:
             if f:
                 f.close()
         pass

if  __name__=="__main__":

    qichacha().read_data()





the print here is empty. Why is that? I think there is nothing wrong with my rules, thank you!

Mar.17,2021

if you guess correctly, the problem with these two sentences of code

print(f.read())    -sharp 
str=f.read()       -sharp  str 

try this instead:

str=f.read() 
print(str)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a839-2c237.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a839-2c237.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?