Python Forum
How to check an array exist in a file using Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to check an array exist in a file using Python
#4
A few things: One, list is a bad name for a list. It's the Python function for creating a list, and by using the name elsewhere you are cutting off code that might mess up something else. Two, Array == line[:4] is already a bool, you don't need to convert it to one. Three, bool is a subclass of int, to convert it to 1 or 0 you just need int(found).

Typing all that up made me figure out the problem: you want the second for loop to be over output_list, not list.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: How to check an array exist in a file using Python - by ichabod801 - Feb-22-2019, 02:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Newbie here. Create an array from file data? Rayj00 2 1,294 Jan-13-2023, 01:35 PM
Last Post: perfringo
  how to check if file path finish on .csv danlopek14q 4 11,068 Apr-04-2021, 09:50 AM
Last Post: danlopek14q

Forum Jump:

User Panel Messages

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