Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Im at square one even with trying to install python
Post: RE: Im at square one even with trying to install p...

You've downloaded the source code, by the looks of it. Instead, you should download one of the "installer" packages for your OS from https://www.python.org/downloads/release/python-3121/.
ndc85430 General Coding Help 1 354 Jan-12-2024, 05:39 AM
    Thread: Please Help
Post: RE: Please Help

It would help if you actually told us what the problem was. There's a lot of code there and if you want people to be able to run it, you'd be best providing a minimal, yet complete example that demons...
ndc85430 Web Scraping & Web Development 5 786 Dec-19-2023, 09:46 AM
    Thread: Problem with flask on Mac
Post: RE: Problem with flask on Mac

You need to install Homebrew if you haven't already - see https://brew.sh/. No, you don't type the $. That's just an example of the shell prompt.
ndc85430 General Coding Help 13 2,452 Dec-18-2023, 05:33 PM
    Thread: Problem with flask on Mac
Post: RE: Problem with flask on Mac

Are you using Homebrew? brew install pkg-config should do it (see https://formulae.brew.sh/formula/pkg-config). If you're not using Homebrew, I'm not sure.
ndc85430 General Coding Help 13 2,452 Dec-18-2023, 11:05 AM
    Thread: Problem with flask on Mac
Post: RE: Problem with flask on Mac

The first few lines of your output say Output:/bin/sh: pkg-config: command not foundDoes pkg-config installed on MacOS, or do you have to install it from Homebrew or something?
ndc85430 General Coding Help 13 2,452 Dec-18-2023, 08:13 AM
    Thread: Create X Number of Variables and Assign Data
Post: RE: Create X Number of Variables and Assign Data

Don't try to dynamically create variables, because that will lead to code that's difficult to maintain. Instead, use a list if you want to keep items in order, or use a dictionary if you want to assoc...
ndc85430 General Coding Help 8 954 Nov-12-2023, 03:34 PM
    Thread: code management
Post: RE: code management

A few general thoughts: 1. Use version control (e.g. Git) to keep track of your changes. 2. Write automated tests so that you can make sure your code continues to work as you change it (see, e.g. h...
ndc85430 General Coding Help 3 618 Oct-23-2023, 06:44 AM
    Thread: Partial KEY search in dict
Post: RE: Partial KEY search in dict

I'm confused about what your question is. Can you show some examples of what you'd want to get given the dict and some keys?
ndc85430 General Coding Help 6 1,270 Mar-28-2023, 05:50 AM
    Thread: Partial KEY search in dict
Post: RE: Partial KEY search in dict

As expected? "M2MWA" isn't found within any key of est_dict. Why are you expecting to find something?
ndc85430 General Coding Help 6 1,270 Mar-28-2023, 05:15 AM
    Thread: How to express null value
Post: RE: How to express null value

Dictionaries also have a get method that lets you specify a default value if the key is missing: https://docs.python.org/3/library/stdtyp...l#dict.get.
ndc85430 General Coding Help 3 860 Mar-25-2023, 09:23 AM
    Thread: Trying something that may not be possible?
Post: RE: Trying something that may not be possible?

Why are you using subprocess in the first place, rather than Python facilities for file and directory access (like os.scandir, or pathlib)?
ndc85430 General Coding Help 8 1,221 Mar-17-2023, 04:52 AM
    Thread: reduce nested for-loops
Post: RE: reduce nested for-loops

Agree with bowlofred above. What is the data you're working with? What does it represent? If it does have some hierarchical structure, then representing it that way (i.e. in some kind of tree) would ...
ndc85430 General Coding Help 11 1,905 Mar-16-2023, 06:28 PM
    Thread: Another one
Post: RE: Another one

Missing colon.
ndc85430 General Coding Help 2 17,707 Mar-07-2023, 08:02 PM
    Thread: I am confused with the key and value thing
Post: RE: I am confused with the key and value thing

Yes. Keys are to dicts what indexes (indices) are to lists and tuples.
ndc85430 General Coding Help 3 967 Feb-22-2023, 04:37 PM
    Thread: Cross 2 arrays
Post: RE: Cross 2 arrays

Another, similar library is Toolz: https://pypi.org/project/toolz/.
ndc85430 General Coding Help 4 1,026 Feb-09-2023, 04:44 AM
    Thread: Need help on how to include single quotes on data of variable string
Post: RE: Need help on how to include single quotes on d...

You shouldn't be using str.format to construct queries. Use your database's placeholder syntax instead. See, for example https://bobby-tables.com/.
ndc85430 General Coding Help 5 2,033 Jan-10-2023, 06:32 AM
    Thread: Adding values with reduce() function from the list of tuples
Post: RE: Adding values with reduce() function from the ...

Personally, I'd break the problem down into steps: turn the list of people into just a list of ages (which is a map or list comprehension) and then add those up (the reduce). The third party Tools li...
ndc85430 General Coding Help 10 2,666 Jan-06-2023, 06:43 AM
    Thread: How to print variables in function?
Post: RE: How to print variables in function?

I don't understand your question, since you seem to have posted a solution to it: create a dict and return it? Perhaps explain in more detail what you're really trying to achieve. Why, for instance, ...
ndc85430 General Coding Help 3 913 Dec-31-2022, 11:26 AM
    Thread: How to print directory files (& timestamps)
Post: RE: How to print directory files (& timestamps)

You really don't need to use Bash at all. It's certainly possible to write it in pure Python. Have you even looked at os.scandir as I suggested?
ndc85430 Homework 3 1,361 Dec-29-2022, 07:19 AM
    Thread: How to print directory files (& timestamps)
Post: RE: How to print directory files (& timestamps)

We aren't here to write the code for you. I'm curious about what you did find in a search, though. What about the os module? For a start, it contains a function scandir that may be useful.
ndc85430 Homework 3 1,361 Dec-29-2022, 04:20 AM

User Panel Messages

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