简体   繁体   中英

If I make a simple gui for my python script, would it affect its efficiency?

Hi I want to make a web crawler that checks URL for data, If i make a simple Gui that would make the script easier to look for variables in that data, Would adding code for the gui make my web crawler less efficient ?

I need the crawler to be as efficient as possible, to be able to process data as fast as possible. Would making a gui for this Python script, hinder the performance of the web crawler ?

As long as you clearly separate your GUI logic from your processing logic, it shouldn't. As is the case with all optimization though, the best approach is to make the thing work first, then profile and optimize if it isn't performing fast enough for you.

I would suggest you first create your web crawler and forget the GUI. Profile and optimize it if you think it's too slow. Build it with the goal of it being an importable library. Once that works from the command line, then create your GUI front-end and bind your web crawling library functions and classes to the buttons and fields in your GUI. That clear separation should ensure that the GUI logic doesn't interfere with the performance of the web crawling. In particular, try to avoid updating the GUI with status information in the middle of the web crawling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM