lundi 25 février 2019

Preventing a function from outputting anything, even None? [on hold]

I have a case, in a real-time web scraping app, where a script is running on an interval and constantly updating a currently-populated table with new info, as it comes in. This app is a twitter app monitoring an account's new tweets.

Whenever a new tweet is detected, all that needs to be outputted is basically return new_tweet, but since not every interval update finds a newly minted tweet, it can only output return None (or some other empty default) most of the time The thing is, outputting None removes the entire table and all of the tweets processed up till that point.

So, is there a way to prevent a Python function from outputting anything, even None, if some conditions are met, by some breaking statement or whatnot?

Aucun commentaire:

Enregistrer un commentaire