quote:
The code you let know does not have any equal symbol.
method_int() is mainly used to execute Origin's LabTalk object methods, and it does not require equal sign.
Here its return value is not very helpful, so it is fine not to have equal symbol.
quote:
If there is no way to import separate dat into one book, is there other way such as below?
I suppose there is no python interface to do this yet. (we will check if we could support it later: ORG-27049)
For now you may have to call some LabTalk scripts, like X-Function wAppend:
https://www.originlab.com/doc/X-Function/ref/wAppend
Following is a sample script to merge the imported columns.
import os
import originpro as op
# collect files to be imported
path = os.path.join(op.path('e'), r'Samples\Batch Processing')
csv_files = [os.path.join(path, f) for f in os.listdir(path) if f.endswith('.csv')]
ranges = []
for csvf in csv_files:
wks = op.new_sheet()
dc = op.Connector(wks)
ss = dc.settings()
partial = ss['partial']
partial[op.attrib_key('Use')]='1'
partial['col'] = '2'
dc.imp(csvf)
wks.get_book().method_int('dc.remove')
ranges.append(wks.lt_range())
allsheets = '(' + ','.join(ranges) + ')'
op.lt_exec(f'wAppend -r 0 irng:={allsheets} method:=column ow:=[<new>]<new>;')