Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #5718

Re: [Python-de] Konstanten in Struct-Form in Python

From Hartmut Goebel <h.goebel@crazy-compilers.com>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Konstanten in Struct-Form in Python
Date 2021-02-19 15:43 +0100
Organization crazy-compilers.com
Message-ID <mailman.87.1613746385.14271.python-de@python.org> (permalink)
References <i9a065FttstU1@mid.individual.net> <1185652d-c786-727c-7d64-d10ad8cd44ec@crazy-compilers.com>

Show all headers | View raw


Am 19.02.21 um 15:27 schrieb Michael S.:
> Was mich dran nervt ist, dass jede einzelne CAN-Botschaft eine eigene 
> Klasse ist und ich die im Code erstmal instanzieren muss, bevor ich 
> sie nutzen kann. Das muss doch auch einfacher gehen
Mache Klassen-Variabblen draus:

class CAN_AC_Voltage:
     ID = 0x16FC8B11
     BitOffset = 48
     BitLength = 8
     Gain = 1
     ValueOffset = 0
     Unit = "V"
     Rate = 0.5

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Konstanten in Struct-Form in Python "Michael S." <michaely@bigfoot.de> - 2021-02-19 15:27 +0100
  Re: [Python-de] Konstanten in Struct-Form in Python Hartmut Goebel <h.goebel@crazy-compilers.com> - 2021-02-19 15:43 +0100
  Re: [Python-de] Konstanten in Struct-Form in Python Peter Otten <__peter__@web.de> - 2021-02-20 09:37 +0100
  Re: Konstanten in Struct-Form in Python "Michael S." <michaely@bigfoot.de> - 2021-02-22 07:00 +0100
    Re: Konstanten in Struct-Form in Python Marc 'BlackJack' Rintsch <marc@rintsch.de> - 2021-04-28 10:04 +0000

csiph-web