Python Forum
Launch another python command without waiting for a return.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Launch another python command without waiting for a return.
#13
You're calling the function talk directly and the return value of talk is called by executor, but the returned str is not callable. The executor needs to call the function. The name of a function is the reference to the function object living in memory. You can use also function as arguments.

This will fix your code.
future = executor.submit(talk, 'This will be, a long text for testing purpose.')
Function signature of Executor.submit
Function signature of threading.Thread


Very simplified the executor.submit looks like this:
def submit(function, *args, **kwargs):
    return fuction(*args, **kwargs)
The function submit calls the supplied function with arguments and keyword arguments.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: Launch another python command without waiting for a return. - by DeaD_EyE - Jun-18-2020, 07:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error on first Python launch garryp4 5 411 May-07-2024, 03:56 PM
Last Post: deanhystad
  Waiting for input from serial port, then move on KenHorse 3 1,265 Apr-17-2024, 07:21 AM
Last Post: DeaD_EyE
  pip stops waiting for python walker 6 1,155 Nov-28-2023, 06:55 PM
Last Post: walker
  Launch Python IDLE Shell from terminal Pavel_47 5 1,327 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Waiting for heavy functions question philipbergwerf 14 3,512 Apr-29-2022, 07:31 PM
Last Post: philipbergwerf
  How to create waiting process? samuelbachorik 4 2,028 Sep-02-2021, 05:41 PM
Last Post: bowlofred
  Launch Windows Application OEMS1 0 2,194 Mar-26-2021, 07:42 PM
Last Post: OEMS1
Photo Python won`t launch error newbieee 0 1,815 Feb-02-2021, 11:51 PM
Last Post: newbieee
  Waiting and listening test 2 2,200 Nov-13-2020, 04:43 PM
Last Post: michael1789
  waiting for barcode scanner output, while main program continues to run lightframe109 3 4,734 Sep-03-2020, 02:19 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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