How to use 'list to excel python' in Python

Every line of 'list to excel python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
44def get_xls_to_list(excelname, sheetname):
45 """
46 读取excel表,返回一个list,只是返回第一列的值
47 return [1,2,3,4,5]
48 """
49 datapath = os.path.join(data_path, excelname)
50 excel = xlrd.open_workbook(datapath)
51 table = excel.sheet_by_name(sheetname)
52 result = [table.row_values(i)[0].strip() for i in range(1,table.nrows)]
53 return result
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code


Related snippets