Home > other >  Python filter data
Python filter data

Time:01-06

Pray god to save, where the wrong statement?
The from openpyxl import load_workbook, Workbook
> The import glob
>
> Path='F: \ desktop \ \ testing 1'
> Wb=Workbook ()
> Ws=wb. Active
>
> Flag=0
>
> For file in glob. Glob (path + '\ *. XLS') :
. Workbook=load_workbook (file)
. Sheet=workbook. Active
.
. A=sheet/' C '
. Row_lst=[]
. For A cell in A:
. If A "base" in:
. Print (cell. Row)
. Row_lst. Append (cell. Row)
.
. If not flag:
. The header=sheet [1]
. Header_lst=[]
. For the cell in the header:
. Header_lst. Append (cell. The value)
. New_sheet. Append (header_lst)
. Flag=1
.
. For the row in row_lst:
. Data_lst=[]
. For cell in sheet (row) :
. Data_lst. Append (cell. The value)
. New_sheet. Append (data_lst)
.
. Wb. Save (path + '\' + 'eligible for screening new watch. XLSX') File "& lt; stdin>" And line 26 wb. Save (path + '\' + 'eligible for screening new watch. XLSX') ^
SyntaxError: invalid syntax

CodePudding user response:

Try the \ \
  • Related