473,657 Members | 2,896 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Should I use Python for these programs?

CC
Hi:

I have considerable C and assembly language experience. However, these
are mostly on embedded microcontroller s since I moved away from PC
programming all the way back in 1988 :-O

I wish to accomplish a few PC programming tasks, and am considering to
learn Python:

1. Develop a simple GUI program to run on Linux and Windows which can
send parameters and small blocks of data to an embedded microcontroller
device via RS-232 or USB. Also display simple data (probably single
numbers) sent from the device.

Note, if it is USB, then the client will be implemented by me using FTDI
chips that appear to the PC as a serial port.

2. Develop a simple vector drawing program that will allow one to
freehand draw a sketch composed of a few lines, or perhaps render text
in a vector form. Then sample the lines with a certain (user
configurable) spacing, and use the mouse to move the sample points along
the lines to tweak the sample locations if desired. Then output a file
of X,Y coordinates for the samples.

What is this crazy thing for? It's to develop simple lasershow vector
frames. I am also designing a DSP-based lasershow output device, so the
same capabilities of delivering a data payload over serial/USB to a
target device will be needed here as well.

I would prefer to be able to write a program that is cross-platform
between Linux and Windows. I realize this might be especially
problematic with the serial comms.

I am also confused by the plethora of Python GUI extensions, though
Tkinter seems like a likely candidate. I am uncertain if I will have
difficulty learning how to use this if I don't know Tcl/Tk.

Do you think Python is the right language for these projects?

Any input will be appreciated.
--
_______________ ______
Christopher R. Carlen
cr***@bogus-remove-me.sbcglobal.ne t
SuSE 9.1 Linux 2.6.5
Jul 10 '07 #1
10 1539
On 2007-07-10, CC <cr***@BOGUS.sb cglobal.netwrot e:
I wish to accomplish a few PC programming tasks, and am
considering to learn Python:

1. Develop a simple GUI program to run on Linux and Windows
which can send parameters and small blocks of data to an
embedded microcontroller device via RS-232 or USB. Also
display simple data (probably single numbers) sent from the
device.

Note, if it is USB, then the client will be implemented by
me using FTDI chips that appear to the PC as a serial port.
I do a lot of that sort of thing using Python. I'd probably
recommend using pyserial and wxWidgets. Both are
cross-platform.

http://pyserial.sourceforge.net/
http://www.wxpython.org/

In any case, both "normal" PC serial ports and USB-serial ports
looks the same to a Linux app. Windows support for stuff like
that wasn't so good last time I tried, but it's supposed to work.
2. Develop a simple vector drawing program that will allow one
to freehand draw a sketch composed of a few lines, or
perhaps render text in a vector form. Then sample the
lines with a certain (user configurable) spacing, and use
the mouse to move the sample points along the lines to
tweak the sample locations if desired. Then output a file
of X,Y coordinates for the samples.

What is this crazy thing for? It's to develop simple
lasershow vector frames. I am also designing a DSP-based
lasershow output device, so the same capabilities of
delivering a data payload over serial/USB to a target
device will be needed here as well.
Most of the graphics I do with Python is with Gnuplot (not
really appropriate for what you want to do.
wxWidgets/Floatcanvas might be worth looking into.
I would prefer to be able to write a program that is cross-platform
between Linux and Windows. I realize this might be especially
problematic with the serial comms.
Not at all. Cross-platform serial stuff is easy.
I am also confused by the plethora of Python GUI extensions,
though Tkinter seems like a likely candidate. I am uncertain
if I will have difficulty learning how to use this if I don't
know Tcl/Tk.

Tk's canvas widget is pretty powerful, and you don't need to
know Tcl -- it's all hidden behind a veneer of Python.
Do you think Python is the right language for these projects?
It's what I use for stuff like that.

--
Grant Edwards grante Yow! MERYL STREEP is my
at obstetrician!
visi.com
Jul 10 '07 #2
On Jul 10, 5:09 am, CC <c...@BOGUS.sbc global.netwrote :
2. Develop a simple vector drawing program that will allow one to
freehand draw a sketch composed of a few lines, or perhaps render text
in a vector form. Then sample the lines with a certain (user
configurable) spacing, and use the mouse to move the sample points along
the lines to tweak the sample locations if desired. Then output a file
of X,Y coordinates for the samples.
You may look at dia for that.

Michele Simionato
Jul 10 '07 #3
"CC" <cr***@BOGUS.s. ...l.netwrote:
>
I have considerable C and assembly language experience. However, these
are mostly on embedded microcontroller s since I moved away from PC
programming all the way back in 1988 :-O
Your experience parallels mine, except that mine has a surfeit of assembler...
>
I wish to accomplish a few PC programming tasks, and am considering to
learn Python:
go for it - you will be delighted with the simplicity of the complex stuff,
and irritated at the hoops that you have to jump through to do low level stuff,
but the trade off is worth the pain.
>
1. Develop a simple GUI program to run on Linux and Windows which can
send parameters and small blocks of data to an embedded microcontroller
device via RS-232 or USB. Also display simple data (probably single
numbers) sent from the device.
If you spend a bit of money on a Lantronix Xport, you can use ethernet,
and then the linux/windows problems goes away - as sockets seem to
"just work"
>
Note, if it is USB, then the client will be implemented by me using FTDI
chips that appear to the PC as a serial port.

2. Develop a simple vector drawing program that will allow one to
freehand draw a sketch composed of a few lines, or perhaps render text
in a vector form. Then sample the lines with a certain (user
configurable) spacing, and use the mouse to move the sample points along
the lines to tweak the sample locations if desired. Then output a file
of X,Y coordinates for the samples.

What is this crazy thing for? It's to develop simple lasershow vector
frames. I am also designing a DSP-based lasershow output device, so the
same capabilities of delivering a data payload over serial/USB to a
target device will be needed here as well.

I would prefer to be able to write a program that is cross-platform
between Linux and Windows. I realize this might be especially
problematic with the serial comms.
true - its not quite the same.
>
I am also confused by the plethora of Python GUI extensions, though
Tkinter seems like a likely candidate. I am uncertain if I will have
difficulty learning how to use this if I don't know Tcl/Tk.
No - there are excellent examples and docs available on the web.
Unless you are doing something very fancy, you dont "need" to know Tcl.

The development cycle is fast, and if you get stuck you can get help
here - this is a super group of people (said he modestly... :- ) )
>
Do you think Python is the right language for these projects?
Yes - I am in the process of finishing an Injection Moulding Machine
Controller, with the GUI in tkinter (cos its in the standard library),
with some crude animation of the machine functions - and it all "just works"

