File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
All Forums
Origin Forum for Programming
Forum for Automation Server/COM and LabVIEW
Problem with python and COM
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
Forum for Automation Server/COM and LabVIEW
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 9.0.0 SR2 Operating System: WIN 10 Hi, I'm trying to control Origin from a Jupyter notebook using Python 3.7 and the originExt and the win32com library. I noticed that both libraries have pros and cons. Right now, I have a problem with the Save COM function. Here is the code i use : import random import win32com.client # COM module # Connect to Origin origin = win32com.client.Dispatch("Origin.ApplicationSI") # Create a new workbook named "Python" using the "origin" template pageName = origin.CreatePage(2, "Python", "origin") # 2 for WorksheetPage # Generate X data to be the even numbers from zero to 100. # Note: the end of range is exclusive xData = range(0,101,2) # Generate Y data to be random numbers yData = [] for i in range(0,len(xData)): yData.append(random.random()) # Put the X and Y data into the worksheet origin.PutWorksheet(pageName, xData, 0, 0) # row 0, col 0 origin.PutWorksheet(pageName, yData, 0, 1) # row 0, col 1 origin.Save("C:\\Users\\Paul\\Downloads\\Orglab93-64bit-116\\bin\\project.opj") and here is the error output : TypeError Traceback (most recent call last) <ipython-input-181-553b0a389dac> in <module> 21 origin.PutWorksheet(pageName, yData, 0, 1) # row 0, col 1 22 ---> 23 origin.Save("C:\\Users\\Paul\\Downloads\\Orglab93-64bit-116\\bin\\project.opj") 24 TypeError: 'bool' object is not callable Am i using the COM function Save the wrong way ? Paul
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000