This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlrd | |
def getDataFromFile(fileName): | |
with xlrd.open_workbook(fileName) as wb: | |
# we are using the first sheet here | |
worksheet = wb.sheet_by_index(0) | |
# getting number or rows and setting current row as 0 -e.g first | |
num_rows, curr_row = worksheet.nrows - 1, 0 | |
# retrieving keys values(first row values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright (C) 2013 by Claudemiro Alves Feitosa Neto | |
# <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
notas = ['C', 'D', 'E', 'F', 'G', 'A', 'B'] | |
while True: | |
nota = random.randint(0, len(notas) - 1) | |
if nota == (len(notas) - 1): | |
nota = 0 |