Go to advanced search

by CPaolo
Wed Oct 30, 2019 7:03 am
Forum: Python
Topic: Simple python script
Replies: 8
Views: 694

Re: Simple python script

Hi all, i cannot find the the right syntax ************************************************** 1 def call(): 2 check_call(['python', 'chiamata.py']) 3 4 call_btn = Button(18, hold_time=2) 5 call_btn.when_held = call 6 call_btn.when_held = led.on ************************************************** how ...
by CPaolo
Tue Oct 29, 2019 9:49 pm
Forum: Python
Topic: Simple python script
Replies: 8
Views: 694

Re: Simple python script

Ok, just a little step ...... i created a new python file called "chiamata.py" and then, inside ################################### ...... def shutdown(): check_call(['python chiamata.py']) ...... ################################### but doesn't work i tried this way #################################...
by CPaolo
Mon Oct 28, 2019 8:03 pm
Forum: Python
Topic: Simple python script
Replies: 8
Views: 694

Re: Simple python script

Thankyou for the reply. I read the gpiozero documentation, and i tried this script .... (is the same as the example) ---- from gpiozero import Button from subprocess import check_call from signal import pause def phonecall(): check_call(["linphonecsh dial 9999"]) pulsante = Button(18, hold_time=2) p...
by CPaolo
Mon Oct 28, 2019 1:08 pm
Forum: Python
Topic: Simple python script
Replies: 8
Views: 694

Simple python script

Hello all, i'm a newbie, and i'm studing python and raspberry by myself ... so please be patient ..... :) I'm trying to run this script in python: ---- from gpiozero import LED, Button from signal import pause from time import sleep led = LED(23) pulsante = Button(18, pull_up=True, hold_time=5) puls...
by CPaolo
Fri Apr 21, 2017 7:16 pm
Forum: Beginners
Topic: Syntax Error in Script
Replies: 9
Views: 1617

Re: Syntax Error in Script

I don't understand ......
by CPaolo
Wed Apr 19, 2017 5:32 pm
Forum: Beginners
Topic: Syntax Error in Script
Replies: 9
Views: 1617

Re: Syntax Error in Script

yes, 2.7

If i restore a backup SD the script works .......

CPaolo
by CPaolo
Tue Apr 18, 2017 7:07 pm
Forum: Beginners
Topic: Syntax Error in Script
Replies: 9
Views: 1617

Re: Syntax Error in Script

Hello, Python version is still 2.7

CPaolo
by CPaolo
Tue Apr 18, 2017 7:03 pm
Forum: Beginners
Topic: Syntax Error in Script
Replies: 9
Views: 1617

Re: Syntax Error in Script

This is the code........ I don't know if the python version is changed ...... #!#!/usr/bin/env python # -*- coding: utf-8 -*- # ############################################################ # This code uses the Beebotte API, you must have an account. # You can register here: http://beebotte.com/regis...
by CPaolo
Tue Apr 18, 2017 6:02 pm
Forum: Beginners
Topic: Syntax Error in Script
Replies: 9
Views: 1617

Syntax Error in Script

Hello all, i'm new to this wonderful world and i own a RPI2 B with the DHT11 sensor. I'm using a script in python for uploading the Temperature online. From yesterday after the reboot (after apt-get update and upgrade) i get a syntax error in this line: print "Temp={0:f}*C Humidity={1:f}%".format(te...

Go to advanced search