To convert Matlab code fullfile('export', datestr(now)) to Python

Asked 1 years ago, Updated 1 years ago, 72 views

Switching matlab code to Python. I'm having a hard time switching fullfile('export', datestr(now)), I only knew until datetime.datetime.now() to extract the current time.

How can I change it to Python code?

matlab python

2022-09-20 20:19

1 Answers

Run result of fullfile('export', datestr(now)): 'export\26-Aug-2020 15:15:32'

'export'+'\'+str(datetime.datetime.now()) Execution Result: 'export\2020-08-26 15:18:51.907804'

Code

import datetime
print('export'+'\\'+str(datetime.datetime.now()))

Results


2022-09-20 20:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.