LinkedIn-Bot icon indicating copy to clipboard operation
LinkedIn-Bot copied to clipboard

[Errno 22] Invalid argument

Open johnnycash133 opened this issue 2 years ago • 1 comments

File "C:\Users\Martin\Desktop\LinkedIn-Bot-master\LinkedIn-Bot-master\LinkedInBot-Convert.py", line 556, in createCSV with open(os.path.join(os.path.dirname(os.path.realpath(file)), 'CSV', filename), 'w') as csvFile: OSError: [Errno 22] Invalid argument: 'C:\Users\Martin\Desktop\LinkedIn-Bot-master\LinkedIn-Bot-master\CSV\Linked-In-04:31:03.827482.csv'

johnnycash133 avatar May 07 '22 11:05 johnnycash133

update code with following in LinkedInBot-Convert.py :

def createCSV(data, time): ''' Creates an initial CSV file. data is the list that will get added to the file (in this case, it's the headers). time is the time at creation of this file. ''' formatted_time = time.replace(":", "_") # Replace colons with underscores filename = 'Linked-In-' + formatted_time + '.csv' with open(os.path.join(os.path.dirname(os.path.realpath(file)), 'CSV', filename), 'w') as csvFile: writer = csv.writer(csvFile) writer.writerow(data) csvFile.close()

brettaio avatar Sep 01 '23 11:09 brettaio