Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Adding spaces to digits
Post: RE: Adding spaces to digits

I'm sure that there is (or was) a ruling that complete answers to home work questions, should not be posted. Has this changed and if so, why? Giving the answer without first encouraging a OP to work ...
rob101 Homework 5 685 Feb-10-2024, 01:08 PM
    Thread: Adding spaces to digits
Post: RE: Adding spaces to digits

@deadkill02 For the rest of this task, I would create a 'new tokens' list object, then nest two for loops; one to loop through the existing tokens, and the other to loop though the numbers (which wil...
rob101 Homework 5 685 Feb-09-2024, 04:51 PM
    Thread: Adding spaces to digits
Post: RE: Adding spaces to digits

There are a few different ways to do this and your code can be made much more succinct. This (for example) removes the hyphens and reverses each 'token'. The resulting tokens are replaced, within the...
rob101 Homework 5 685 Feb-08-2024, 09:22 PM
    Thread: Combining Spreadsheets
Post: RE: Combining Spreadsheets

Have you looked at more than one tutorial for this kind of operation? As an example: how about this one Myself, I'd be looking at using OpenPyXL for this kind of work and I have in fact used said (...
rob101 General Coding Help 4 635 Feb-06-2024, 09:16 PM
    Thread: Python Hash Sets Explained
Post: Python Hash Sets Explained

Python Hash Sets Explained & Demonstrated - Computerphile is a YT video that I found real interesting and informative. I trust others will also.
rob101 Tutorial Requests and Submissions 0 412 Feb-05-2024, 11:17 PM
    Thread: Python Classes
Post: RE: Python Classes

Thank you all for the rapid and very helpful responses. I will study what has been said here and apply what I can learn from this.
rob101 General Coding Help 4 569 Feb-05-2024, 06:51 PM
    Thread: Python Classes
Post: Python Classes

Although I've been coding with Python for a number of years now, I've never constructed a Class before. This is my first attempt. class Resister: def __init__(self, band1, band2, band3): ...
rob101 General Coding Help 4 569 Feb-05-2024, 03:27 PM
    Thread: using > < for tuple , list,...
Post: RE: using > < for tuple , list,...

The best way to learn, is to explore the concept. Here... t1 = ("A", "B", "C") t2 = ("A", "B", "D")... t2 > t1 because t2 has a "D" as one of its items. And here... t1 = ("A", "B", "C") t2 = ("...
rob101 General Coding Help 3 519 Feb-05-2024, 12:04 PM
    Thread: declaring a new dictionary
Post: RE: declaring a new dictionary

If you need an integer, use 1: myDict={ "one":1}
rob101 Homework 2 498 Feb-03-2024, 03:05 PM
    Thread: Real Random Number Generator
Post: RE: Real Random Number Generator

This is NOT a put down; it's genuine advice, as I fear for your well being: seek some psychiatric help, as soon as you can, because you are clearly unwell.
rob101 Code sharing 21 2,434 Jan-31-2024, 07:41 PM
    Thread: Real Random Number Generator
Post: RE: Real Random Number Generator

(Jan-31-2024, 06:04 PM)woodturner550 Wrote: If you check, which I know you have not done. The random numbers used commercially will have patterns just like you show. If you run my code, with my r1 a...
rob101 Code sharing 21 2,434 Jan-31-2024, 06:25 PM
    Thread: get list of dates in past month, current and upcoming month
Post: RE: get list of dates in past month, current and u...

There will be a number of different ways to do this, but, I'd be looking at using a timedelta object (maybe more than one) to look backwards and forwards, 45 days, either side of the current date (91...
rob101 General Coding Help 4 604 Jan-31-2024, 06:05 PM
    Thread: Real Random Number Generator
Post: RE: Real Random Number Generator

I've run a test on your code, based on a test the I did (some time back) for the random.randint() function. I've incorporated your code (that you posted at the beginning of this thread) in a function...
rob101 Code sharing 21 2,434 Jan-31-2024, 09:59 AM
    Thread: Real Random Number Generator
Post: RE: Real Random Number Generator

What happened with the University of Oregon? Any news from there? See: https://discuss.python.org/t/understandi...rs/41332/7
rob101 Code sharing 21 2,434 Jan-31-2024, 03:12 AM
    Thread: Malicious PyPI Packages Slip WhiteSnake InfoStealer Malware onto Windows Machines
Post: RE: Malicious PyPI Packages Slip WhiteSnake InfoSt...

An "easy to miss" link (from the THN post) to this very detailed report is well worth reading. to add: sorry, I've just seen that @Gribouillis has already linked this up.
rob101 News and Discussions 3 665 Jan-30-2024, 01:54 PM
    Thread: Malicious PyPI Packages Slip WhiteSnake InfoStealer Malware onto Windows Machines
Post: Malicious PyPI Packages Slip WhiteSnake InfoSteale...

This, from The Hacker News, broke yesterday. Just be mindful of what you allow into your computer system.
rob101 News and Discussions 3 665 Jan-30-2024, 07:58 AM
    Thread: Retrieve word from string
Post: RE: Retrieve word from string

How about: phrase = "I'm selling fruits and vegetables" phrase_lst = phrase.split() for word in phrase_lst: if word.startswith("fr"): print(word)
rob101 General Coding Help 4 534 Jan-21-2024, 03:29 AM
    Thread: Create dual folder on different path/drive based on the date
Post: RE: Create dual folder on different path/drive bas...

This code snippet, from an app that I coded for making backups for files/directories may be of help to you. for path, dirs, files in walk(SRC): for file in files: dst_path = Path(path.rep...
rob101 General Coding Help 2 482 Jan-21-2024, 03:27 AM
    Thread: Variable for the value element in the index function??
Post: RE: Variable for the value element in the index fu...

This is 'long hand' and could be shorter. alpha_upper = [chr(n) for n in range(65, 91)] # A...Z alpha_lower = [chr(n) for n in range(97, 123)] # a...z alpha_lst = alpha_lower + alpha_upper alpha_l...
rob101 General Coding Help 8 712 Jan-20-2024, 01:03 AM
    Thread: Best way to secure API key when sharing
Post: RE: Best way to secure API key when sharing

Why don't you simply replace the key/secret with something like <key> <secret> and explain that the user needs to insert their own there?
rob101 General Coding Help 2 370 Jan-19-2024, 04:34 PM

User Panel Messages

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