looking for some libraries

V

Vision

hi all,
I am doing some stuffs with some software, which has similar layout
like this:
Editbox________1
Editbox________2
Editbox________3
_OK_
_______________
| output |
| output |
| output |
| output |
| output |
--------------------------
What I need to do is to fill the edit boxes, then press the OK button,
then I will get some output text below.
This is tedious since I have lots of entries to deal with.
So I am trying to write some scripts to handle this. And I wonder if
there is any library available for me to simplify the process?
Thanks!
 
R

rantingrick

hi all,
I am doing some stuffs with some software, which has similar layout
like this:
Editbox________1
Editbox________2
Editbox________3
       _OK_
_______________
|        output        |
|        output        |
|        output        |
|        output        |
|        output        |
--------------------------
What I need to do is to fill the edit boxes, then press the OK button,
then I will get some output text below.
This is tedious since I have lots of entries to deal with.
So I am trying to write some scripts to handle this. And I wonder if
there is any library available for me to simplify the process?
Thanks!

Well a GUI kit comes to mind. And since you did not mention a
preference (or much really) i would suggest Tkinter in the stdlib as a
starting point. Here is a big hint!

#-- start code --#
import Tkinter as tk

def fooit():
lister.insert(END, entry1.get())

app = tk.Tk()

label1 = tk.Label(app, text='label-1').grid(row=0, column=0)
entry1 = tk.Entry(app).grid(row=0, column=1)
tk.Button(app, text='OK', command=fooit).grid(row=1, column=0,
columnspan=2)
lister = tk.Listbox(app, width=20, height=10)
lister.grid(row=2, column=0, columnspan=2)

app.mainloop()
#-- end code --#

i would wrap the label and entry up into a class myself but milage may
vary.
 
R

rantingrick

@Vision

Its nice to start with examples that don't crash, so try this
instead ;D

import Tkinter as tk

def fooit():
lister.insert('end', entry1.get())

app = tk.Tk()

label1 = tk.Label(app, text='label-1').grid(row=0, column=0)
entry1 = tk.Entry(app)
entry1.grid(row=0, column=1)
tk.Button(app, text='OK', command=fooit).grid(row=1, column=0,
columnspan=2)

-- there are no redo's in Usenet!!

lister = tk.Listbox(app, width=20, height=10)
lister.grid(row=2, column=0, columnspan=2)

app.mainloop()
 
J

Jean-Michel Pichavant

Vision said:
hi all,
I am doing some stuffs with some software, which has similar layout
like this:
Editbox________1
Editbox________2
Editbox________3
_OK_
_______________
| output |
| output |
| output |
| output |
| output |
--------------------------
What I need to do is to fill the edit boxes, then press the OK button,
then I will get some output text below.
This is tedious since I have lots of entries to deal with.
So I am trying to write some scripts to handle this. And I wonder if
there is any library available for me to simplify the process?
Thanks!

Someone posted this link few weeks ago:
http://www.sikuli.org/

It supports only mac & windows though.

You can also have a look at
http://pywinauto.openqa.org/

JM
 
M

Michael Torrie

rantingrick said:
Well a GUI kit comes to mind. And since you did not mention a
preference (or much really) i would suggest Tkinter in the stdlib as a
starting point. Here is a big hint!

I think the original poster is looking for a way to automate an existing
GUI process, and screen-scrape the resulting output from this existing GUI.

He does not say what OS he is working on, so it's hard to really suggest
anything. If he's on Windows, I'd give a look at AutoIt[1], which has
its own complete programming language. I know with AutoIt I could click
on buttons and then scrape text from an edit box. AutoIt probably has
the ability to write this data out to a file as well. Not Python, but hey.

[1] http://www.autoitscript.com/autoit3/index.shtml
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top