Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Fixing Code
#3
extractFile need pwd paramenter to be bytes not string.
Can do it in the function call.
if extractFile(zip_file, password.encode()):
The basic is.
>>> s = 'Secret'
>>> s
'Secret'
>>> type(s)
<class 'str'>
>>> 
>>> s_byte = s.encode() #Same as s.encode('utf-8')
>>> s_byte
b'Secret'
>>> type(s_byte)
<class 'bytes'>
Reply


Messages In This Thread
Help Fixing Code - by kianwalters05 - May-12-2020, 11:21 AM
RE: Help Fixing Code - by buran - May-12-2020, 11:26 AM
RE: Help Fixing Code - by snippsat - May-12-2020, 11:41 AM
RE: Help Fixing Code - by kianwalters05 - May-12-2020, 11:58 AM
RE: Help Fixing Code - by buran - May-12-2020, 12:05 PM
RE: Help Fixing Code - by kianwalters05 - May-12-2020, 12:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  (python) Can i get some help fixing a English to Morse translator? Pls AlexPython 7 1,621 Sep-12-2022, 02:55 AM
Last Post: AlexPython
  Invalid syntax error - need help fixing calgk01 3 3,308 Feb-23-2021, 08:41 PM
Last Post: nilamo
  Fixing a code error Twoshawns 5 2,778 May-14-2020, 11:56 AM
Last Post: Twoshawns
  Fixing "PermissionError: [Errno 13] Permission denied" puredata 17 72,684 Mar-09-2020, 03:20 PM
Last Post: syssy
  Fixing the code khanhcao 2 88,890 Feb-06-2020, 07:24 AM
Last Post: buran
  Fixing a problem with file.io ThickTac 2 2,630 Mar-13-2019, 10:13 PM
Last Post: ThickTac
  Fixing indentation issues. MuntyScruntfundle 9 4,220 Feb-02-2019, 05:55 PM
Last Post: snippsat
  Can anyone Please help on fixing this python code to connect and save things on sqlit Roscoes 2 2,918 Mar-06-2018, 04:48 AM
Last Post: Roscoes

Forum Jump:

User Panel Messages

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