Trying to figure out the data type from the code snippet
Chupo
bad_n_mad at yahoo.com
Wed Jan 30 22:54:44 EST 2019
In article <8bff3a64-e154-4e39-b558-952e8f28ae2e at googlegroups.com>,
Rick Johnson <rantingrickjohnson at gmail.com> says...
> Listen... if you are not familiar with all of Python's built-in functions,
> all special methods of Python objects, and all the methods of strings,
> integers, floats, lists, tuples, dicts (and possibly others that i forgot
> to mention), you can't do much of anything with this language.
>
> I would advise you to read a beginners tutorial.
I am by any means not Python expert but I do have a basic Python
knowledge and I do occasionally use Pyhon to perform some tasks.
I am not a professional programmer but rather an electrical engineer
and I am using various programming languages since 1982. I started with
Z80 and 6502 assembler, Fortran, Pascal, ... and since I am often using
microcontrollers my main programming languages are C and assembler.
However, sometimes when I have to process some data, parse some file,
generate some data, extract of filter some results acquired by sampling
or measuring analog values, ... I do use Python - although I never
learnt it from the book. I am using Python as a tool to accomplish the
tasks as they 'arrive' and although my code is for sure not written in
Pythonic way - it works.
Since arrival of various SoCs (e.g. Rasbperry Pi) I used Python not
only for pre/post processing the data but for building applications as
well and some of the Python programs I wrote are:
- Driver for *very* fast 3D printer which is unique in its construction
- Filtering the data acquired from multiple AD converters sampling
movements of human body using Savitzky-Golay filter
- Program for sending large amount of data in real time via I2C BUS
towards multiple microcontrollers every 10 ms (I used threading and
Queue from multiprocessing and I am, upon sending the data over I2C
BUS, scheduling a new thread in a way timing disturbances caused by
background tasks and interrupts don't accumulate over time)
- Programs used as 'a glue' between node.js code and microcontrollers
- Interpolating the data used for sinhronizing lip movements of
humanoid robot with spoken words between the keyframes
- 3D animation of humaniod robot arms based on the data acquired by
motion capture and by recording movements using rotary encoders
And yes, I did use OOP. For example, I can use my driver for 3D printer
to print one layer as follows:
from Printer3D import Head
import numpy as np
import cv2
import glob
import time
np.set_printoptions(threshold=np.nan)
layer = cv2.imread("./png_input/layer.png")
visina, sirina = layer.shape[:2]
print visina, sirina
layer = cv2.cvtColor(layer, cv2.COLOR_BGR2GRAY)
#layer = cv2.resize(layer, None, fx=0.5, fy=0.5, interpolation =
cv2.INTER_AREA)
hd = Head(layer)
hd.setSteps_x(44, 44, 382)
hd.setDistance(21)
hd.setHead_GPIO([0, 4, 17, 27, 22, 10, 9, 11, 5, 6])
hd.setMotor_GPIO([13, 19, 26, 21, 20, 16])
hd.move(Head.ROW_UP, 10)
hd.printLayer()
hd.move(Head.UP, 10)
So, the truth is - I am indeed (obviously) not familiar with everything
you mentioned but you can decide for yourself if everything I already
did using Python could be classified as 'not much'.
--
Let There Be Light
Custom LED driveri prema specifikacijama
http://tinyurl.com/customleddriver
Chupo
More information about the Python-list
mailing list