Python Scripting Questions
Area to discuss python scripting questions.
Using IDEALib.py with german umlaut
Forums
I have a problem with german umlaut (e.g. ä,ü,ö) in py2idea. All umlaut is not shown correctly after import in idea. What can I do?
- Read more about Using IDEALib.py with german umlaut
- 1 comment
- Log in or register to post comments
Read IMD File from Python
Forums
Hi all,
I tried to access one my IMD files directly from Python using this code:
import pyodbc
import pandas as pd
# Define your connection string (this is a generic example and would need to be adjusted)
conn_str = (
"DRIVER={CaseWare IDEA Driver};"
"DSN=NSSO2018;"
"DBQ=D:/2018 database;"
)
- Read more about Read IMD File from Python
- 7 comments
- Log in or register to post comments
How do I send 2 columns as arrays to Python
Forums
Gereetings,I am trying to send two arrays from IDEAScript to Python. I know how to do it with 1 array:
In ISS: Client.RunPythonEx "Macros.ILB\PythonTest.py", array1
In Python: arguments = sys.argv[1] but I don't know how to do it with 2 arrays. How can I send 2 arrays to 1 script?
Any assistance or guidance in resolving this issue would be greatly appreciated.
Thank you.
- Read more about How do I send 2 columns as arrays to Python
- Log in or register to post comments
Idea database to a pandas DF using win32com.client
Forums
Hello everyone! I'm looking to export my database into a pandas dataframe.
When utilizing an internal compiler, the process looks like this:
df = Idea.idea2py(database='mydatabase.idm', client=client)
However, I'd like to use the original Python for its additional debugging features.
import win32com.client as win32client
idea = win32client.Dispatch(dispatch="Idea.IdeaClient")
db = idea.opendatabase("mydatabase.idm")
Execute Python with IDEAScript
Forums
Hello friends,
I'm having trouble running a .py file with IDEA, I need to import 25 million XML files into IDEA, we created a macro that automatically imports the files for us, but it takes a long time to join the databases in IDEA and organize them, we came up with doing a PYTHON file that allows us to do this faster and in a single document, to import into IDEA later.
the file is the following:
- Read more about Execute Python with IDEAScript
- 1 comment
- Log in or register to post comments
Rename a column from within Python, error "Property 'NewField.Type' can not be set."
Forums
Suppose I have a simple task, I want to rename a column. My IDEAScript is as follows:
Sub Main
Call ModifyField()
End Sub
Function ModifyField
Set db = Client.OpenDatabase("myfile.IMD")
Set task = db.TableManagement
Set field = db.TableDef.NewField
field.Name = "newname"
field.Description = "field"
field.Type = WI_CHAR_FIELD
field.Equation = ""
Error when trying to perform IDEAScript extraction in Python
Forums
I have an IDEA file from which I want to perform a simple extraction (column1 equals 6) and save this as a new file. My IDEAScript is as follows (see also attached file):
Sub Main
Call DirectExtraction()
End Sub
Function DirectExtraction
Set db = Client.OpenDatabase("myfile.IMD")
Set task = db.Extraction
Using win32ComClient along with ImportDelimFile in Python to import csv
Forums
My problem is related to this one:
http://www.ideascripting.com/forum/python-import-txt-file
However, slightly different, as I can say for sure that my rdf import definition file is correct.
The task is actually quite simple: I have a csv file, a rdf file and I want to import the csv file into idea. When I do it manually, it works. Now, I need to do it with python code. My code so far is:
import win32com.client as win32ComClient
IDEALib for Python
Forums
HI. I'm recently working with IDEA and Python.I read in the documentation that it is possible to use the IDEALib library.My question is how do I install the library in Pycharm or VSCode?
Do I need to copy from the site package into my Python path?
I have a problem.When I run my script it says No module named 'win32api'
Regards
- Read more about IDEALib for Python
- 4 comments
- Log in or register to post comments
Python: Import TXT File
Forums
Hello, I would like to import a SAP table (txt file) into IDEA using Python.
When running the code I get the following error message:
IDEA.ImportDelimFile(importPath, dbName, False," ", rdfPath, True)
File "<COMObject Idea.IdeaClient>", line 3, in ImportDelimFile
pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, 'Idea.IdeaClient.1', 'Invalid record definition file', None, 0, -2147467259), None)
Can anyone help me?
- Read more about Python: Import TXT File
- 4 comments
- Log in or register to post comments