Aspen Plus Automation in Python

Aspen Plus Automation Code in Python.

ap=AspenPlus()
ap.open_case(r‘pfdtut.bkp‘)
ap.visible=1
print(ap.print_streams())
print(ap.print_blocks())
# ap.run()
print("done")

Test Code

# type ‘pip install pypiwin32‘ to install if missing
import win32com.client

class AspenPlus(object):
    ‘‘‘
        author : bshaoO
    ‘‘‘
    def __init__(self,version=None):
        ‘‘‘constructor‘‘‘
        if not bool(version):
            self.__ihapp = win32com.client.Dispatch(‘Apwn.Document‘)
        else:
            # {‘V9‘:‘35.0‘,‘V10‘:‘36.0‘}
            self.__ihapp = win32com.client.Dispatch(‘Apwn.Document.‘ + version)
    def open_case(self, path):
        self.__ihapp.InitFromArchive2(path,0)
        self.__ihRoot=self.__ihapp.Application.Tree
    def run(self):
        self.__ihapp.Run2()
    def find_node(self,path):
        return self.__ihRoot.FindNode(path)
    def print_streams(self):
        streams=[]
        node=self.find_node(r"\Data\Streams")
        for item in node.Elements:
            streams.append(item.Name)
        return tuple(streams)
    def print_blocks(self):
        blocks=[]
        node=self.find_node(r"\Data\Blocks")
        for item in node.Elements:
            blocks.append(item.Name)
        return tuple(blocks)

    @property
    def visible(self):
        return self.__ihapp.Visible
    @visible.setter
    def visible(self,value):
        ‘‘‘ vale=0, 1 ‘‘‘
        self.__ihapp.Visible=value

AP Class

原文地址:https://www.cnblogs.com/bshao/p/9100739.html

时间: 2024-07-31 13:15:10

Aspen Plus Automation in Python的相关文章

值得学习的python项目

此网站整理的2014年值得一学的pytho项目,http://pycoders.com/2014/ 项目资源都在github上,python程序员进阶必备. 就当作2015年的计划吧.先列表,再对号 Projects 1. robobrowser A library for web scraping built on Requests and BeautifulSoup. Like Mechanize, but with tests, docs, and a Pythonic interface

[Selenium+Java] How to Use Selenium with Python: Complete Tutorial

Original URL: https://www.guru99.com/selenium-python.html How to Use Selenium with Python: Complete Tutorial Selenium supportsPythonand thus can be utilized with Selenium for testing. Python is easy compared to other programming languages, having far

Python著名的lib和开发框架(均为转载)

第一,https://github.com/vinta/awesome-python Awesome Python A curated list of awesome Python frameworks, libraries, software and resources. Inspired by awesome-php. Awesome Python Admin Panels Algorithms and Design Patterns Anti-spam Asset Management A

Python框架、库以及软件资源汇总

转自:http://developer.51cto.com/art/201507/483510.htm 很多来自世界各地的程序员不求回报的写代码为别人造轮子.贡献代码.开发框架.开放源代码使得分散在世界各地的程序员们都能够贡献他们的代码与创新. Python就是这样一门受到全世界各地开源社区支持的语言.Python可以用来开发各种小工具软件.web应用.科学计算.数据分析等等,Python拥有大量的流行框架,比如Django.使用Python框架时,可以根据自己的需求插入不同的模块,比如可以用S

[leetcode]Valid Number @ Python

原题地址:http://oj.leetcode.com/problems/valid-number/ 题意:判断输入的字符串是否是合法的数. 解题思路:这题只能用确定有穷状态自动机(DFA)来写会比较优雅.本文参考了http://blog.csdn.net/kenden23/article/details/18696083里面的内容,在此致谢! 首先这个题有9种状态: 0初始无输入或者只有space的状态1输入了数字之后的状态2前面无数字,只输入了dot的状态3输入了符号状态4前面有数字和有do

Machine and Deep Learning with Python

Machine and Deep Learning with Python Education Tutorials and courses Supervised learning superstitions cheat sheet Introduction to Deep Learning with Python How to implement a neural network How to build and run your first deep learning network Neur

使用python UIAutomation从QQ2016(8.0)群界面获取所有群成员详细资料,

首先到https://github.com/yinkaisheng/Python-UIAutomation-for-Windows下载automation.py和AutomationClient.dll automation.py是我写的一个python封装微软UIAutomation API的一个module,使用非常简单运行automation.py -h查看帮助首先打开qq群聊天窗口,运行automation.py -a,然后3秒内移动鼠标到qq群上其中一个成员上面(下图右下角红框中),等

Awesome Python

Awesome Python  A curated list of awesome Python frameworks, libraries, software and resources. Inspired by awesome-php. Awesome Python Environment Management Package Management Package Repositories Distribution Build Tools Interactive Interpreter Fi

Page Object Model (Selenium, Python)

时间 2015-06-15 00:11:56  Qxf2 blog 原文  http://qxf2.com/blog/page-object-model-selenium-python/ 主题 SeleniumPython We have come a long way since our post on implementing the Page Object Model - Implementing the Page Object Model (Selenium + Python) Whil