Python

I have been learning some Python here and there over the last few months. It is an interesting language and I think it has many great advantages for some applications. Without offending the Python diehards, I do not think it would be useful for high speed processing of data or graphics. For these tasks a compiled languge like C or C++ is the way to go. But for test or throwaway code it is great.

I had a simulator to write for work to test a serial interface. In the past I would have written it in C on either a PC or on an embedded processor. This time I elected to try it using Pythin on a PC. The code took a while to write only becuase I had no clue how to do structures and unions in Python. Turns out the “ctype” module is the way to go (or at least I think). When I started out I posted a querey on a Python forum and got the reply “And why would you think ctype will work?”. This caused me some consternation, but I proceeded and got it to work. Just goes to show you tha the Internet can sometimes be a good source of bad information.

Must explore to languge more including its ability to be called by C or to call C routines. This might make a very valuable testing platform.

This entry was posted in Projects, Software. Bookmark the permalink.

3 Responses to Python

  1. Skye Sweeney says:

    I received a comment via the SparkFun Forum that Python can be fast. That I should look at module/packages like Numpy and SciPy.

    I was aware that using the right libraries could drastically improve your performance. I am also aware that my C-like coding habits in Python are likely a detriment as well. But I have not yet been able to get into the Python mindset. I am alao not sure I want to! My bread and butter is embedded C (not even C++) on small processors. I have honed my skills and do not want to start getting bad habits. Often people’s life are at risk if my software malfunctions. Best practices are hard to maintain without going out of your way to learn other languages.
    These are python packages specifically geared for manipulating BIG data
    sets fast.

  2. Ruchita says:

    Great experience shared! Is python as similar as c and c++? I am going to learn python soon and want to work on it. Thanks

    • Skye Sweeney says:

      Python is very similar to C++. The syntax is a bit different but the concepts are the same.
      When you get good at Python there is a different mindset but in the early learning they only really differ by syntax.

Comments are closed.