Misc Cleanup Update

This commit is contained in:
2019-07-04 18:39:01 +02:00
parent 0269c384da
commit 841d47e9c1
7 changed files with 95 additions and 87 deletions

View File

@@ -11,11 +11,15 @@ from datetime import date
import multiprocessing import multiprocessing
# randomI function which creates each file # randomI function which creates each file
def randomI(units, rows, rowLength, partstart): def randomI(units, rows, rowLength, partstart):
for setcounter in range(0, units): for setcounter in range(0, units):
writeFile(generateFile(rows, rowLength), setcounter, partstart) writeFile(generateFile(rows, rowLength), setcounter, partstart)
# Function for generating the content of one single file # Function for generating the content of one single file
def generateFile(rows, rowLength): def generateFile(rows, rowLength):
content = [] content = []
for y in range(0, rows): for y in range(0, rows):
@@ -23,6 +27,8 @@ def generateFile(rows, rowLength):
return content return content
# Function for generating the content of one single row randomly # Function for generating the content of one single row randomly
def generateRow(rowLength): def generateRow(rowLength):
row = "" row = ""
for z in range(0, rowLength): for z in range(0, rowLength):
@@ -30,12 +36,15 @@ def generateRow(rowLength):
return row return row
# Function for writing data into a file # Function for writing data into a file
def writeFile(content, setcounter, partstart): def writeFile(content, setcounter, partstart):
filenumber = int(setcounter) + int(partstart) filenumber = int(setcounter) + int(partstart)
file = open("testdata/file" + str(filenumber) + ".txt", "w") file = open("testdata/file" + str(filenumber) + ".txt", "w")
for w in range(0, len(content)): for w in range(0, len(content)):
file.write(content[w] + "\n") file.write(content[w] + "\n")
if __name__ == '__main__': if __name__ == '__main__':
# Getting the user input # Getting the user input
print("Hello World") print("Hello World")

View File

@@ -1,24 +1,23 @@
#!/usr/bin/env python #!/usr/bin/env python
#title: main.py # title: main.py
#description: # description:
#author: Conrad Großer # author: Conrad Großer
#license: https://github.com/tchemn/miner/blob/master/LICENSE # license: https://github.com/tchemn/miner/blob/master/LICENSE
#date: 02.06.2018 # date: 02.06.2018
#version: 0.1 # version: 0.1
#usage: PENDING # usage: PENDING
#notes: # notes:
#dependencies: # dependencies:
#known_issues: # known_issues:
#python_version: 3.x # python_version: 3.x
#============================================================================== # ==============================================================================
# IMPORTS # IMPORTS
# Importing the time for benchmarking purposes # Importing the time for benchmarking purposes
import time import time
from datetime import date
# CODE (FUNCTIONS) # CODE
# EXECUTION # EXECUTION

View File

@@ -1,16 +1,16 @@
#!/usr/bin/env python #!/usr/bin/env python
#title: template.py # title: template.py
#description: Template for any programm # description: Template for any programm
#author: Authors seperated by comma # author: Authors seperated by comma
#license: License for the programm # license: License for the programm
#date: Date of creation # date: Date of creation
#version: Versionnumber # version: Versionnumber
#usage: Description of how to use the programm quickly # usage: Description of how to use the programm quickly
#notes: Notes for parameters, thanks (...) # notes: Notes for parameters, thanks (...)
#dependencies: Preinstalled packages # dependencies: Preinstalled packages
#known_issues: Known issues in this version # known_issues: Known issues in this version
#python_version: Compatible (tested) python version # python_version: Compatible (tested) python version
#============================================================================== # ==============================================================================
# IMPORTS # IMPORTS