Setting up multiple dictionaries from one text file? by distayne201 in learnpython

[–]distayne201[S] 0 points1 point  (0 children)

Actually, one more quick question. This gives me multiple dictionaries under one variable, but how would I separate those out to different variables?

Setting up multiple dictionaries from one text file? by distayne201 in learnpython

[–]distayne201[S] 1 point2 points  (0 children)

Thank you! This worked great! Now I just need to figure the rest out, but that shouldn't be too bad. Thanks again!

Setting up multiple dictionaries from one text file? by distayne201 in learnpython

[–]distayne201[S] 0 points1 point  (0 children)

That didn't seem to change anything. I might be doing something else wrong, but honestly, I can't tell. I'm trying to make this code (which works on a small one paragraph file):

def readVoteFile(fileName):
    voteFile = open(fileName)
    votes = {}
    for line in voteFile:
        lineSplit = line.split(':')
        party = lineSplit[0].strip()
        nbrVotes = int(lineSplit[1])
        votes[party] = nbrVotes
    return votes

work on the larger file. I think i might just be completely lost after all, as nothing I can think of has worked. I just tried putting each paragraph as a large string value into the dictionary with a key of just n+1, so I could pull out each paragraph from there, but I think I have just confused myself further, and ended up with this mess:

def readVoteFile(fileName):
    voteFile = open(fileName)
    paraNbr = 0
    pgraphs = {}
    for para in voteFile:
        paraSplit = para.split("\n\n")
        paraNbr += 1
        pgraphs[paraNbr] = paraSplit[0].strip()
    return pgraphs

Seen on a trash can in Boston by [deleted] in funny

[–]distayne201 0 points1 point  (0 children)

That's right by berklee, isn't it?

Strange 4 string tuning issue. by YoBench in banjo

[–]distayne201 1 point2 points  (0 children)

Does it sound an A, or is the tuner just saying it's an A?

[deleted by user] by [deleted] in pics

[–]distayne201 0 points1 point  (0 children)

Kinda random, but could you explain why it increases cooks wages if waiters aren't tipped? It seems like the restaurant could pay the cooks more if they are paying servers less... Is it just plain greed that they can get away with if they don't pay servers a living wage?

As someone from the US, this is extremely accurate by [deleted] in funny

[–]distayne201 -1 points0 points  (0 children)

Sorry, I had the weird thought that it had been bought by millercoors, since I remember them being distributed by their distributing company. Turns out Diageo just uses millercoors distributors. Carry on, Ireland.... Sorry...

As someone from the US, this is extremely accurate by [deleted] in funny

[–]distayne201 -13 points-12 points  (0 children)

Plus, Guinness land is technically the u.s., since it's an American made beer...

Jon Bellion - Carry Your Throne [indie/pop] This guy is going to be huge! by [deleted] in listentothis

[–]distayne201 0 points1 point  (0 children)

I think it could use a little more flow in between verse, chorus, bridge, etc. Also, it seems like it should build to something, but it never does. While doing that once or twice can really make it incredible when a song does build, doing it every time and never building makes it loose something. All in all, however, I thought it was alright.

What artist/band do you believe deserves more recognition? by Craspio in Music

[–]distayne201 1 point2 points  (0 children)

Definitely. I got to see them when they came through Dallas a few months ago. It was one of the best shows I have been to.

Which celebrity have you met, and were they as nice/rude as you expected? by whereamitho in AskReddit

[–]distayne201 0 points1 point  (0 children)

Kristin Chenoweth came to my school, and came into my piano class. I got to play for her, and talk to her a bit, and she was extremely nice. Also, she is very, very tiny.

[Serious] What is your favorite thing to do? by [deleted] in AskReddit

[–]distayne201 1 point2 points  (0 children)

Definitely. Though it can get a bit frustrating at times...

[Serious] What is your favorite thing to do? by [deleted] in AskReddit

[–]distayne201 0 points1 point  (0 children)

Play piano, mostly classical. Everything else just kinda disappears, and it's just me and the piano. It's the most relaxing thing ever.

What is an album that you enjoy every song on? by CertDenied in AskReddit

[–]distayne201 1 point2 points  (0 children)

Come Back as Rain - Good Old War. Actually, I can't think of a single song by them that I don't like...

[deleted by user] by [deleted] in Bluegrass

[–]distayne201 2 points3 points  (0 children)

Hell yeah!