Python Forum
'int' object is not subscriptable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'int' object is not subscriptable
#1
my code
line = line.strip()
            except AttributeError:
                line = line
            line+1    
            lines = open("T:\donne\donne.txt").read().splitlines()
            lines.append([1])
            lines=line
            lines= int(linestowrite)
            open("T:\donne\donne.txt",'w').write((lines[1]).join(lines))
            break
my error
Error:
Traceback (most recent call last): File "Z:\programmepython\ssh2.py", line 49, in <module> open("T:\donne\donne.txt",'w').write((lines[1]).join(lines)) TypeError: 'int' object is not subscriptable
how I fix that? my var is all defined. I use python 3.7.1
Reply


Messages In This Thread
'int' object is not subscriptable - by lateublegende - Jan-23-2019, 04:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Bug TypeError: 'NoneType' object is not subscriptable TheLummen 4 820 Nov-27-2023, 11:34 AM
Last Post: TheLummen
  Help with python 'not subscriptable' error Extra 3 2,224 Dec-16-2022, 05:55 PM
Last Post: woooee
  TypeError: 'NoneType' object is not subscriptable syafiq14 3 5,345 Sep-19-2022, 02:43 PM
Last Post: Larz60+
  'int' object is not subscriptable after API call ed8484 1 1,861 Sep-18-2021, 02:06 PM
Last Post: ed8484
  Message='int' object is not subscriptable DanielCook 4 2,384 Aug-10-2021, 05:21 PM
Last Post: deanhystad
  Bool Object is not Subscriptable quest 1 4,226 May-02-2021, 11:12 AM
Last Post: Yoriz
  Float Object is not Subscriptable quest 2 2,948 Apr-20-2021, 09:28 AM
Last Post: quest
  TypeError: 'NoneType' object is not subscriptable Jmekubo 6 27,443 Sep-08-2020, 10:03 AM
Last Post: DigiTMG
  TypeError: 'type' object is not subscriptable Stef 1 4,604 Aug-28-2020, 03:01 PM
Last Post: Gribouillis
  'NoneType' object is not subscriptable Justchse 4 3,765 Aug-01-2020, 06:18 PM
Last Post: Justchse

Forum Jump:

User Panel Messages

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