(May-30-2021, 04:39 PM)jefsummers Wrote: What have you tried so far? We will help but not do it for you.
of course not.
i tried this but it does not work
#! Python 3
import openpyxl
import xlrd
loc = ("/home/dell/Bureau/test_python")
workbook = xlrd.open_workbook('test.xls')
worksheet = workbook.sheet_by_name('Sheet1')
wb_obj = openpyxl.load_workbook(loc)
sheet_obj = wb_obj.active
i = 0
j = 0
cell.value = wb_obj(i,j)
cell.value0 = wb_obj(i,j+1)
while cell.value > 0 :
if cell.value0 == None:
cell.value0 = wb_obj(i,j)
i get this error:
Error:
Traceback (most recent call last):
File "python_test.py", line 7, in <module>
wb_obj = openpyxl.load_workbook(loc)
File "/usr/lib/python2.7/dist-packages/openpyxl/reader/excel.py", line 171, in load_workbook
archive = _validate_archive(filename)
File "/usr/lib/python2.7/dist-packages/openpyxl/reader/excel.py", line 118, in _validate_archive
archive = ZipFile(filename, 'r', ZIP_DEFLATED)
File "/usr/lib/python2.7/zipfile.py", line 779, in __init__
self.fp = open(file, modeDict[mode])
IOError: [Errno 21] Is a directory: '/home/dell/Bureau/test_python'
Larz60+ write May-31-2021, 11:00 AM:Please post all code, output and errors (it it's entirety) between their respective tags. Refer to
BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode on future posts.