示例#1
0
def convertToSCV(inputFolder, outputFolder):
    """
        Standard function to convert wave files in folders
        to their respective csv files
    """
    src = files.listDir(inputFolder)
    for f in src:
        waves = wave.loadWave(inputFolder + f)
        frames = wave.getSamples(waves)
        files.write(outputFolder + f[:-4] + ".csv", frames)
示例#2
0
def convertToSCV(inputFolder, outputFolder):
    """
        Standard function to convert wave files in folders
        to their respective csv files
    """
    src = files.listDir(inputFolder)
    for f in src:
        waves = wave.loadWave(inputFolder+f)
        frames = wave.getSamples(waves)
        files.write(outputFolder + f[:-4] + ".csv", frames)
示例#3
0
def interactiveAppend():
    #Define new instance of account to append
    accountToAdd = account.Account()

    while accountToAdd.setServer(raw_input('Remote server of your mail service: ')) is False:
        print 'Empty or invalid server'

    while accountToAdd.setProtocol(raw_input('Protocol [IMAP/POP3]: ')) is False:
        print 'Invalid input, IMAP or POP3 expected'

    while accountToAdd.setEmail(raw_input('Email address: ')) is False:
        print 'Empty or invalid email'

    while accountToAdd.setPassword(getpass.getpass('Password: '******'Empty or invalid password'

    while accountToAdd.setKeep(raw_input('Keep read emails [y/n] (default to yes): ')) is False:
        print 'Invalid input, \'y\' or \'n\' expected'

    #Format data to fetch procmail syntax
    parsedAccount = accountToAdd.format()
    
    #Write down to fetchmail configuration file
    files.write(conf.FETCHMAILRC, parsedAccount)
 def export(self, filename):
     write(filename, self.graph.serialize(format='ttl').decode('utf-8'))