Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在金字塔框架之上使用 python 制作 webapps。在我的一个利用 mechanize 进行简单网络抓取的函数中,当我将它作为独立的 python 脚本运行并通过金字塔运行时,该函数的行为会有所不同。
这是表现不同的机械化功能:
form = mechanize._form.ParseString(form, url)
我正在获取作为独立程序运行此功能的 Get 和 Post 表单,但只有通过金字塔运行它的 Get 表单。(蟒蛇2.7.2)
我错过了什么吗?我哪里做错了?
我不使用 mechanize 但也许这与 call 有关config.scan()。这样做的副作用是它递归地导入包中的每个模块,这些模块可以在代码中使用 mechanize 或类似的方式注册插件。
config.scan()