-1

I want to use dull razor software, where in it asks for a source file in it. (Shown in the picture below).

Also another dummy image link needs to be provided.

enter image description here

The execution of the exe file needs to be done using python code. How to pass parameters so that I can run this software?

Any tips or help will be appreciated.

Thank you:)

Jay Patel
  • 1,266
  • 6
  • 20
  • 38
  • 1
    possible duplicate of [how to run an exe file with the arguments using python](http://stackoverflow.com/questions/15928956/how-to-run-an-exe-file-with-the-arguments-using-python) – Celeo Mar 16 '15 at 17:08
  • 1
    In case your question is specifically about passing command-line arguments to **that** program, it's off-topic. – Celeo Mar 16 '15 at 17:09
  • @Celeo Thanks for the link provided. I had found that earlier, but I couldn't understand it. Can I specify the file path in my argument? – Jay Patel Mar 16 '15 at 17:15
  • Certainly. Take a look at the second answer - it includes the full path to the executable file. – Celeo Mar 16 '15 at 17:17
  • 1
    hava a look at [Which is the easiest way to simulate keyboard and mouse on Python?](http://stackoverflow.com/questions/2791839/which-is-the-easiest-way-to-simulate-keyboard-and-mouse-on-python) – stefan Mar 16 '15 at 17:23
  • @stefan thanks a lot, I will have a look at it! – Jay Patel Mar 16 '15 at 17:33
  • @Celeo , what needs to be supplied in place of str(config). Can you throw some light on config command? – Jay Patel Mar 16 '15 at 17:33
  • `config` in that question is just part of the arguments to that executable. All you need is `subprocess.call('C:/path/to/file.exe -argument1 -argument2')` etc. – Celeo Mar 16 '15 at 17:35
  • @Celeo thanks for the last comment! The program actually opened. But according to my question, how can I provide two source files and automatically click start button? I cant use the software browse button because the code will run behind the scenes. – Jay Patel Mar 16 '15 at 21:24
  • That's dependent on that software itself if it provides such a command-line option. If it doesn't, you have the option of using a program like [AutoHotkey](http://www.autohotkey.com/) to click the button. – Celeo Mar 16 '15 at 22:04
  • @stefan any idea how to insert text when there are two text boxes. It is a conflict situation! As provided in the picture in the question, there are two editboxes. – Jay Patel Mar 17 '15 at 11:38
  • never tried it by myself. you did hav a look at the pywinauto [FAQ](http://pywinauto.pbworks.com/w/page/9546214/FAQ)? – stefan Mar 17 '15 at 23:08

1 Answers1

0

After searching a lot for how to automate a software.

I found sendkeys very useful.

It took a lot of time to install sendkeys on python 2.7 and also its website was shut. So it was a nice experience to install it with the help of Mingw

Here is what I write in my python code:

import win32com.client
import subprocess
shell = win32com.client.Dispatch("WScript.Shell")
shell.AppActivate("DullRazor for Windows")
shell.SendKeys("{TAB}", 0)

And so on to automate the software according to my needs.

Thank you @Celeo and @stefan

Jay Patel
  • 1,266
  • 6
  • 20
  • 38