Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Learning to have Class and doing stuff with it...
Post: RE: Learning to have Class and doing stuff with it...

(Apr-29-2020, 10:05 AM)scidam Wrote: BTW, method cmd runs the command, so its appropriate name should be, e.g. run?!Ok, didn't know that. I changed it to run. (Apr-29-2020, 10:05 AM)scidam Wrote:...
bako General Coding Help 2 2,049 Apr-29-2020, 05:07 PM
    Thread: Learning to have Class and doing stuff with it...
Post: Learning to have Class and doing stuff with it...

PSA: Python noob trying to learn the whole module import, Class usage, and function creation stuff. Error:Traceback (most recent call last): File "waveshare.py", line 3, in <module> cmd(A...
bako General Coding Help 2 2,049 Apr-29-2020, 08:18 AM
    Thread: PYserial basics?
Post: RE: PYserial basics?

I figured it out. Apparently I had another PIP package called "serial" installed which totally doesn't do what I want. Anybody know how to handle with conflicts like that? Name: pyserial Version: 3.4...
bako General Coding Help 10 5,237 Apr-26-2020, 10:17 AM
    Thread: PYserial basics?
Post: RE: PYserial basics?

(Apr-26-2020, 06:52 AM)buran Wrote: Can you do import os import serial print(os.path.abspath(serial.__file__)) /usr/local/lib/python2.7/dist-packages/serial/__init__.pyc /usr/local/lib/python2.7/dis...
bako General Coding Help 10 5,237 Apr-26-2020, 07:54 AM
    Thread: PYserial basics?
Post: RE: PYserial basics?

(Apr-26-2020, 05:01 AM)buran Wrote: no, I mean your own file serial.py in the same folder as the script you run. That would shadow the package you import. It's a common newbie mistake. No. I don't. ...
bako General Coding Help 10 5,237 Apr-26-2020, 06:25 AM
    Thread: PYserial basics?
Post: RE: PYserial basics?

(Apr-26-2020, 04:57 AM)buran Wrote: do you have a file named serial.py? not that I'm aware of... If I knew how to check the PIP packages I would.
bako General Coding Help 10 5,237 Apr-26-2020, 04:59 AM
    Thread: PYserial basics?
Post: PYserial basics?

import serial import time ser = serial.Serial("/dev/ttyS0", baudrate=115200) W_buf = ["AT\r\n", "AT+CMGS=\"15555555555\"\r\n", "Helloworld"] ser.write(W_buf[0]) ser.flushInput()Error:Traceback (most r...
bako General Coding Help 10 5,237 Apr-26-2020, 04:53 AM
    Thread: Debugging scripts basics
Post: RE: Debugging scripts basics

(Apr-24-2020, 02:58 AM)buran Wrote: Why not use an IDE with debugging? I'm old fashioned? IDK... I just feel more comfortable using VIM. That and the script is "remote" on a Raspberry PI with a Hat ...
bako General Coding Help 8 3,645 Apr-24-2020, 03:00 AM
    Thread: Debugging scripts basics
Post: RE: Debugging scripts basics

(Apr-24-2020, 01:49 AM)Larz60+ Wrote: Since yo like to work from shell, look at pdb which can be imported directly into your script: https://docs.python.org/3/library/pdb.html Care for an example? F...
bako General Coding Help 8 3,645 Apr-24-2020, 02:27 AM
    Thread: Debugging scripts basics
Post: Debugging scripts basics

So, I'm mainly a BASH scripter looking to jump into the Python boat. What's the equivalent to bash -xv when running a python script? Rather than bug people necessarily, I need help on trying to troub...
bako General Coding Help 8 3,645 Apr-24-2020, 01:23 AM
    Thread: Translate to noob a Name Eroor message
Post: RE: Translate to noob a Name Eroor message

Ah... stupid me. So, no quotes on variables. Specific values require quotes of some sort.
bako General Coding Help 2 2,292 Mar-30-2020, 05:58 PM
    Thread: Translate to noob a Name Eroor message
Post: Translate to noob a Name Eroor message

What exactly does this mean? Error:Traceback (most recent call last): File "waveshare_init.py", line 22, in <module> if cmd == off: NameError: name 'off' is not defined"off" is cmd = sys....
bako General Coding Help 2 2,292 Mar-30-2020, 12:19 PM
    Thread: Noob needing guidance....
Post: Noob needing guidance....

I keep getting issues trying to do a serial thing. I'm copying the lines from another script that kind of works okay. Objective: Send serial modem commands to a Raspberry Pi Hat. root@UPS-pico:/home...
bako General Coding Help 0 1,886 Mar-29-2020, 06:55 PM

User Panel Messages

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