'''
Created on 04/dic/2018

@author: Maurizio.Mastrofini
'''
#from tkFileDialog   import askopenfilename
from tkinter import filedialog
import sys, os
import win32com.client #imports the pywin32 library
MyLnbUtil=win32com.client.Dispatch("LeCroy.LnbUtil")

lnbpath ="C:\labn"
os.chdir(lnbpath)
print('working directory:{}'.format( os.getcwd() ) )
print('select labnotebook to open')
Myfile = askopenfilename()
lnbpath = os.path.dirname(Myfile)
lnbfile = os.path.basename(Myfile)
MyLnbUtil.Open(Myfile)
print ("----------------------------")
print (MyLnbUtil.ShellTooltip)
print ("-----------------------------")
strExtractedFilenames = MyLnbUtil.ExtractFiles("", "C:\LnbDestFolder1")
print (" list of extracted files in the destination folder:")
os.system("dir C:\LnbDestFolder1\*.*")
print (" list of extracted files in mylist.txt")
os.system("dir C:\LnbDestFolder1\*.* > mylist.txt")
os.system("type mylist.txt")
