Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a CSV writer to the All-in-One script #46

Open
Ci4D opened this issue Jan 8, 2020 · 4 comments
Open

Adding a CSV writer to the All-in-One script #46

Ci4D opened this issue Jan 8, 2020 · 4 comments
Labels
notice This issue is resolved, but left open for posterity/visibility

Comments

@Ci4D
Copy link

Ci4D commented Jan 8, 2020

Could anyone help me with this? I tried to add a csv writer to the all-in-one script so that each row indicated the variables taken at each interval. However I couldnt get this to work properly. Does anyone have anything similar they could share? Thanks

@hulleyrob
Copy link

example? using the logging module would do the job then just output comma separated variables if that is the format you are after. Not sure this is really an issue though.

@Ci4D
Copy link
Author

Ci4D commented Jan 8, 2020

Sorry this might be the wrong place to ask. I am trying to write the values read for each measurement to a csv.

@hulleyrob
Copy link

hulleyrob commented Jan 8, 2020

import csv

output = [[1,2,3,4],[5,6,7,8]]

with open('//Users/homefolder/csv_file.csv', mode='w') as csv_file:
    csv_output = csv.writer(csv_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
    for a,b,c,d in output:
        csv_output.writerow([a,b,c,d])

something like that should be enough for you to get the idea

@Ci4D
Copy link
Author

Ci4D commented Jan 8, 2020

Awesome, thanks a lot!

@Gadgetoid Gadgetoid added the notice This issue is resolved, but left open for posterity/visibility label Mar 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notice This issue is resolved, but left open for posterity/visibility
Projects
None yet
Development

No branches or pull requests

3 participants