Computational aesthetics is a field that combines science and art to explore aesthetic measurement, generative art, and design generation using computational methods. In the context of university library websites, adhering to aesthetic standards, particularly focusing on "moderate visual complexity," could enhance their visibility online (according to some previous studies). This research, analyzed 82 university library websites, including top international and Iranian academic libraries, to assess visual complexity based on Berlyne's theory of stimulus complexity using the Athec Python library. The study found that international university libraries have a complexity of over 0.57, while Iranian academic libraries lack the minimum complexity needed to motivate users. Moreover, the study found significant differences between the library websites of top Iranian and international universities. The linear regression statistic test was used to analyze the relationship between the visual complexity of academic library websites and the rank of the university, revealing a significant difference for the 41 top Iranian universities but not for the 41 top international universities. The Beta coefficient of linear regression between the visual complexity of academic library websites and the rank of the university is -0.502, and Sig=0.001, obtained for the top Iranian universities. On the other hand, the Beta coefficient of linear regression between the visual complexity of academic library websites and the ranks of the university is -0.062, and Sig=0.701, obtained for top international universities. This research highlights the innovation of connecting Berlyne’s theory of stimulus complexity with Python programming, providing a new perspective for university library website managers.