Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import easygui
from pathlib import Path, PurePath
import subprocess
'''GUI for choosing single wav file'''
# Needs modification (@moonman)
file_path = easygui.fileopenbox(
default='~/Desktop/*.wav',
filetypes=['*.wav'],
title='Choose a single wav file with solo instrument')
out_dir = easygui.diropenbox(
default='~/Music',
title='Choose ouput directory for generated spectrograms')
# Create output dir
file_path = Path(file_path)
out_dir = Path(out_dir, 'spectrograms')
out_dir.mkdir(exist_ok=True)
print("Created directory: ", out_dir)
# Execute preprocessor
subprocess.check_call(['python', '/home/miczi/Projects/single-instrument-recognizer/src/preprocessor.py',
'--single-file-input', str(file_path),
'--output-spectrograms-dir', str(out_dir)])
subprocess.check_call(['python', '/home/miczi/Projects/single-instrument-recognizer/src/mobilenet_train.py',
'-a', 'mobilenet',
- echo: echo output files.
"""
# Check Python version
version = sys.version_info.major
if version == 3:
global raw_input
raw_input = input
elif version == 2:
pass
else:
raise ValueError("You should use Python 2.x at least!")
# Try to run with easygui
try:
import easygui
folder = easygui.diropenbox(title="Folder for the job") + "/"
except:
folder = raw_input('Enter folder (empty for the current one): ')
return folder
def main():
print("Choose directory:")
choosen_path=easygui.diropenbox("Path containing .cpp files:")
try:
get_path=choosen_path+'\\'
newObtainedPath=generateMultiplePDF(get_path)
mergeIntoOnePDF(newObtainedPath)
except Exception as e:
print(str(e))
def _get_directory(self):
''' Dialog box for getting a directory to which to save files. '''
return easygui.diropenbox(msg="Where would you like to save the results files?", title="Choose a directory", default=None)
def _get_file_name(self, extension="txt"):
- name: name for the output files (if echo is True).
- echo: echo output files.
"""
# Check Python version
version = sys.version_info.major
if version == 3:
raw_input = input
elif version == 2:
pass
else:
raise ValueError("You should use Python 2.x at least!")
# Try to run with easygui
try:
import easygui
folder = easygui.diropenbox(title="Folder for the job") + "/"
except:
folder = raw_input('Enter folder (empty for the current one): ')
return folder
import assemutil as ass
#
# Check Python version
#
version = sys.version_info.major
if version == 3:
raw_input = input
elif version == 2:
pass
else:
raise ValueError("You should use Python 2.x at least!")
# Try to run with easygui
try:
import easygui
folder = easygui.diropenbox(title="Folder for the job") + "/"
name = easygui.enterbox("Enter the job name")
echo = easygui.buttonbox("Do you want to echo files?",
choices=["Yes", "No"])
except:
folder = raw_input('Enter folder (empty for the current one): ')
name = raw_input('Enter the job name: ')
spring_pos = raw_input("Do you have springs in your model? (y/N):")
echo = raw_input('Do you want to echo files? (y/N):')
start_time = datetime.now()
#%% PRE-PROCESSING
#
nodes, mats, elements, loads = pre.readin(folder=folder)