Python Forum
Running A Parser In VSCode - And Write The Results Into A Csv-File
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running A Parser In VSCode - And Write The Results Into A Csv-File
#5
hi again

update - well i run Python 2.7.1

u will install and update the system - to run with version 3xy

i hope that i will be successful - i guess that i can do this again

$ python3 -c 'open("in", "w", newline="", encoding="UTF-8")'
$ python2 -c 'open("in", "w", newline="", encoding="UTF-8")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: file() takes at most 3 arguments (4 given)
since i nee to take care for the decoding options..see the above mentioned issues

 a UnicodeEncodeError, seems that my system default encoding isn't utf-8,

therefor, should i do some extra thing to avoid issues here!?
should i try with df.to_csv("data.csv", index=False, encoding="utf-8")
step one: i will update the python to 3.xy
step two: i will add all the arguments - so that we have


$ python3 -c 'open("in", "w", newline="", encoding="UTF-8")'
$ python2 -c 'open("in", "w", newline="", encoding="UTF-8")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: file() takes at most 3 arguments (4 given)
look forward to hear from you
Reply


Messages In This Thread
RE: Running A Parser In VSCode - And Write The Results Into A Csv-File - by apollo - Jan-14-2021, 08:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  What does .flush do? How can I change this to write to the file? Pedroski55 3 287 Apr-22-2024, 01:15 PM
Last Post: snippsat
  Last record in file doesn't write to newline gonksoup 3 480 Jan-22-2024, 12:56 PM
Last Post: deanhystad
  writing and running code in vscode without saving it akbarza 1 430 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  write to csv file problem jacksfrustration 11 1,618 Nov-09-2023, 01:56 PM
Last Post: deanhystad
  python Read each xlsx file and write it into csv with pipe delimiter mg24 4 1,553 Nov-09-2023, 10:56 AM
Last Post: mg24
  Updating sharepoint excel file odd results cubangt 1 900 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  error "cannot identify image file" part way through running hatflyer 0 717 Nov-02-2023, 11:45 PM
Last Post: hatflyer
  How do I read and write a binary file in Python? blackears 6 7,021 Jun-06-2023, 06:37 PM
Last Post: rajeshgk
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,144 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Read text file, modify it then write back Pavel_47 5 1,682 Feb-18-2023, 02:49 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020