Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: pyserial setting and getting RTS/DTR etc...- RTFM, but still don't understand it
Post: pyserial setting and getting RTS/DTR etc...- RTFM,...

I've started playing around with the serial port, so I installed pySerial. I then built a very simple breakout board, where I can measure voltages, strap LED and so on across the various RS232 lines....
alloydog General Coding Help 0 4,290 Apr-19-2021, 03:37 PM
    Thread: A better way to search the contents of a directory?
Post: RE: A better way to search the contents of a direc...

Thanks for suggestions and help,folks. However, before I got back here, I had been playing around with it and realised that I was approaching from the wrong direction. Instead of using the command l...
alloydog General Coding Help 5 2,674 Apr-11-2021, 09:12 AM
    Thread: A better way to search the contents of a directory?
Post: RE: A better way to search the contents of a direc...

Thanks for help. However, I think I have missed something out. This is how I tried your script: import os def directory(path): for file in os.listdir(path): if "Prolific".lower() in fil...
alloydog General Coding Help 5 2,674 Apr-08-2021, 03:11 PM
    Thread: A better way to search the contents of a directory?
Post: A better way to search the contents of a directory...

I want to find out which ttyUSB port has been assigned to a specific device. I know the name of the device, it is a generic "Prolific" USB to Serial adapter cable. Over the past few days, I have not...
alloydog General Coding Help 5 2,674 Apr-07-2021, 06:55 PM
    Thread: What type of *data* is the name of a list/tuple/dict, etc?
Post: RE: What type of *data* is the name of a list/tupl...

Thanks!
alloydog General Coding Help 9 4,383 Jan-30-2021, 07:11 AM
    Thread: What type of *data* is the name of a list/tuple/dict, etc?
Post: RE: What type of *data* is the name of a list/tupl...

(Jan-13-2021, 08:18 PM)buran Wrote: for idx, device in enumerate(devices, start=1):     print(f'{idx: >2d}.{device.part_no}') user_choice = int(input(f'Select device (1-{len(devices)}): ')) - 1 I...
alloydog General Coding Help 9 4,383 Jan-28-2021, 05:01 PM
    Thread: What type of *data* is the name of a list/tuple/dict, etc?
Post: RE: What type of *data* is the name of a list/tupl...

Thanks for the detailed solutions! **thumbsup** I will give each of them a try and see how they work and for tidying up the exponentials. Also, I wasn't sure how to format exponentials and *10**N wo...
alloydog General Coding Help 9 4,383 Jan-14-2021, 09:25 AM
    Thread: What type of *data* is the name of a list/tuple/dict, etc?
Post: What type of *data* is the name of a list/tuple/di...

In this excerpt of something I'm playing with, I create a variable from the user input. The user inpout is then added to a string. The resultant string is then used to refer to a list. But, when I ...
alloydog General Coding Help 9 4,383 Jan-13-2021, 07:43 PM
    Thread: Problem with one set of data
Post: RE: Problem with one set of data

I don't know what happened, I tried it first thing this morning (like at half-past four!) and got a wrong answer. Now I retried it and it works! Thank you good sir! Maybe someone needs to tell the p...
alloydog General Coding Help 4 2,175 Jan-04-2021, 07:41 AM
    Thread: Problem with one set of data
Post: RE: Problem with one set of data

Thanks for looking through it, but if you look closer, you'll notice that from 30K5A onwards, the powers are **-4, **-4 and **-8. I even tried with C being to **-7, but it does not work either.
alloydog General Coding Help 4 2,175 Jan-04-2021, 02:52 AM
    Thread: Problem with one set of data
Post: Problem with one set of data

I wrote a script to convert the measured resistance of the Betatherm thermistor 30K6A1 to temperature. I initially thought I had done something wrong, as it kept returning the wrong answer. The corr...
alloydog General Coding Help 4 2,175 Jan-03-2021, 07:37 PM
    Thread: IDLE for 3.7
Post: RE: IDLE for 3.7

I forgot about this thread and I kind of didn't get very far with following the tutorial either - it doesn't suit my style of learning. Flash forward a couple of years and I restarted, fresh install ...
alloydog Bar 6 8,225 Jan-01-2021, 01:53 PM
    Thread: Improvements for first script?
Post: RE: Improvements for first script?

Apparently f-strings are the new improved way of doing it... https://realpython.com/python-f-strings/
alloydog Code Review 9 4,147 Jan-01-2021, 01:45 PM
    Thread: Improvements for first script?
Post: RE: Improvements for first script?

Thanks for extras! **thumbsup** I'll have a look through them, as I'm thinking about expanding my script later on - it was written as "My First Python Script", as earlier I did the same thing in HTM...
alloydog Code Review 9 4,147 Dec-30-2020, 05:28 PM
    Thread: Improvements for first script?
Post: RE: Improvements for first script?

I will give that a bash - always good to reduce typing ;) Thanks!
alloydog Code Review 9 4,147 Dec-30-2020, 09:25 AM
    Thread: Difference between math.pow and **
Post: RE: Difference between math.pow and **

Thanks for expanded explanation - I actually thought that pow was just a short hand version of math.pow. But now I know :)
alloydog General Coding Help 5 4,662 Dec-30-2020, 09:23 AM
    Thread: Difference between math.pow and **
Post: RE: Difference between math.pow and **

Aha, the problem was between keyboard and chair - a typo, I had too many brackets. Thanks. Which is the "preferred" way of doing it? pow or **? Or is it just personal preference?
alloydog General Coding Help 5 4,662 Dec-30-2020, 07:35 AM
    Thread: Difference between math.pow and **
Post: Difference between math.pow and **

I'm trying to write a script which uses the Steinhart-Hart equation to calculate the temperature of a thermistor from its measured resistance. The formula is: 1/T = A + B(ln(R)) + C(ln(R))³Where T is...
alloydog General Coding Help 5 4,662 Dec-29-2020, 07:37 PM
    Thread: Improvements for first script?
Post: RE: Improvements for first script?

Thanks for the tips. **thumbsup** Didn't know about the style guide - Heading over to there ASAP. For not using uppercase letters, then, measUnits would become meas_units. I appreciate your commen...
alloydog Code Review 9 4,147 Dec-28-2020, 07:55 AM
    Thread: Improvements for first script?
Post: Improvements for first script?

My way of learning is to think of something I need doing, then try a line, step by step, googling each error message and so on. I *don't* look for a complete script, that someone else has already don...
alloydog Code Review 9 4,147 Dec-27-2020, 03:57 PM

User Panel Messages

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