Ask coding questions

← Back to all posts
How are Csv files handled?
RolandHall (2)

How do we create and find CSV files with Repl.it? It seems to me that I cant do it on the online version. Is that correct? How do I locate them if I create them?
The following code does not work, and yet I think it should work. I have uploaded the csv packages.

import csv
with open('mycsv.csv','w' newline='')as f:
thewriter=csv.writer(f)
thewriter.writerow(['one','two'.'three'])
thewriter.writerow(['A','B','C'])

Answered by TheForArkLD (770) [earned 5 cycles]
View Answer
Comments
hotnewtop
TheForArkLD (770)

I don’t know,you want load python file?
If you want run python file,add

import filename
filename.function()
RolandHall (2)

I want to create and find a CSV file on the Repl.it online page with both PC and Ipad as I am teaching it to students. I can do the code that creates a file, but it does not show where the file is. I presume that the csv file is created because no errors show, but where would the file be? How would I navigate to any files that I creater? @TheForArkLD

TheForArkLD (770)

@RolandHall Wait i understand what’s do you want.

TheForArkLD (770)

@RolandHall
1st. Change “/projects/myfile.txt” to “./projects/myfile.txt”.
2nd. Make projects folder.

RolandHall (2)

How do I make a projects folder? Does that require just clicking on Folders with a projects in it? I have done that at it did not work. Thanks for helping @TheForArkLD

TheForArkLD (770)

@RolandHall Can you find folder icon button?

RolandHall (2)

I have created a number of folders called project and yet I still cant add a CSV file to them via [email protected]

Is there a way that you could screenshot where you create the folders, and show the program to create a CSV file with repl.it?

RolandHall (2)

Thank you. It now seems to be working. I am not sure why it was working before, but now it is working :) I tried the things that everyone said and now, it seems to [email protected]

RolandHall (2)

I have created a folder and adjusted it... but it does not work. I have also created a folder separate to this called "projects" but it still does not work

RolandHall (2)

Both of these do not work