This might help you So basically I want to print a set number of tweets related to a topic that user enters but when I run the following code after giving in the input nothing happens, I see no output after that. I would be really grateful if you could tell me why :-) , Your language needs to be "en". This works:
searchTerm = input("Enter keyword/hashtag to search about : ")
number = int(input("How many tweets do you wanna print : "))
print ("Tweets with ", searchTerm, ": ")
for result in tweepy.Cursor(api.search, q=searchTerm, lang="en").items(number):
I wish this helpful for you Using C++11 threading facilities, you can simply spawn a "worker" thread that does the work while you wait for the input. std::async is an easy way to asynchronously get a result of an operation; your problem description isn't very precise, so I don't know what else I might add here.
Taking the input from auto-execute user login using ssh execute command
it fixes the issue setTimeout() doesn't mean execute the code after exactly N milliseconds. It rather means, don't execute the code for at least N milliseconds. The asynchronous code such as the setTimeout() callback is put on an event loop queue until all syncrhonous code finishes executing, and then it's run. This includes any async code that gets run in the queue before the timeout period. Your callback can run only after all those are done.