Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: parsing question
Post: RE: parsing question

Thank you.... I look forward to experimenting with this... It definitely looks promising... Thanks again!
ridgerunnersjw General Coding Help 7 5,143 Oct-10-2020, 09:04 PM
    Thread: parsing question
Post: RE: parsing question

Datasheet only calls out uint16....I gotta believe that WYSIWYG so: x\ea --> 00ea x\f4p --> f470 If I can get this parsed I will try and plot this data to see if it makes sense.....If endian i...
ridgerunnersjw General Coding Help 7 5,143 Oct-10-2020, 06:55 PM
    Thread: parsing question
Post: RE: parsing question

I have a sensor that is feeding me that datastream....It represents I and Q data (int16), FFT data (uint16) and some misc (uint16)... I notice in your solution you are losing characters ie... \xffp (t...
ridgerunnersjw General Coding Help 7 5,143 Oct-09-2020, 08:38 PM
    Thread: parsing question
Post: parsing question

Can someone tell me how to parse this using '\x' and place each line on it's own:....I tried .split(b'\x') but this gives me an error Output:b'\x00\xd0\xffp\x01p\x01 \x00 \xff\xa0\x00 \x01\x90\x00\xf...
ridgerunnersjw General Coding Help 7 5,143 Oct-09-2020, 07:50 PM
    Thread: parsing question
Post: RE: parsing question

That seems to work quite well except my value that I gave is only an example and the three values are data read from an IC. They change. I need to be able to basically read then parse to get the inne...
ridgerunnersjw General Coding Help 3 2,031 Oct-06-2020, 01:28 AM
    Thread: parsing question
Post: parsing question

I have the following : Output:b'011;005;080;'What is the best way to parse this to remove all and get 005 (middle term)?
ridgerunnersjw General Coding Help 3 2,031 Oct-06-2020, 12:40 AM
    Thread: code not working, NameError: name 's' is not defined
Post: RE: code not working.....

Thank you both very much...That worked great!
ridgerunnersjw General Coding Help 4 3,877 Oct-05-2020, 06:47 PM
    Thread: code not working, NameError: name 's' is not defined
Post: code not working, NameError: name 's' is not defin...

Good afternoon.... I have a serial device that I am able to communicate with. I decided to put the code into a class module and build it out. I am running into an issue with respect to the serial po...
ridgerunnersjw General Coding Help 4 3,877 Oct-05-2020, 06:39 PM
    Thread: newbie question....importing a created class
Post: RE: newbie question....importing a created class

I prefer not to move the files....my files exist at /home/pi/my_Python/Radar the python path is: Output:>>> print('\n'.join(sys.path)) /usr/lib/python37.zip /usr/lib/python3.7 /usr/lib/pyt...
ridgerunnersjw General Coding Help 5 2,710 Oct-01-2020, 07:59 PM
    Thread: newbie question....importing a created class
Post: RE: newbie question....importing a created class

no it does not reside in any of the listed directories
ridgerunnersjw General Coding Help 5 2,710 Oct-01-2020, 07:09 PM
    Thread: newbie question....importing a created class
Post: newbie question....importing a created class

Hello all.... I've created a class in a directory using Python. I go to my command line to import and I get an error 'ModuleNotFoundError'. Can someone tell me where I edit Python so that when it ru...
ridgerunnersjw General Coding Help 5 2,710 Oct-01-2020, 06:46 PM
    Thread: How to remove char from string??
Post: RE: How to remove char from string??

Thank you....Yes it is byte adding the b in .lstrip(b'@') seemed to solve it
ridgerunnersjw General Coding Help 2 2,595 Sep-30-2020, 03:49 PM
    Thread: How to remove char from string??
Post: How to remove char from string??

Good morning.... I have a string being returned '@S0601\r\n'.....I am trying to remove the @ at the front using .replace and .lstrip but to no avail....Below is my lastest code try with error that I ...
ridgerunnersjw General Coding Help 2 2,595 Sep-30-2020, 01:17 PM
    Thread: Concatenation ??
Post: Concatenation ??

I have a string that a user enters from input()....I would like to concatenate it with '\r' (0x0D) <CR> character so that it goes out on the uart bus as such..... c = c + '\r' If I print©...
ridgerunnersjw General Coding Help 1 1,746 Sep-26-2020, 06:25 PM
    Thread: conditionals with boolean logic??
Post: RE: conditionals with boolean logic??

I understand what you are saying that the () will eval and get precedence. Just the existence of the tuple yields TRUE. Is there a way like C where I can just use the element in question of the stri...
ridgerunnersjw General Coding Help 3 2,021 Sep-26-2020, 12:19 PM
    Thread: conditionals with boolean logic??
Post: conditionals with boolean logic??

I'm new to Python.... Can someone tell me why code only responds to the first boolean characater and not the rest? cmd = '$D00\r' if cmd[1] == ("S" or "D" or "R"):
ridgerunnersjw General Coding Help 3 2,021 Sep-26-2020, 01:17 AM
    Thread: creating a variable in a method and using in another method
Post: RE: creating a variable in a method and using in a...

Thanks everyone for your comments....Please bear with me as I am new to this....I am experimenting with some of the comments above, in particular class test: t = visa.ResourceManager() def __init...
ridgerunnersjw General Coding Help 5 3,016 Oct-04-2019, 03:49 PM
    Thread: creating a variable in a method and using in another method
Post: creating a variable in a method and using in anoth...

Good evening...... Can someone please tell me the correct way to create a variable within a method and then be able to re-use that variable internal to the class within another method? As an example I...
ridgerunnersjw General Coding Help 5 3,016 Oct-04-2019, 12:33 AM
    Thread: if condition inside try / except -- how to??
Post: if condition inside try / except -- how to??

Good afternoon... Can someone please show me what I am missing. Basically I want to take an argument in and check if it exists within a tuple of valid arguments. If it does GREAT, if not raise an er...
ridgerunnersjw General Coding Help 1 2,149 Oct-02-2019, 09:40 PM
    Thread: addition for elements in lists of list
Post: RE: addition for elements in lists of list

I figured it out using sum(row)....however it brings up a question ...below are two snippets of code that give me valid results...can you explain to me why I need c[0][i] for the case that uses append...
ridgerunnersjw General Coding Help 3 3,133 Sep-15-2019, 03:48 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020