Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > cz.comp.lang.python > #3100

Re: [python] prosím o radu

From Petr Messner <petr.messner@gmail.com>
Newsgroups cz.comp.lang.python
Subject Re: [python] prosím o radu
Date 2016-07-26 21:56 +0200
Organization Netfront http://www.netfront.net/
Message-ID <mailman.88.1469567149.13201.python@py.cz> (permalink)
References <3ad0c1bf-de0f-4645-8a59-8991787bf11a@googlegroups.com> <a627841e-4341-4268-8663-990aa44e3c0f@googlegroups.com>

Show all headers | View raw


To except patří k tomu try, ne k tomu if-else. Tak to odsaď ještě o úroveň vlevo. 

Petr Messner

26. 7. 2016 v 21:54, Aleš Hrubý <ales-hruby@email.cz>:

> oprava 
> #!/usr/bin/env python
> 
> import RPi.GPIO as GPIO
> import time
> 
> promena=3
> GPIO.setmode(GPIO.BCM)
> GPIO.setup(4, GPIO.OUT)
> i=0
> while True:
> 
> 
>        time.sleep(1)
> 
>    try:
>            if i == 1:
>                    GPIO.output(4, False)
>                    i=0
>            else:
>                    GPIO.output(4, True)
>                    i=1
>            except:
>                    pass
> 
> ./test.py 
>  File "./test.py", line 22
>    except:
>         ^
> SyntaxError: invalid syntax
> 
> 
> _______________________________________________
> Python mailing list
> python@py.cz
> http://www.py.cz/mailman/listinfo/python
> 
> Visit: http://www.py.cz

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

Back to cz.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

prosím o radu ales.hruby33@gmail.com - 2016-07-26 12:32 -0700
  Re: prosím o radu Aleš Hrubý <ales-hruby@email.cz> - 2016-07-26 12:53 -0700
  Re: prosím o radu Aleš Hrubý <ales-hruby@email.cz> - 2016-07-26 12:54 -0700
    Re: [python] prosím o radu Petr Messner <petr.messner@gmail.com> - 2016-07-26 21:56 +0200
  Re: [python] prosím o radu Matěj Cepl <mcepl@cepl.eu> - 2016-07-29 09:35 +0200

csiph-web