How to call for file after program is launched.

This is the place for queries that don't fit in any of the other categories.

How to call for file after program is launched.

Postby rnovelo79 » Thu May 23, 2013 8:47 pm

Hello,

First of all I'd just like to say I am very new to python, but I was told this would be my best option so here I am asking for help because I'm more than willing to learn.

I'm trying to write a python script to run on linux, to automate a process whereby an '.exe' application is launched in wine and used to decompress a '.cmp' file.

So far, the code I have launches the '.exe' application to run on wine. My problem is not knowing how to call the '.cmp' file to the application to be decompressed. I would really appreciate some help with ideas on how to achieve this. Below is my code. I am also attaching a screenshot of the application once it's launched in wine.

Code: Select all
#!/usr/bin/python

# DeCmpTool.exe is the application used for decompression
# USRINF_20130522.cmp is the compressed file. A compressed file is generated daily.

import subprocess
filename = "Z:\home\roger\Shared\Scripts\VLR\USRINF_20130522.cmp"
retcode = subprocess.call(["wine", "DeCmpTool.exe"])

# I need part of the script that would allow the app to call for the cmp file and decompress it.

Attachments
decmptool.png
decmptool.png (9.77 KiB) Viewed 293 times
rnovelo79
 
Posts: 2
Joined: Thu May 23, 2013 3:57 am

Re: How to call for file after program is launched.

Postby micseydel » Fri May 24, 2013 1:02 am

He has an older post at another site here, so check that before answering this post).

rnovelo, when you use a program to interact with another program like this, that other program is typically given command line arguments, and you don't interact with its graphical interface. I'm not sure of any way to use this program with a Python script other than by manipulating the mouse (assuming predictable window positions), which honestly I have been unable to do this with Linux in the past (though there's a nice module to do so in Windows).
Join the #python-forum IRC channel on irc.freenode.net!

Please do not PM members regarding questions which are meant to be discussed publicly. The point of the forum is so that others can benefit from it. We don't want to help you over PMs or emails.
User avatar
micseydel
 
Posts: 1354
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: How to call for file after program is launched.

Postby snippsat » Fri May 24, 2013 2:30 am

It`s better to find a tool that can to this without using GUI,like "extrac32.exe"
http://techtrainingnotes.blogspot.no/20 ... files.html

There are not many GUI automation tool for linux,dogtail can work.
Or using a more generic tool like Sikuli
User avatar
snippsat
 
Posts: 215
Joined: Thu Feb 21, 2013 12:04 am

Re: How to call for file after program is launched.

Postby rnovelo79 » Fri May 24, 2013 3:47 pm

Thank you very much for advices guys. I am very grateful. I will definitely look into your suggestions and see which one can work for me.

Thanks again!
rnovelo79
 
Posts: 2
Joined: Thu May 23, 2013 3:57 am


Return to General Coding Help

Who is online

Users browsing this forum: Crimson King, snippsat and 5 guests