Sinisterly
scoreboard with text file? - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Python (https://sinister.li/Forum-Python)
+--- Thread: scoreboard with text file? (/Thread-scoreboard-with-text-file)

Pages: 1 2


RE: scoreboard with text file? - Slarek - 12-05-2013

Print both key and content


RE: scoreboard with text file? - Slarek - 12-05-2013

Print both key and content


RE: scoreboard with text file? - joeb12 - 12-05-2013

Hmmm, this sound like somebody's homework.

1) Setup a loop (for probably) to iterrate around the file.
2) Read the first line to a temporary variable (let's say key).
3) Read the next line to a tempoary variable (let's say content).
4) Assign key:content to the dictionary.
5) Repeat until there are no more lines.


RE: scoreboard with text file? - joeb12 - 12-05-2013

Hmmm, this sound like somebody's homework.

1) Setup a loop (for probably) to iterrate around the file.
2) Read the first line to a temporary variable (let's say key).
3) Read the next line to a tempoary variable (let's say content).
4) Assign key:content to the dictionary.
5) Repeat until there are no more lines.


RE: scoreboard with text file? - hellomen - 12-05-2013

(12-05-2013, 04:41 PM)joeb12 Wrote: Hmmm, this sound like somebody's homework.

1) Setup a loop (for probably) to iterrate around the file.
2) Read the first line to a temporary variable (let's say key).
3) Read the next line to a tempoary variable (let's say content).
4) Assign key:content to the dictionary.
5) Repeat until there are no more lines.
not really homework just projects we are playing with
score.txt:
25000,name
10000,name
my teacher says:
make an array
read the content as score,name

sort the array
us for counter in range(1,11) :
do reading content like splitting blablabla

isue is prety much solved after working arround the teacher(s) idea which is almost the same as in here. XD


RE: scoreboard with text file? - hellomen - 12-05-2013

(12-05-2013, 04:41 PM)joeb12 Wrote: Hmmm, this sound like somebody's homework.

1) Setup a loop (for probably) to iterrate around the file.
2) Read the first line to a temporary variable (let's say key).
3) Read the next line to a tempoary variable (let's say content).
4) Assign key:content to the dictionary.
5) Repeat until there are no more lines.
not really homework just projects we are playing with
score.txt:
25000,name
10000,name
my teacher says:
make an array
read the content as score,name

sort the array
us for counter in range(1,11) :
do reading content like splitting blablabla

isue is prety much solved after working arround the teacher(s) idea which is almost the same as in here. XD