In my case, the OS is linux, and the interface is serial - but then I am not
trying for cross platform compatibility. - I have implemented a sliding
window full duplex reliable protocol, so it is possible to use Python to
talk to a serial device. (at 115200, so its not "that" slow)
>
Any input will be appreciated.
hth - Hendrik

Jul 10 '07 #4
Grant Edwards wrote:
Most of the graphics I do with Python is with Gnuplot (not
really appropriate for what you want to do.
wxWidgets/Floatcanvas might be worth looking into.
Agreed (I'm quite sure you mean wxPython though). Also, in "wxPython
in Action" (the official book) a simple drawing app is constructed.
It could help to start from there.

Regards,
Björn

--
BOFH excuse #211:

Lightning strikes.

Jul 10 '07 #5
CC <cr***@BOGUS.sb cglobal.netwrot e:
I have considerable C and assembly language experience. However, these
are mostly on embedded microcontroller s since I moved away from PC
programming all the way back in 1988 :-O

I wish to accomplish a few PC programming tasks, and am considering to
learn Python:

1. Develop a simple GUI program to run on Linux and Windows which can
send parameters and small blocks of data to an embedded microcontroller
device via RS-232 or USB. Also display simple data (probably single
numbers) sent from the device.

Note, if it is USB, then the client will be implemented by me using FTDI
chips that appear to the PC as a serial port.
No problems - pyserial, wxPython work fine cross platform. You can
also use libusb from python from windows and linux also for low level
USB stuff. I've managed to use all those things successfully.
I would prefer to be able to write a program that is cross-platform
between Linux and Windows. I realize this might be especially
problematic with the serial comms.
On the contrary, pyserial does a very good job of abstracting the
serial port away.
I am also confused by the plethora of Python GUI extensions, though
Tkinter seems like a likely candidate. I am uncertain if I will have
difficulty learning how to use this if I don't know Tcl/Tk.
Use wxPython would be my advice. tk is OK, but a bit clunky. it does
have the advantage that it is built into the language though.
Do you think Python is the right language for these projects?
Yes!

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Jul 10 '07 #6
CC
Hendrik van Rooyen wrote:
"CC" <cr***@BOGUS.s. ...l.netwrote:[edit]
>>1. Develop a simple GUI program to run on Linux and Windows which can
send parameters and small blocks of data to an embedded microcontroller
device via RS-232 or USB. Also display simple data (probably single
numbers) sent from the device.

If you spend a bit of money on a Lantronix Xport, you can use ethernet,
and then the linux/windows problems goes away - as sockets seem to
"just work"
Yeah, that's neato. Trouble is, I work at a national lab, which is
where some of these apps will be developed. They have a big problem
with ethernet devices. Basically, it's almost impossible to use
ethernet on other than PCs, on the official LAN.

I will have to look into this further though, as higher data rate stuff
is a problem with serial. Although I could do 10Mbps RS-422 I suppose.
>>[edit]
I am also confused by the plethora of Python GUI extensions, though
Tkinter seems like a likely candidate. I am uncertain if I will have
difficulty learning how to use this if I don't know Tcl/Tk.

No - there are excellent examples and docs available on the web.
Unless you are doing something very fancy, you dont "need" to know Tcl.

The development cycle is fast, and if you get stuck you can get help
here - this is a super group of people (said he modestly... :- ) )
Yeah, that's really great. Our in-house programmer uses wxPython, I've
discovered, so that's a strong push in that direction. Though he isn't
totally unfamiliar with TkInter too.
>>Do you think Python is the right language for these projects?

Yes - I am in the process of finishing an Injection Moulding Machine
Controller, with the GUI in tkinter (cos its in the standard library),
with some crude animation of the machine functions - and it all "just works"
Thanks for the input.

I am not seeing anything to indicate that Python isn't the direction in
which I should head.

Good day!
--
_______________ ______
Christopher R. Carlen
cr***@bogus-remove-me.sbcglobal.ne t
SuSE 9.1 Linux 2.6.5
Jul 11 '07 #7
CC
Bjoern Schliessmann wrote:
Grant Edwards wrote:
>>Most of the graphics I do with Python is with Gnuplot (not
really appropriate for what you want to do.
wxWidgets/Floatcanvas might be worth looking into.

Agreed (I'm quite sure you mean wxPython though). Also, in "wxPython
in Action" (the official book) a simple drawing app is constructed.
It could help to start from there.
Ooh, that's interesting.

The programming contractor at work who does all our DAQ stuff also uses
wxPython so it's looking like I should use that since I can get lots of
help.
Thanks for the book tip.


--
_______________ ______
Christopher R. Carlen
cr***@bogus-remove-me.sbcglobal.ne t
SuSE 9.1 Linux 2.6.5
Jul 11 '07 #8
CC
Michele Simionato wrote:
On Jul 10, 5:09 am, CC <c...@BOGUS.sbc global.netwrote :
>>2. Develop a simple vector drawing program that will allow one to
freehand draw a sketch composed of a few lines, or perhaps render text
in a vector form. Then sample the lines with a certain (user
configurabl e) spacing, and use the mouse to move the sample points along
the lines to tweak the sample locations if desired. Then output a file
of X,Y coordinates for the samples.

You may look at dia for that.

Michele Simionato
Thanks for the input.

Yes, I will have a look. Makes sense to check out if any drawing progs
can do what I want off the shelf.

But it might be fun to write one anyway!


--
_______________ ______
Christopher R. Carlen
cr***@bogus-remove-me.sbcglobal.ne t
SuSE 9.1 Linux 2.6.5
Jul 11 '07 #9
On 7/10/07, CC <cr***@bogus.sb cglobal.netwrot e:
Bjoern Schliessmann wrote:
Grant Edwards wrote:
>Most of the graphics I do with Python is with Gnuplot (not
really appropriate for what you want to do.
wxWidgets/Floatcanvas might be worth looking into.
Agreed (I'm quite sure you mean wxPython though). Also, in "wxPython
in Action" (the official book) a simple drawing app is constructed.
It could help to start from there.

Ooh, that's interesting.

The programming contractor at work who does all our DAQ stuff also uses
wxPython so it's looking like I should use that since I can get lots of
help.

Since the book was written, wxPython has grown a vector graphics
system that might be more suitable for your needs. Look at the
wxGraphicsConte xt class.
Jul 11 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
4115
by: KefX | last post by:
I've been following the group a bit (somewhat loosely; discussions involving other languages or advanced concepts kind of lose me), and I see all this negativity (OMG Python's lambda is borken roflol, use teh othar langauge). I as a relative newcomer to Python pay little heed to the criticism, though. A few things in Python are counterintuitive, yes, but what language doesn't have such things? And I feel that one can master the syntax of...
47
3646
by: Michael Scarlett | last post by:
There is an amazing article by paul graham about python, and an even better discussion about it on slashdot. The reason I point this out, is the more I read both articles, the more I realised how we would be mutilating the language with that god forsaken @ decorator. I don't know about the rest of you, but I learned python and fell in love with its syntax and simplicity. Python - just works. So please GVR. Don't complicate it. Leave it as...
14
1721
by: Sam | last post by:
Hi, I have been developing sites and cms's for the past few years using PHP and mysql. I've been interested in learning a new language and was considering Python. I have a pretty decent grasp of OOP concepts (i know, you're skeptical since I mentioned PHP). I don't have a formal programming background, just learning as I go. So, with that being said, here are some dumb questions. 1. What can I do with Python that I can't do with php?
35
3069
by: Michael Kearns | last post by:
I've been using python to write a simple 'launcher' for one of our Java applications for quite a while now. I recently updated it to use python 2.4, and all seemed well. Today, one of my colleagues noted that on her machine the launcher would complain it was missing a DLL - msvcr71.dll However, there's a very grey area concerning the redistribution of said DLL. If you've been keeping up with the dev list, and some other web
0
1560
by: Fuzzyman | last post by:
It's finally happened, `Movable Python <http://www.voidspace.org.uk/python/movpy/>`_ is finally released. Versions for Python 2.3 & 2.4 are available from `The Movable Python Shop <http://voidspace.tradebit.com/groups.php>`_. The cost is £5 per distribution, payment by PayPal. £1 from every distribution goes to support the development of `SPE <http://pythonide.stani.be/>`_, the Python IDE.
0
8384
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8302
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8820
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8601
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7314
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.