The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Python
 Saving Origin File From Python
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hrorigin

USA
3 Posts

Posted - 04/27/2023 :  12:14:24 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 10.0.0.154 OriginPro 2023
Operating System: Windows 10

Hi!

I was recently trying to access and edit an origin project from Python, but I was having trouble saving the project as any edits made in the script were not visible afterward in the project. The version of the op package that I am running is 1.1.4 in Python 3.10.7. Here is an example script that I have tried to run.

import originpro as op

print(op.open("C:/Path/To/File/myProject.opju""))
op.pe.mkdir("TEST")
print(op.project.save("C:/Path/To/File/myProject.opju"))
op.utils.exit()


The output in the terminal will be:
True
False

So the project is loaded correctly, but fails to save. Any help is greatly appreciated! Thanks in advance.

YimingChen

1609 Posts

Posted - 04/27/2023 :  2:34:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Could you use backslash instead? see script below

import originpro as op

print(op.open(r"C:\Path\To\File\myProject.opju"))
op.pe.mkdir("TEST")
print(op.project.save(r"C:\Path\To\File\myProject.opju"))
op.utils.exit()


James

Edited by - YimingChen on 04/27/2023 3:08:40 PM
Go to Top of Page

JacquelineHe

287 Posts

Posted - 12/15/2023 :  06:22:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi hrorigin,

Origin 2024 is available!

Some new features are supported, or issues are fixed.

The issue "op.save() supports slash in path" (ORG-27321) has been fixed in this version.

Please download Origin 2024 from the link below, install and try it.
http://www.originlab.com/demodownload.aspx

We are looking for your feedback! Any suggestion will be appreciated!


Thanks
Jacqueline He
OriginLab

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000