Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for lin in openfile:
#2
open() takes optional encoding parameter


from the docs

Quote:encoding is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent (whatever locale.getpreferredencoding() returns), but any text encoding supported by Python can be used. See the codecs module for the list of supported encodings.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
for lin in openfile: - by Skaperen - Jun-27-2018, 03:41 AM
RE: for lin in openfile: - by buran - Jun-27-2018, 06:50 AM
RE: for lin in openfile: - by snippsat - Jun-27-2018, 09:14 AM
RE: for lin in openfile: - by Skaperen - Jun-27-2018, 10:02 PM
RE: for lin in openfile: - by snippsat - Jun-27-2018, 10:48 PM
RE: for lin in openfile: - by Skaperen - Jun-28-2018, 02:01 AM
RE: for lin in openfile: - by snippsat - Jun-28-2018, 12:47 PM
RE: for lin in openfile: - by DeaD_EyE - Jun-28-2018, 02:19 PM
RE: for lin in openfile: - by Skaperen - Jun-28-2018, 08:53 PM
RE: for lin in openfile: - by snippsat - Jun-28-2018, 09:42 PM
RE: for lin in openfile: - by Skaperen - Jun-28-2018, 11:36 PM
RE: for lin in openfile: - by snippsat - Jun-29-2018, 07:52 AM
RE: for lin in openfile: - by Skaperen - Jun-29-2018, 09:59 PM
RE: for lin in openfile: - by snippsat - Jun-30-2018, 12:07 PM
RE: for lin in openfile: - by Skaperen - Jun-30-2018, 05:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  combobox_callback(choice choice part of openfile name (kind of dependency) janeik 9 1,684 Sep-10-2023, 10:27 PM
Last Post: janeik

Forum Jump:

User Panel Messages

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