Python Forum
'str' object is not callable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'str' object is not callable
#5
(Aug-03-2021, 04:41 AM)ndc85430 Wrote: Don't name your variable hex.

Also:

Do you really need a global? Those should be avoided most of the time. You don't seen to be using it at global scope anyway.

import statements should go at the top of the file, not inside functions or otherwise in the middle of other code. Rationale: it interrupts reading of that code.

Hi!

if i did not declare a global in it, this error will appear "local variable 'hex' referenced before assignment"
i've shifted the statements on top too, thanks for the advice on this !
Reply


Messages In This Thread
'str' object is not callable - by ZYSIA - Jul-28-2021, 09:27 AM
RE: 'str' object is not callable - by Yoriz - Jul-28-2021, 09:46 AM
RE: 'str' object is not callable - by ZYSIA - Aug-03-2021, 03:40 AM
RE: 'str' object is not callable - by ndc85430 - Aug-03-2021, 04:41 AM
RE: 'str' object is not callable - by ZYSIA - Aug-03-2021, 05:23 AM
RE: 'str' object is not callable - by ndc85430 - Aug-03-2021, 05:58 AM
RE: 'str' object is not callable - by ZYSIA - Aug-03-2021, 06:11 AM
RE: 'str' object is not callable - by ndc85430 - Aug-03-2021, 06:45 AM
RE: 'str' object is not callable - by deanhystad - Aug-03-2021, 03:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error in class: TypeError: 'str' object is not callable akbarza 2 608 Dec-30-2023, 04:35 PM
Last Post: deanhystad
  TypeError: 'NoneType' object is not callable akbarza 4 1,158 Aug-24-2023, 05:14 PM
Last Post: snippsat
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 1,523 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  Need help with 'str' object is not callable error. Fare 4 915 Jul-23-2023, 02:25 PM
Last Post: Fare
  TypeError: 'float' object is not callable #1 isdito2001 1 1,134 Jan-21-2023, 12:43 AM
Last Post: Yoriz
  'SSHClient' object is not callable 3lnyn0 1 1,238 Dec-15-2022, 03:40 AM
Last Post: deanhystad
  TypeError: 'float' object is not callable TimofeyKolpakov 3 1,578 Dec-04-2022, 04:58 PM
Last Post: TimofeyKolpakov
  API Post issue "TypeError: 'str' object is not callable" makeeley 2 2,016 Oct-30-2022, 12:53 PM
Last Post: makeeley
  Merge htm files with shutil library (TypeError: 'module' object is not callable) Melcu54 5 1,713 Aug-28-2022, 07:11 AM
Last Post: Melcu54
  [split] TypeError: 'int' object is not callable flash77 4 2,838 Mar-21-2022, 09:44 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