Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Problem with csv
Post: RE: Problem with csv

(Mar-18-2021, 10:11 AM)Larz60+ Wrote: you can place the header in a list, then use csv reader (not DictReader) an example of using zip would be: header = ['col1', 'col2', 'col3', ...] # replace ...
giorgosmarga General Coding Help 4 2,379 Mar-18-2021, 11:07 AM
    Thread: Problem with csv
Post: RE: Problem with csv

(Mar-18-2021, 03:02 AM)Larz60+ Wrote: There are a couple of possibilities here. Does your csv file have a header? If not, you cannot use DictReader I think that your print function is never reached....
giorgosmarga General Coding Help 4 2,379 Mar-18-2021, 09:34 AM
    Thread: Problem with csv
Post: Problem with csv

def printGames(): with open("boardgames.csv", 'r') as csvfile: reader = csv.DictReader(csvfile) for row in reader: print(row) # print(line['title'] + ' ' +...
giorgosmarga General Coding Help 4 2,379 Mar-17-2021, 09:52 PM
    Thread: terminal to gui
Post: terminal to gui

I have 2 scripts scriptA and scriptB.Using multithreading i want to call scriptA and print sometihng on the terminal and I want to get that something and use it as a text in my gui . How to do it? So ...
giorgosmarga GUI 0 1,320 Feb-06-2021, 09:23 PM
    Thread: shuffle a nested list
Post: RE: shuffle a nested list

(Nov-12-2020, 05:36 PM)perfringo Wrote: (Nov-12-2020, 05:12 PM)giorgosmarga Wrote: Because i am confused shouldnt that code return the emptylist with 8 shuffled differenlty sublists? No, it should...
giorgosmarga General Coding Help 11 11,908 Nov-12-2020, 05:43 PM
    Thread: shuffle a nested list
Post: RE: shuffle a nested list

(Nov-12-2020, 05:09 PM)giorgosmarga Wrote: (Nov-12-2020, 05:03 PM)perfringo Wrote: Never change original post, explain and clarify in subsequent comments. Otherwise thread doesn't make sense for r...
giorgosmarga General Coding Help 11 11,908 Nov-12-2020, 05:12 PM
    Thread: shuffle a nested list
Post: RE: shuffle a nested list

(Nov-12-2020, 05:03 PM)perfringo Wrote: (Nov-12-2020, 04:53 PM)giorgosmarga Wrote: You are right i didnt give much details.I updated my post Never change original post, explain and clarify in subs...
giorgosmarga General Coding Help 11 11,908 Nov-12-2020, 05:09 PM
    Thread: shuffle a nested list
Post: RE: shuffle a nested list

(Nov-12-2020, 04:42 PM)perfringo Wrote: (Nov-12-2020, 04:09 PM)giorgosmarga Wrote: Hello can someone explain to me why this code doesnt work out What does mean 'doesnt work out'? Don't give expect...
giorgosmarga General Coding Help 11 11,908 Nov-12-2020, 04:53 PM
    Thread: shuffle a nested list
Post: RE: shuffle a nested list

(Nov-12-2020, 04:22 PM)DPaul Wrote: The first observation is line 5. "Append" decides for itself where to put the next item. You don't need to force the index upon the emptylist. Paul Yes you are r...
giorgosmarga General Coding Help 11 11,908 Nov-12-2020, 04:29 PM
    Thread: shuffle a nested list
Post: shuffle a nested list

Hello can someone explain to me why this code doesnt work out import random def randomlist(nums): emptylist = [] for j in range(0, 2**len(nums)): emptylist[j].append(random.shuffle(num...
giorgosmarga General Coding Help 11 11,908 Nov-12-2020, 04:09 PM
    Thread: How to get a random item from a list, print it and delete it?
Post: RE: lists

(Feb-22-2019, 04:56 PM)Yoriz Wrote: Yes, look at the random module and list methods.i am not sure that i can find it
giorgosmarga General Coding Help 3 2,578 Feb-22-2019, 05:16 PM
    Thread: How to get a random item from a list, print it and delete it?
Post: How to get a random item from a list, print it and...

Hi guys, I have a question Is there a way to get a random item from a list, print it and then delete the same random item from the list??
giorgosmarga General Coding Help 3 2,578 Feb-22-2019, 04:40 PM

User Panel Messages

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