标签: webiopi

在Raspberry Pi debian中启动脚本上的Python编码问题

所以我有一个运行Debian的Raspberry Pi和WebIOPi系统.该守护进程时,我就开始使用标准的启动'$ sudo的/etc/init.d/webiopi start'命令,但自动启动不起作用'$ sudo的更新的rc.d webiopi defaults'运行就好了.

日志表明它是Python中的编码问题,我的猜测python使用的是ascii,但脚本文件使用的是utf8.

为什么它能正常工作但不能自动启动,解决这个问题的好方法是什么?

debian encoding python-2.7 raspberry-pi webiopi

8
推荐指数
1
解决办法
1454
查看次数

在chrome中使用python baseHTTPserver 501(不支持的方法('OPTIONS'))的CORS

嗨我需要一些基本身份验证的帮助,而ajax get/post请求到python baseHTTPserver.

我能够在python脚本中更改一些代码行来发送CORS头.当我禁用http base authentification时,它在现代浏览器中工作正常.

如果启用了身份验证,我会收到501(不支持的方法('OPTIONS'))错误(i chrome).

我花了好几个小时找到一个解决方案,现在我认为我是一个好方法.正如我在下面的主题中所读到的,HTTPRequestHandler可能会导致问题,但我的pyton技能不足以解决问题.

如果在这里这里找到一些关于这个主题的帖子,但是我无法使用我的脚本运行它.有人可以帮助我让它运行吗?

任何帮助或想法都将受到高度赞赏.

    #   Copyright 2012-2013 Eric Ptak - trouch.com
    #
    #   Licensed under the Apache License, Version 2.0 (the "License");
    #   you may not use this file except in compliance with the License.
    #   You may obtain a copy of the License at
    #
    #       http://www.apache.org/licenses/LICENSE-2.0
    #
    #   Unless required by applicable law or agreed to in writing, software
    #   distributed under the License is distributed on …
Run Code Online (Sandbox Code Playgroud)

python ajax jquery cors webiopi

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

webiopi ×2

ajax ×1

cors ×1

debian ×1

encoding ×1

jquery ×1

python ×1

python-2.7 ×1

raspberry-pi ×1