简体   繁体   中英

Attribute Error using the webbrowser module

I wrote this simple code and saved it as a .py file:

import webbrowser
webbrowser.open('https://school.bighistoryproject.com/bhplive')

However when I run it I get the following error:

AttributeError: partially initialized module 'webbrowser' has no attribute 'open' (most likely due to a circular import)

I know the code technically works because if I type each line individually in the Shell it works! What is going on?

Thanks

如果您的文件名为webbrowser.py ,则会导致AttributeError因为它尝试导入您的文件,而不是模块。

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