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
try: | |
# For python 3.8 and later | |
import importlib.metadata as importlib_metadata | |
except ImportError: | |
# For everyone else | |
import importlib_metadata | |
from stevedore import ExtensionManager | |
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
from configparser import ConfigParser | |
def generate_data(filename, name): | |
"""This function read parameters from an ini file and generates data depending on the 'dtype' option.""" | |
config = ConfigParser() | |
config.read(filename) | |
mode = config.get(name, "mode", fallback="discrete") | |
dtype = config.get(name, "dtype", fallback="string") | |
if mode == "discrete": | |
if dtype == "int": |
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
class ConvertFunctions(): | |
def f2c(self): | |
strtemps = input("Please enter your fahrenheit temperature(s): ") | |
ftemps = [float(ftemp) for ftemp in strtemps.split()] | |
ctemps = [(ftemp-32) * 5/9 for ftemp in ftemps] | |
for (ftemp, ctemp) in zip(ftemps, ctemps): | |
print(f"F:{ftemp:.2f} = C:{ctemp:.2f}") | |
def m2cm(self): | |
strm = input("Please enter the meters: ") |
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
class ConvertFunctions(): | |
def f2c(self, ftemps): | |
return [(ftemp-32) * 5/9 for ftemp in ftemps] | |
def m2cm(self, lmeters): | |
return [meters*100 for meters in lmeters] | |
def main(): | |
convert = ConvertFunctions() | |
while True: |
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
' Perforce Jenkins Trigger Script | |
' | |
' This script is meant to be called from a Perforce trigger. | |
' It should be placed on the Perforce Server machine. | |
' See usage information below for more details. | |
' | |
' Adapted from swarm-trigger.vbs | |
' | |
' | |
' Prerequisites: |