Code Cleanup I
- Added template for python scripts - Removed outdated randomI version
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#title: kmeansMkI.py
|
#title: kmeansMkI.py
|
||||||
#description: Our personal Python K-Means++ implementation
|
#description: Our personal Python K-Means++ implementation
|
||||||
#author: Tillmann Brendel, Conrad Großer
|
#author: Tillmann Brendel, Conrad Großer
|
||||||
|
#license: Pending
|
||||||
#date: 26.05.2018
|
#date: 26.05.2018
|
||||||
#version: 1.0
|
#version: 1.0
|
||||||
#usage: python pyscript.py
|
#usage: python pyscript.py
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
from random import randint
|
|
||||||
|
|
||||||
def generatePLZ():
|
|
||||||
plz = ""
|
|
||||||
for i in range(0,5):
|
|
||||||
plz = plz + str(randint(0,9))
|
|
||||||
return plz
|
|
||||||
|
|
||||||
def generateTel():
|
|
||||||
telephone = ""
|
|
||||||
for i in range(0, 11):
|
|
||||||
telephone = telephone + str(randint(0,9))
|
|
||||||
return telephone
|
|
||||||
@@ -1,4 +1,15 @@
|
|||||||
# Meet randomI Mk II, a random data generator for test data generation
|
#!/usr/bin/env python
|
||||||
|
#title: randomI2.1.py
|
||||||
|
#description: Personal
|
||||||
|
#author: Tillmann Brendel, Conrad Großer
|
||||||
|
#license: Pending
|
||||||
|
#date: 26.05.2018
|
||||||
|
#version: 1.0
|
||||||
|
#usage: python pyscript.py
|
||||||
|
#notes:
|
||||||
|
#known_issues:
|
||||||
|
#python_version: 3.x
|
||||||
|
#==============================================================================
|
||||||
|
|
||||||
# For random generation of numbers import randint
|
# For random generation of numbers import randint
|
||||||
from random import randint
|
from random import randint
|
||||||
@@ -9,6 +20,7 @@ from datetime import date
|
|||||||
|
|
||||||
# Importing for multi core processing
|
# Importing for multi core processing
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
|
||||||
def generate09():
|
def generate09():
|
||||||
plz = "09"
|
plz = "09"
|
||||||
for i in range(0,3):
|
for i in range(0,3):
|
||||||
|
|||||||
35
src/template.py
Normal file
35
src/template.py
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/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 (...)
|
||||||
|
#known_issues: Known issues in this version
|
||||||
|
#python_version: Compatible (tested) python version
|
||||||
|
#==============================================================================
|
||||||
|
|
||||||
|
# IMPORTS
|
||||||
|
|
||||||
|
# Importing the time for benchmarking purposes
|
||||||
|
import time
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
|
# CODE (FUNCTIONS)
|
||||||
|
|
||||||
|
|
||||||
|
# EXECUTION
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# Print welcoming message
|
||||||
|
print("Hello world")
|
||||||
|
|
||||||
|
# For benchmarking starting the timer now
|
||||||
|
start_time = time.time()
|
||||||
|
|
||||||
|
# Get parameters, call functions, execute program (...)
|
||||||
|
|
||||||
|
# BENCHMARKING [END]
|
||||||
|
sec = time.time() - start_time
|
||||||
|
print("The program took " + str(sec) + " seconds (" + str(sec/60) + " minutes) for execution.")
|
||||||
Reference in New Issue
Block a user