Misc Cleanup Update
This commit is contained in:
@@ -11,11 +11,15 @@ from datetime import date
|
||||
import multiprocessing
|
||||
|
||||
# randomI function which creates each file
|
||||
|
||||
|
||||
def randomI(units, rows, rowLength, partstart):
|
||||
for setcounter in range(0, units):
|
||||
writeFile(generateFile(rows, rowLength), setcounter, partstart)
|
||||
|
||||
# Function for generating the content of one single file
|
||||
|
||||
|
||||
def generateFile(rows, rowLength):
|
||||
content = []
|
||||
for y in range(0, rows):
|
||||
@@ -23,6 +27,8 @@ def generateFile(rows, rowLength):
|
||||
return content
|
||||
|
||||
# Function for generating the content of one single row randomly
|
||||
|
||||
|
||||
def generateRow(rowLength):
|
||||
row = ""
|
||||
for z in range(0, rowLength):
|
||||
@@ -30,12 +36,15 @@ def generateRow(rowLength):
|
||||
return row
|
||||
|
||||
# Function for writing data into a file
|
||||
|
||||
|
||||
def writeFile(content, setcounter, partstart):
|
||||
filenumber = int(setcounter) + int(partstart)
|
||||
file = open("testdata/file" + str(filenumber) + ".txt", "w")
|
||||
for w in range(0, len(content)):
|
||||
file.write(content[w] + "\n")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# Getting the user input
|
||||
print("Hello World")
|
||||
|
||||
27
src/main.py
27
src/main.py
@@ -1,24 +1,23 @@
|
||||
#!/usr/bin/env python
|
||||
#title: main.py
|
||||
#description:
|
||||
#author: Conrad Großer
|
||||
#license: https://github.com/tchemn/miner/blob/master/LICENSE
|
||||
#date: 02.06.2018
|
||||
#version: 0.1
|
||||
#usage: PENDING
|
||||
#notes:
|
||||
#dependencies:
|
||||
#known_issues:
|
||||
#python_version: 3.x
|
||||
#==============================================================================
|
||||
# title: main.py
|
||||
# description:
|
||||
# author: Conrad Großer
|
||||
# license: https://github.com/tchemn/miner/blob/master/LICENSE
|
||||
# date: 02.06.2018
|
||||
# version: 0.1
|
||||
# usage: PENDING
|
||||
# notes:
|
||||
# dependencies:
|
||||
# known_issues:
|
||||
# python_version: 3.x
|
||||
# ==============================================================================
|
||||
|
||||
# IMPORTS
|
||||
|
||||
# Importing the time for benchmarking purposes
|
||||
import time
|
||||
from datetime import date
|
||||
|
||||
# CODE (FUNCTIONS)
|
||||
# CODE
|
||||
|
||||
|
||||
# EXECUTION
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
#title: template.py
|
||||
#description: Template for any programm
|
||||
#author: Authors seperated by comma
|
||||
#license: License for the programm
|
||||
#date: Date of creation
|
||||
#version: Versionnumber
|
||||
#usage: Description of how to use the programm quickly
|
||||
#notes: Notes for parameters, thanks (...)
|
||||
#dependencies: Preinstalled packages
|
||||
#known_issues: Known issues in this version
|
||||
#python_version: Compatible (tested) python version
|
||||
#==============================================================================
|
||||
# title: template.py
|
||||
# description: Template for any programm
|
||||
# author: Authors seperated by comma
|
||||
# license: License for the programm
|
||||
# date: Date of creation
|
||||
# version: Versionnumber
|
||||
# usage: Description of how to use the programm quickly
|
||||
# notes: Notes for parameters, thanks (...)
|
||||
# dependencies: Preinstalled packages
|
||||
# known_issues: Known issues in this version
|
||||
# python_version: Compatible (tested) python version
|
||||
# ==============================================================================
|
||||
|
||||
# IMPORTS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user