Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51592
| References | <51F7C861.3060208@Gmail.com> <CAPTjJmoquUWmNBP0LaN0PcUkUv8=a=BgCKrYr9YjoS+RiTar7A@mail.gmail.com> |
|---|---|
| Date | 2013-07-30 12:14 -0600 |
| Subject | Re: Share Code: Laptop Lid State |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.5333.1375208084.3114.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
On Jul 30, 2013 10:06 AM, "Chris Angelico" <rosuav@gmail.com> wrote:
>
> On Tue, Jul 30, 2013 at 3:06 PM, Devyn Collier Johnson
> <devyncjohnson@gmail.com> wrote:
> > Aloha everyone!
> >
> > I attached a script that I thought I could share with everyone for
your
> > help. This Python3 script only works on Unix systems. It prints the
current
> > state of the lid. This can be used to make a script that performs some
> > action when the lid is closed or open. The script is licensed under
LGPLv3
> > and I will soon upload it to my Launchpad account. Enjoy!
>
> There's... no Python code in that. Why not simply
> open("/proc/acpi/button/lid/LID/state") and read from it, instead of
> using cat and awk?
Or for that matter, why not just make it a bash script instead of Python?
It's kind of pointless to go to all the trouble of starting a Python
interpreter just to have it start a subprocess.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Share Code: Laptop Lid State Ian Kelly <ian.g.kelly@gmail.com> - 2013-07-30 12:14 -0600
csiph-web