Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with file handling
#2
0xb0 is the degree symbol. The interpreter is saying that it cannot decode that byte using the UTF-8 encoding. In your call to open(), try this:

f = open("cities.txt", "r", encoding = "utf-16")
Reply


Messages In This Thread
Help with file handling - by gonzo620 - Sep-26-2018, 11:33 PM
RE: Help with file handling - by stullis - Sep-27-2018, 01:27 AM
RE: Help with file handling - by Larz60+ - Sep-27-2018, 01:31 AM
RE: Help with file handling - by gonzo620 - Sep-27-2018, 03:41 AM
RE: Help with file handling - by Larz60+ - Sep-27-2018, 11:52 AM
RE: Help with file handling - by snippsat - Sep-27-2018, 02:07 PM
RE: Help with file handling - by Larz60+ - Sep-27-2018, 03:34 PM
RE: Help with file handling - by gonzo620 - Sep-27-2018, 03:42 PM
RE: Help with file handling - by snippsat - Sep-27-2018, 03:53 PM
RE: Help with file handling - by gonzo620 - Sep-27-2018, 05:50 PM
RE: Help with file handling - by nilamo - Sep-27-2018, 06:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  File Handling not working properly TheLummen 8 861 Feb-17-2024, 07:47 PM
Last Post: TheLummen
  file handling Newbee question middlecope 2 826 Jan-18-2023, 03:09 PM
Last Post: middlecope
Star python exception handling handling .... with traceback mg24 3 1,327 Nov-09-2022, 07:29 PM
Last Post: Gribouillis
  File handling issue GiggsB 4 1,488 Mar-31-2022, 09:35 PM
Last Post: GiggsB
  How can I solve this file handling issue? GiggsB 17 3,722 Feb-14-2022, 04:37 AM
Last Post: GiggsB
  How to solve this file handling issue? GiggsB 3 1,739 Jan-10-2022, 09:36 AM
Last Post: Gribouillis
  File handling knollfinder 3 2,095 Jun-28-2020, 07:39 PM
Last Post: knollfinder
  file handling sivareddy 1 1,663 Feb-23-2020, 07:28 PM
Last Post: jefsummers
  delete file with handling 3Pinter 1 2,125 Oct-17-2019, 04:06 PM
Last Post: 3Pinter

Forum Jump:

User Panel Messages

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