我打电话给一个号码,然后发送dtmf音
String number = "tel:+1234567,890#";
Intent c1 = new Intent(android.content.Intent.ACTION_CALL, Uri.parse(number));
Run Code Online (Sandbox Code Playgroud)
目前它可以拨打1234567,等待大约3秒,然后拨打890.功能还可以发送890带有哪种不太一致的音调,有没有办法发送890没有音调回复?
我正在使用RabbitMQ 我的任务池逐个按顺序运行.但是如何添加时间参数以使任务仅在未来的定义时间运行(如a scheduled tasks).
我创建bash来运行python脚本 start_queue.sh
start_queue.sh的内容
python /tmp/my_python_script.py &
Run Code Online (Sandbox Code Playgroud)
当我在终端中运行它时,它工作.但是我想用supervisord来管理它,因为我有几个django网站已经由supervisord管理.
但我刚开始时就得到了错误
supervisor: couldn't exec /tmp/start_queue.sh: ENOEXEC
supervisor: child process was not spawned
Run Code Online (Sandbox Code Playgroud)
这就是我在supervisord中的配置方式
[group:scriptgroup]
programs=script_1
[program:script_1]
command=/tmp/start_queue.sh
directory=/tmp/
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/x.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=50
stdout_capture_maxbytes=1MB
stdout_events_enabled=false
loglevel=info
Run Code Online (Sandbox Code Playgroud)
可以通过supervisord管理一个backgroup流程,这里我错了什么.请帮忙.
我可以为元组添加值
>>> x = (1,2,3,4,5)
>>> x += (8,9)
>>> x
(1, 2, 3, 4, 5, 8, 9)
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能将元组添加到元组中
>>> x = ((1,2), (3,4), (5,6))
>>> x
((1, 2), (3, 4), (5, 6))
>>> x += (8,9)
>>> x
((1, 2), (3, 4), (5, 6), 8, 9)
>>> x += ((0,0))
>>> x
((1, 2), (3, 4), (5, 6), 8, 9, 0, 0)
Run Code Online (Sandbox Code Playgroud)
我怎么能做到
((1,2),(3,4),(5,6),(8,9),(0,0))
假设我有一个配置字典:
config = {'A': 3, 'B': 4, 'C': 2}
Run Code Online (Sandbox Code Playgroud)
我如何平坦分配(散布)这样的列表:(逐个追加到结果列表仍然是所有配置的结尾)
result = ['A', 'B', 'C', 'A', 'B', 'C', 'A', 'B', 'B']
Run Code Online (Sandbox Code Playgroud)
另一个例子:
config = {'A': 3, 'B': 1}
result = ['A', 'B', 'A', 'A']
config = {'A': 2, 'B': 2}
result = ['A', 'B', 'A', 'B']
Run Code Online (Sandbox Code Playgroud) python ×4
android ×1
append ×1
bash ×1
distribution ×1
dtmf ×1
phone-call ×1
rabbitmq ×1
supervisord ×1
tuples ×1