omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Reading data file (.csv)

    Pythonista
    2
    3
    5143
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Lulazo
      Lulazo last edited by

      I am a newbie to python and pythonista with a very small experience on programming. I wrote a very simple python program that can read a .csv file that is located in my computer. Now, I would like to implement it in pythonista, so my question is: where will be the best place to locate that (csv) file so it can be read from pythonista? Should I use the dropbox module or there is better option for this. Thanks.

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        In the Pythonista editor, create a new "Plain Text File" and name it my_file.csv and paste your csv content into it.

        import csv
        with open('my_file.csv') as in_file:
            for row in csv.reader(in_file):
                print ', '.join(row)
        
        1 Reply Last reply Reply Quote 0
        • Lulazo
          Lulazo last edited by

          Thank you.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors