Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable list
#5
(Aug-18-2018, 09:17 PM)Ivan86 Wrote:
    for val in result:
        writer.writerow([result]) 

That's still exactly the same situation, though. You've got a few things in a bag, and then you say "for each thing in this bag, look at the bag". The file has everything listed multiple times, because you're writing everything to the file, over and over again.
Reply


Messages In This Thread
Variable list - by Ivan86 - Aug-18-2018, 09:02 PM
RE: Variable list - by nilamo - Aug-18-2018, 09:13 PM
RE: Variable list - by ichabod801 - Aug-18-2018, 09:13 PM
RE: Variable list - by Ivan86 - Aug-18-2018, 09:17 PM
RE: Variable list - by nilamo - Aug-18-2018, 09:55 PM
RE: Variable list - by ichabod801 - Aug-18-2018, 09:59 PM
RE: Variable list - by Ivan86 - Aug-18-2018, 10:37 PM
RE: Variable list - by ichabod801 - Aug-18-2018, 11:16 PM
RE: Variable list - by Ivan86 - Aug-19-2018, 07:21 AM
RE: Variable list - by snippsat - Aug-19-2018, 12:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Split string using variable found in a list japo85 2 1,363 Jul-11-2022, 08:52 AM
Last Post: japo85
  An IF statement with a List variable dedesssse 3 8,537 Jul-08-2021, 05:58 PM
Last Post: perfringo
  Create variable and list dynamically quest_ 12 4,585 Jan-26-2021, 07:14 PM
Last Post: quest_
Question Matching variable to a list index Gilush 17 6,052 Nov-30-2020, 01:06 AM
Last Post: Larz60+
  Print variable values from a list of variables xnightwingx 3 2,686 Sep-01-2020, 02:56 PM
Last Post: deanhystad
  Multiplication between a list and a variable doug2019 2 2,204 Oct-08-2019, 04:10 AM
Last Post: doug2019
  Sub: Python-3: Better Avoid Naming A Variable As list ? adt 9 4,117 Aug-29-2019, 08:15 AM
Last Post: adt
  Score each word from list variable pythonias2019 6 3,425 Jun-13-2019, 05:44 PM
Last Post: gontajones
  How to store the value from variable into list & run a statement then put in variable searching1 1 2,509 May-29-2019, 06:36 AM
Last Post: heiner55
  copy list into variable poroton 1 2,651 Aug-10-2018, 07:19 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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