Python Forum
How to output one value per request of the CSV and print it in another func?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to output one value per request of the CSV and print it in another func?
#3
It's better not to use reserved words when declaring variables, such as for str in data:, because if you need to use the str() function in that loop, you won't be able to.

Such usage can lead to confusion if you've used the likes of str = "Whatever" at some point and need the function further down; an error such as [builtins.TypeError: 'str' object is not callable] could very well throw you for a while, until you figure out what you've done: code blindness sets in, along with some frustration, if you fail to spot the mistake right away -- prevention is better than a cure.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
RE: How to output one value per request of the CSV and print it in another func? - by rob101 - Nov-11-2022, 06:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I print from within actor(func) ?? Pedroski55 2 1,059 May-01-2024, 05:35 AM
Last Post: Pedroski55
  Python VS Code: using print command twice but not getting output from terminal kdx264 4 2,310 Jan-16-2023, 07:38 PM
Last Post: Skaperen
  How to print the output of a defined function bshoushtarian 4 2,465 Sep-08-2022, 01:44 PM
Last Post: deanhystad
Sad Want to Save Print output in csv file Rasedul 5 16,103 Jan-11-2022, 07:04 PM
Last Post: snippsat
Photo print output none 3lnyn0 4 2,988 Nov-01-2021, 08:46 PM
Last Post: 3lnyn0
  how can I correct the Bad Request error on my curl request tomtom 8 7,515 Oct-03-2021, 06:32 AM
Last Post: tomtom
  output correction using print() function afefDXCTN 3 13,747 Sep-18-2021, 06:57 PM
Last Post: Sky_Mx
  print (output) taaperaban 3 2,822 Sep-03-2021, 04:23 PM
Last Post: deanhystad
  Getting a GET request output text into a variable to work with it. LeoT 2 5,744 Feb-24-2021, 02:05 PM
Last Post: LeoT
  print function output wrong with strings. mposwal 5 4,413 Feb-12-2021, 09:04 AM
Last Post: DPaul

Forum Jump:

User Panel Messages

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