Python Forum
Receiving this error in my "response" and causes script to return wrong status
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Receiving this error in my "response" and causes script to return wrong status
#11
One of these things is not like the others! The answer is easy to see if you really look and think about the results.

Maybe this will make it easier to see.
def ping(ip):
    return (
        ip,
        subprocess.run(
            f"ping {ip} -n 1", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL
        ).returncode,
    )
 
start = time.time()
 
park = ["www.wallmart.com", "www.walmart.com\n"]
  
executor = ThreadPoolExecutor(4)
df = pd.DataFrame(executor.map(ping, park), columns=["address", "state"])
Output:
address state 0 www.wallmart.com 0 1 www.walmart.com\n 1
Reply


Messages In This Thread
RE: Receiving this error in my "response" and causes script to return wrong status - by deanhystad - Aug-12-2023, 03:20 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Listening on receiving Interface (using scapy) CodyTheCodeNoob 1 1,561 Dec-22-2024, 10:51 PM
Last Post: PolandoFaker
  Handling receiving updates from user in Telebot mohsenamiri 0 1,175 Aug-26-2024, 09:25 AM
Last Post: mohsenamiri
  Wrong type error rowan_bradley 6 2,640 Aug-07-2023, 10:44 AM
Last Post: rowan_bradley
  Compiles Python code with no error but giving out no output - what's wrong with it? pythonflea 6 3,089 Mar-27-2023, 07:38 AM
Last Post: buran
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 4,980 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  SMA (simple moving avg) Not receiving Data (stock prices). gdbengo 2 2,077 Jul-31-2022, 08:20 PM
Last Post: paulyan
  Receiving snmp traps with more than one Community String ilknurg 0 3,590 Jan-19-2022, 09:02 AM
Last Post: ilknurg
  return out of loops syntax error felixf 7 4,989 Nov-03-2020, 01:00 PM
Last Post: perfringo
  ERROR: Command errored out with exit status 1 calesii 3 8,678 Oct-23-2020, 05:39 PM
Last Post: snippsat
  SystemError: error return without exception set!!! faryad13 3 5,036 Oct-23-2020, 02:32 PM
Last Post: ATARI_LIVE

Forum Jump:

User Panel Messages

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