Satrtscript and helper functions
This commit is contained in:
35
2024/helpingFunctions.py
Normal file
35
2024/helpingFunctions.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import sys, os
|
||||
|
||||
sampleMode = False
|
||||
|
||||
def identifyDay(inputArgument):
|
||||
twoDigitsDay = '00'
|
||||
day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'X') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')]
|
||||
twoDigitsDay = str(day).zfill(2)
|
||||
return twoDigitsDay
|
||||
|
||||
def setSampleMode(mode:bool):
|
||||
global sampleMode
|
||||
if (mode) : sampleMode = True
|
||||
return
|
||||
|
||||
def getSampleMode():
|
||||
return sampleMode
|
||||
|
||||
def showSampleMode():
|
||||
if ( getSampleMode() ):
|
||||
print ("----------------------")
|
||||
print ("Running im Sample Mode")
|
||||
print ("----------------------")
|
||||
return
|
||||
|
||||
def getPath2Data(aocDay):
|
||||
return './day'+str(aocDay)+'/'
|
||||
|
||||
def getFilename2Data(aocDay):
|
||||
dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'data.day'+str(aocDay)
|
||||
return dataFilename
|
||||
|
||||
def readDataFile (path, filename):
|
||||
data = ''
|
||||
return data
|
||||
Reference in New Issue
Block a user