Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: match type with value in csv parsing function
Post: RE: match type with value in csv parsing function

What I've understood thus far is that this wouldn't/shouldn't work: row = [ func(row) for func in types ]I am applying the function (str) to the entire list and it doesn't make sense. Whereas iterati...
vinci General Coding Help 2 1,300 Jan-21-2022, 11:12 AM
    Thread: match type with value in csv parsing function
Post: match type with value in csv parsing function

Hello, In the following code I do some parsing of files (csv): #!/usr/bin/env python3 import csv def parse_csv(filename, select=None, types=None): ''' Parse a CSV file into a list of record...
vinci General Coding Help 2 1,300 Jan-20-2022, 01:33 PM
    Thread: lists as arguments
Post: lists as arguments

Another stupidly simply question, but I have to ask anyway: why do some functions expect their arguments to be what I assume to be lists (square brackets)? So for instance the bytes function expects t...
vinci General Coding Help 2 1,659 Oct-26-2020, 04:21 PM
    Thread: parser.parse_args() meaning
Post: RE: parser.parse_args() meaning

Thank you for the explanation. I had no idea, that you can write superfluous arguments that are otherwise ignored. That makes more sense to me.
vinci General Coding Help 2 2,600 Oct-26-2020, 04:13 PM
    Thread: parser.parse_args() meaning
Post: parser.parse_args() meaning

This is a simple question, but I'm asking it anyway, because I can't figure out the answer by myself: why do we need the args = parser.parse_args() after setting up the arguments in a python program? ...
vinci General Coding Help 2 2,600 Oct-14-2020, 09:09 PM
    Thread: understanding basic loop behaviour
Post: RE: understanding basic loop behaviour

Ok, I've changed two code to something like this in order to make more sense of what is actually happening, and now I have a better understanding of what's going on, even though I still find it somewh...
vinci General Coding Help 5 2,873 Feb-11-2020, 09:53 PM
    Thread: understanding basic loop behaviour
Post: RE: understanding basic loop behaviour

Maybe I should have mentioned from the very beginning that I'm really not a knowledgeable programmer (I mean, I'm not a programmer at all), but I thought the question that I've asked would already rev...
vinci General Coding Help 5 2,873 Feb-10-2020, 07:07 PM
    Thread: understanding basic loop behaviour
Post: understanding basic loop behaviour

Hello, I'm finding it difficult to understand the behaviour of the while loop inside the for loop. To be more exact, I don't understand why the output.append function is able to gather all the words,...
vinci General Coding Help 5 2,873 Feb-10-2020, 05:48 PM
    Thread: hangman doesn't end after guessing the word
Post: RE: hangman doesn't end after guessing the word

The code works. The problem is that it doesn't work as it's supposed to work when the word contains letters which repeat themselves, as I've already stated. I've just found the solution, though. Inste...
vinci Game Development 3 1,845 Nov-06-2019, 09:49 PM
    Thread: hangman doesn't end after guessing the word
Post: hangman doesn't end after guessing the word

Hi, I should say from the beginning that I'm very new in Python. I've been following a video tutorial where hangman is being tested. I've got the following code which seems to work for the guy who te...
vinci Game Development 3 1,845 Nov-06-2019, 09:02 PM

User Panel Messages

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