[RFC] How to implement command line tool integrating parsing engine

L

llandre

Hi all,

I'd like to have some advices about how to implement a program that has
the following requirements:
- it must run both on linux and windows PC
- it must interact with an electronic device connected to the PC through
serial cable by sending/receiving some command strings and taking
different actions depending on device responses; these strings and
actions must be described in a text file (a sort of script) editable by
user with a simple text editor; the language used to described this
algorithm should be as simple as possible
- initially the program must be written in the form of simple command
line tool that is invoked like this:
program <script_file.txt>
- in the future, it must be possible to develop a graphical frontend on
top of it; the resulting look&feel should be similar on linux and windows.

In this mailing list I was adviced to use python:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/37939

As I never used python, I ask you:
1) about the script file, which language - for which a parsing engine is
already available in python - do you suggest?
2) about the graphical frontend, which graphical libraries do you recommend?


Thanks a lot in advance,
llandre

DAVE Electronics System House - R&D Department
web: http://www.dave.eu
email: r&[email protected]
 
D

Diez B. Roggisch

llandre said:
Hi all,

I'd like to have some advices about how to implement a program that has
the following requirements:
- it must run both on linux and windows PC
- it must interact with an electronic device connected to the PC through
serial cable by sending/receiving some command strings and taking
different actions depending on device responses; these strings and
actions must be described in a text file (a sort of script) editable by
user with a simple text editor; the language used to described this
algorithm should be as simple as possible
- initially the program must be written in the form of simple command
line tool that is invoked like this:
program <script_file.txt>
- in the future, it must be possible to develop a graphical frontend on
top of it; the resulting look&feel should be similar on linux and windows.

In this mailing list I was adviced to use python:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/37939

As I never used python, I ask you:
1) about the script file, which language - for which a parsing engine is
already available in python - do you suggest?

Don't use a home-made-language. Use python itself, together with a lib
of pre-defined functions and hooks.

Python can do the serial communication (google pyserial), and together
with e.g. the execfile-command you can execute the user-provided
commands after initializing your system.
2) about the graphical frontend, which graphical libraries do you
recommend?

Google this group for a PLETHORA of discussions about this very subject.
The answer vary depending on usecase, taste & relative moon humidity.

Diez
 
S

sturlamolden

- it must run both on linux and windows PC
- it must interact with an electronic device connected to the PC through
serial cable

Python should be fine.
- initially the program must be written in the form of simple command
line tool that is invoked like this:
program <script_file.txt>

python script_file.py

- in the future, it must be possible to develop a graphical frontend on
top of it; the resulting look&feel should be similar on linux and windows.

Python has numerous cross-platform GUI libraries.

As I never used python, I ask you:
1) about the script file, which language - for which a parsing engine is
already available in python - do you suggest?

I'd suggest Python...


2) about the graphical frontend, which graphical libraries do you recommend?

wxPython, PyGTK, tkinter, PyQt, or PyGame are some options.

I have started to prefer wxPython together with wxFormBuilder for my
graphical frontends.

http://sturlamolden.blogspot.com/2008/03/howto-using-wxformbuilder-with-wxpython.html
 

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

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top