Execute a Python Macro (Function) From Base and Return Value to Base [closed]
Is it possible to have a python script return a value to LibreOffice Basic function when executed from Base? I am using Ubuntu 14.04 with LibreOffice 4.4.3.2.
For Example- In Base I call the function below with: " If TableExists(strUSBTableName) Then ..."
Function TableExists(strTableName As String) As Boolean
rem http://www.access2base.com/access2base.html
Dim odbDatabase As Object
Set odbDatabase = Application.CurrentDb()
Dim i As Integer
docmd.runCommand("DBRefreshTables")
TableExists = False
With odbDatabase
For i = 0 To .TableDefs().Count - 1
If strTableName = .TableDefs(i).Name Then
TableExists = True
Exit For
End If
Next i
End With
Exit Function
End Function
Can a Python script be used in the code above instead of Basic? I suspect that it won't really be a direct substitution.
Function TableExists(strTableName As String) As Boolean
*** Some python script in here ***
*** Return Some Value to Base (basic) ***
End Function
Hi - Just a complement to the very good response from @doug (as usual). Your question is broader, but you can replace this particular procedure by:
Regards
Thanks for contributing. My knowledge of uno Basic is minimal at best. In this particular case, it appears that I have to use Python to retrieve available disk space since uno Basic can't do that. The response by @doug appears to do that.