pyppeteer 异常处理 ValueError: signal only works in main thread

使用定时器出现pyppeteer 异常

'handleSIGINT':False,
'handleSIGTERM': False,
'handleSIGHUP': False,

 

self.browser = await launch(handleSIGINT=False,
                            handleSIGTERM=False,
                            handleSIGHUP=False,
                            headless=False,
                            args=['--disable-infobars',
                                  f'--window-size={self.width},{self.height}',
                                  f'--proxy-server={self.ip}'])
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
@app.route('/get_trip_time', methods=['POST']) def get_trip_time(): data = request.get_json() method = data['method'] center_coor = data['center_coor'] t = data['t'] radius = get_radius(method, t) gtt = GetTripTime(method, center_coor, t, radius) gtt.main() return jsonify({'message': 'Trip time data collected successfully'}) @app.route('/visualize_trip_time', methods=['GET']) def visualize_trip_time(): data = pd.read_csv('time1.csv') lng = data['lng'] lat = data['lat'] time = data['time'] grid_lng, grid_lat = np.meshgrid(np.linspace(lng.min(), lng.max(), 100), np.linspace(lat.min(), lat.max(), 100)) grid_time = griddata((lng, lat), time, (grid_lng, grid_lat), method='linear') fig, ax = plt.subplots(figsize=(8, 8)) contour_plot = ax.contourf(grid_lng, grid_lat, grid_time, cmap='jet', levels=6) ax.contour(contour_plot, colors='k', linewidths=0.5) plt.colorbar(contour_plot) last_lng = lng.iloc[-1] last_lat = lat.iloc[-1] ax.scatter(last_lng, last_lat, color='green', marker='o', s=50, label='Start Point') ax.legend() plt.title('Isochrone') ax.set_xlabel('Longitude') ax.set_ylabel('Latitude') ax.xaxis.set_major_formatter(mticker.FormatStrFormatter('%.2f')) plt.show() return jsonify({'message': 'Trip time visualization generated successfully'}) @app.route('/get_isochrone_coords', methods=['GET']) def get_isochrone_coords(): with open('contour_coords.json', 'r') as f: contour_coords = json.load(f) return jsonify(contour_coords)用rest client调用GET http://localhost:5000/visualize_trip_time时报错ValueError: signal only works in main thread of the main interpreter
07-25
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值