小编bro*_*njc的帖子

django-admin.py makemessages无效

我正在尝试翻译一个字符串.

{% load i18n %}
{% trans "Well, Hello there, how are you?" %}
Run Code Online (Sandbox Code Playgroud)

至...

Hola amigo, ¿que tal?
Run Code Online (Sandbox Code Playgroud)

我的settings.py文件包含:

LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'translations'),
)
Run Code Online (Sandbox Code Playgroud)

我得到了这个:

(env)glitch:translations nathann$ django-admin.py compilemessages
CommandError: Can't find msgfmt. Make sure you have GNU gettext tools 0.15 or newer installed.
Run Code Online (Sandbox Code Playgroud)

我也不明白这个错误信息.

(env)glitch:ipals nathann$ django-admin.py makemessages -l es
CommandError:
This script should be run from the Django Git tree or your project or
app tree. If you did indeed run it from the Git checkout …
Run Code Online (Sandbox Code Playgroud)

python django homebrew gettext

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

Yelp API - 提取所有商家评论

我正在阅读API,并点击了Business API,并将其reviews作为可能的响应.描述如下,

List of up to 1 review snippet for the business

这是否意味着我无法将我的所有评论都提到我的网站上?我只能显示1个片段?

api yelp

5
推荐指数
1
解决办法
8400
查看次数

BrainTree Scientific,Inc.注射泵(型号bs-8000)rs232的串行命令

更新:在确保我的命令,串行配置和终结符('\ r')是正确的之后,我在5台计算机中的一台上运行了这项工作.这让我相信这是一个适配器问题.我打算打电话给公司看看订购USB/RJ11适配器(我在我的mac上使用的是Keyspan USB-> DB9-> RJ11适配器)


我已经读过这篇文章,但我还是无法与这个泵通信.这是我修改过的python脚本(源码),

import time
import serial

# configure the serial connections (the parameters differs on the device you are connecting to)
ser = serial.Serial(
  port='/dev/tty.USA19H142P1.1', # /dev/tty.KeySerial1 ?
  baudrate=19200,
  parity=serial.PARITY_NONE,
  stopbits=serial.STOPBITS_ONE,
  bytesize=serial.EIGHTBITS
)


if not ser.isOpen():
  ser.open()

print ser
commands = ['dia26.59', 'phn01', 'funrat', 'rat15mm', 'vol0.7', 'dirinf',
            'phn02', 'funrat', 'rat7.5mm', 'vol.5', 'dirinf', 'phn03',
            'funrat', 'rat15mm', 'vol0.7', 'dirwdr', 'phn04', 'funstp',
            'dia26.59', 'phn01', 'funrat', 'rat15mm', 'vol1.0', 'dirinf',
            'phn02', 'funrat', 'rat7.5mm', 'vol.5', 'dirinf', 'phn03', …
Run Code Online (Sandbox Code Playgroud)

python serial-port psychopy

5
推荐指数
1
解决办法
1151
查看次数

使用纯CSS,使用单选按钮内嵌无线电组标签

以前我用表来显示带标签的单选按钮.现在我只想使用CSS做同样的事情.

这是用桌子做的

我可以在CSS中做些什么来使标签文本很好地放在相关的单选按钮上?这是HTML:

<div class="controls">
    <label class="radio">
        <input type="radio" name="cfimb_5" id="id_cfimb_5_1" value="1">
        Never
    </label>
    <label class="radio">
         <input type="radio" name="cfimb_5" id="id_cfimb_5_2" value="2">
    </label>
    <label class="radio">
        <input type="radio" name="cfimb_5" id="id_cfimb_5_3" value="3">
        Sometimes
    </label>
    <label class="radio">
        <input type="radio" name="cfimb_5" id="id_cfimb_5_4" value="4">
    </label>
    <label class="radio">
        <input type="radio" name="cfimb_5" id="id_cfimb_5_5" value="5">
        Frequently
    </label>
</div>
Run Code Online (Sandbox Code Playgroud)

这是一个codepen:http://codepen.io/anon/pen/keuhl

html css

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

基于其他领域的模型领域?

我可以将模型字段基于其他字段吗?例如:

class Foo(models.Model):
    x = models.PositiveSmallIntegerField()
    y = models.PositiveSmallIntegerField()
    z = models.PositiveSmallIntegerField()

    score = models.PositiveSmallIntegerField(default=x+y+z)
Run Code Online (Sandbox Code Playgroud)

django

3
推荐指数
2
解决办法
2223
查看次数

安装Pillow,获取-Wunused-command-line-argument-hard-error-in-future

我不能安装枕头.

(env)noah:cupalensic2 broinjc$ which cc
/usr/bin/cc
(env)noah:cupalensic2 broinjc$ cc --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
Run Code Online (Sandbox Code Playgroud)

我跑了pip install mezzanine,当它满足枕头时它搞砸了......

cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers -I/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/opt/X11/include/freetype2 -I/Users/broinjc/cupalensic2/env/build/pillow/libImaging -I/Users/broinjc/cupalensic2/env/include -I/usr/local/include -I/opt/X11/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will …
Run Code Online (Sandbox Code Playgroud)

python django mezzanine pillow

3
推荐指数
1
解决办法
2480
查看次数

标签 统计

django ×3

python ×3

api ×1

css ×1

gettext ×1

homebrew ×1

html ×1

mezzanine ×1

pillow ×1

psychopy ×1

serial-port ×1

yelp ×1