Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Waiting for input from serial port, then move on
Post: RE: Waiting for input from serial port, then move ...

Thanks, that did the trick
KenHorse General Coding Help 3 1,101 Oct-17-2023, 01:14 AM
    Thread: Waiting for input from serial port, then move on
Post: Waiting for input from serial port, then move on

Why doesn't this leave the while loop? #wait for % and then move on indata = "" Counter = 0 while indata != "%": indata = ser.read() print(indata) Counter += 1 if Counter > 5: sys.e...
KenHorse General Coding Help 3 1,101 Oct-16-2023, 09:28 PM
    Thread: Syntax error? I don't see it
Post: RE: Syntax error? I don't see it

I have to admit I am new to Python 3.9.x and this is someone else's code (Jan-15-2023, 07:20 PM)Gribouillis Wrote: What are the lines between 500 and 570? def getCLarguments(): """ Get comm...
KenHorse General Coding Help 4 1,273 Jan-15-2023, 07:25 PM
    Thread: Syntax error? I don't see it
Post: Syntax error? I don't see it

Python 3.9.2 I keep getting a syntax error and for the life of me, I don't see it: Quote:root@piZERO:~/bin# ./npwAgent.py File "/root/bin/npwAgent.py", line 559 getCLarguments() ^ SyntaxEr...
KenHorse General Coding Help 4 1,273 Jan-15-2023, 06:35 PM
    Thread: Upgrading from 2 to 3 and having file write problems
Post: RE: Upgrading from 2 to 3 and having file write pr...

(May-08-2022, 09:37 PM)Axel_Erfurt Wrote: try file.write(indata.decode()) Thank you, that worked!
KenHorse General Coding Help 2 1,499 May-08-2022, 09:47 PM
    Thread: Upgrading from 2 to 3 and having file write problems
Post: Upgrading from 2 to 3 and having file write proble...

#!/usr/bin/python import serial, time, sys, fileinput #open and configure serial port ser = serial.Serial( port='/dev/ttyUSB0', baudrate=19200, parity=serial.PARITY_NONE, stopbits=s...
KenHorse General Coding Help 2 1,499 May-08-2022, 09:12 PM
    Thread: While loop doesn't exit
Post: RE: While loop doesn't exit

Thanks for the suggestion but it still times out #wait for % and then move on indata = "" Counter = 0 while indata.strip() != "%": indata = ser.read() print (indata.decode()) Counter = Counte...
KenHorse General Coding Help 3 2,028 Jun-20-2021, 08:19 PM
    Thread: While loop doesn't exit
Post: While loop doesn't exit

while indata != "%": indata = ser.read() print (indata) Counter = Counter + 1 if Counter > 20: sys.exit("Timed out waiting for Bootloader Active Character. Please try again")Why does ...
KenHorse General Coding Help 3 2,028 Jun-20-2021, 06:17 PM
    Thread: Progress Indicator for Xmodem 0.4.6
Post: Progress Indicator for Xmodem 0.4.6

I'm using the xmodem module (https://pypi.org/project/xmodem/) and it works just fine. However, I'd like to incorporate some sort of progress indicator during the upload. I kinda know my way around ...
KenHorse General Coding Help 1 1,984 Jan-30-2021, 06:00 PM
    Thread: Using USB
Post: Using USB

So I have a USB to serial converter on /dev/ttyUSB0 and try writing to it but nothing happens: #!/usr/bin/python import serial import sys # Set Port ser = serial.Serial('/dev/ttyUSB0', 57600, 8, '...
KenHorse General Coding Help 0 1,778 May-23-2018, 05:45 PM

User Panel Messages

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