run a python script

Moderator: leecollings

Post Reply
Alzie
Posts: 2
Joined: Thursday 04 February 2016 18:32
Target OS: Windows
Domoticz version:
Contact:

run a python script

Post by Alzie »

First post, Good evening all.

I want to run a python script on a windows machine , you can enter the path of your file " script://Domoticz\scripts\python\emailfoto.py " In the switch interface.
but no success please help
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: run a python script

Post by nayr »

I do not believe python support is included with windows builds... I think your limited to only Lua scripting..
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HeMan321
Posts: 5
Joined: Thursday 11 February 2016 14:22
Target OS: Windows
Domoticz version:
Contact:

Re: run a python script

Post by HeMan321 »

I seem to have hit across the same problem, almost immediately as the first thing I tried to set up requires a but of Python script. It seems very odd that Windows, which going by the update dates on the downloads page is by far the most actively developed platform, has such a fundamental ability as scripts and cron missing?!

And if these are missing from the Windows version, shouldn't it say so somewhere? After much searching and reading many articles on "crontab" (which means nothing to Windows users) I found the only reference to this being "There are a lot of scripts you can find on this Wiki and the Domoticz forum but the most of them aren't usable in Windows"!!! With no mention of why they are not usable in Windows so we can deduce which will and won't work?!

So am I right in concluding Python scripting is out as are scheduled tasks. What about other scripting or functionality?
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: run a python script

Post by nayr »

um Python and Cron are not a part of Domoticz, they are part of a Unix operating system and Domoticz is simply utilizing whats available..

Windows Builds are kicked off by a Unix robot, so dont think windows is the most active platform simply from automated outputs.. infacts its far from the case, windows is a niche class and your lucky the builds are even made, IMHO they are only provided because so many windows users are unable to operate Linux let alone build from source code... vast majority of Domoticz deployments are on real operating systems that include real tools for performing real automation. (Bash/Python/Perl/Tcl/PHP/JS/GCC/Cron/Sed/Grep/SysFS/and device drivers for tons of hardware both common and obscure built in)

the development work is all done in linux. There is a ton of stuff your not going to be able to do in Windows... have fun encountering the limitations every time you turn a corner.

If you want Python/Cron/Bash etc on your computer, its pretty easy to format and install linux now days.. or you could buy a Mac if linux is still too scary... OSX is a Unix under the skin, and in comes with cron, python and bash pre-installed

If your going to stick with windows, you have Lua and Blocky for scripting.. anything else your going to have to figure out how to install and setup externally.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HeMan321
Posts: 5
Joined: Thursday 11 February 2016 14:22
Target OS: Windows
Domoticz version:
Contact:

Re: run a python script

Post by HeMan321 »

Ahh, we are in to a Win Vs Unix argument. This could run all night... ;o)

Seriously though, I won't pretend Unix doesn't have its merits, although I do defend the suggestion I am "scared" of it! But my point was more that nowhere does it say the Windows version is horribly crippled and don't even bother trying, cos its full of "limitations" at every corner. If it did and better still, documented what those limitations are, I would have gone with the Pi version (yes, some of us Win guys know our way around Linux too) from the start and saved myself a day.
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: run a python script

Post by nayr »

Windows version is not horribly crippled, you get the same built in scripting engines as linux does (Lua and Blocky)... but you cant expect the mountains of EXTERNAL 3rd party integrations and scripts written on Linux to be avilable to you.. because as I said, windows is not the preferred operating system and nobody is writing these tools on it.

Uh Domoticz is a giant task scheduling engine, so I dont know why you dont think you dont have scheduled tasks.. a lua time script gets called every single Min.. now CRON is a UNIX tool that has not a damn thing to do with Windows or Domoticz, neither require cron or use it.. so what the hell is crippled here? I believe windows has its own way to schedule tasks, its called Task Scheduler or something.

Whatever it is you were wanting to run and cant can still be done in Windows, you'd just have to write a tool using whats at your disposal to send the same things.. Externally you can use basic and batch scripting in windows out of the box but not Python and Bash, yet you can install cigwin and load up most unix scripting environments if you want... including Python, but dont expect someone's 3rd party linux tool to run without modification on a completely separate environment.

yeah, you cant rely on a community of Linux users to farm working tools from.. yeah that is pretty crippling, but thats Window's fault, not Domoticz.. dont get mad at us that your OS sucks.. you turned this into a Windows vs Linux thing when you came here complaining that Windows was not linux. Nothing you think is crippled has anything to do with Domoticz, they are fundamental tools available to Unix users. Unix users like to use and share external scripts, why is that the fault of Domoticz or Linux?

Using the number of precompiled Windows binaries as an indicator of popularity was a bad assumption, there are simply more windows binaries because windows does not include the tools out of the box to build the binaries.. so its very inconvenient to ask windows users to compile software.
Its the same reason RPi binaries are produced, it takes so much resources to build on such a small device its very inconvenient to ask all RPi users to also build from source.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HeMan321
Posts: 5
Joined: Thursday 11 February 2016 14:22
Target OS: Windows
Domoticz version:
Contact:

Re: run a python script

Post by HeMan321 »

Maybe I was just unlucky in that the first two things I tried to achieve required Python and scheduled tasks (for which I found a wealth of documentation on configuring crontab, with no mention that this isn’t possible on my chosen platform). It may also not help that my entire experience and knowledge of Domoticz is merely a few hours, so I am a compete beginner (sorry, n00b) and don’t know what’s on offer yet…

Don’t get me wrong, I am not saying there is anything wrong with Domoticz; it comes highly recommended and I still look forward to benefiting from it and maybe even contributing.

But if I was being provocative, I might point out that in the world of Windows, we usually expect a system to work as a whole, rather than relying on a geek, with acronym Tourette’s, box of esoteric and disparate tools taped together from the command line. But I am not, so perhaps I shouldn’t…

But that’s the point, your point; I am not in the world of Windows here, I am in the world of Linux, and when in Rome… So why does the Downloads page start with “Looking for the latest version? Download domoticz-win32-2_4440-setup.zip (13.6 MB)”?! How come the Binaries section starts with Windows and your Linux is pushed to the very bottom line under the nameless heading of “Other Systems”, which doesn’t even contain a link. Can I be forgiven for thinking this is actually targeting the Windows world? It seems to me someone has worked hard to make it seem a heptadecagon Linux peg fits in to a round Windows hole. I am not sure this does Domoticz any favors as many of us Windows idiots will give up in frustration without ever seeing what it can do on a "real" platform…
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: run a python script

Post by nayr »

Welcome to the world of FOSS.. Free Open Source Software developed and documented by anyone who can for the benefit of all.. you can expect alot more of what you have seen but most find its worth the trouble.. but I feel for yah, I run OSX on my desktop/laptop for the same reasons you run Windows.. because I want everything to just work, but I also need my unix command line as I cant survive without it.. I have not used a windows machine in decades.

Missing windows documents is our fault on whole, this is a community effort and if stuff is missing its up to us to fix that.. I try to document stuff as I figure them out, apparently the windows users are not doing the same.. I get not everyone can code, but illiteracy is no excuse on the internet.. we can all write, so anyone whom complains about the docs I have little pity for.. the single easiest way any FOSS user can contribute is to cleanup and expand documentation.

What you have experienced is a webpage detecting your a windows user and offering you the windows binary first, this is pretty common now days on the internet.. Try downloading FireFox, Chrome, VLC, or anything else Open Source.. now try again on another System and you'll see that everyone offers you up the binaries that are native to your system first and formost.. you'd be surprised how many people dont even know what system they are running, this saves a ton of support issues.

RPI has an internal update mechanism and dont need both testing and stable versions posted online, the last stable is posted and if you want to run testing you can do so from within.. those are full operating system images and the update frequency seems to be when a stable version is released.

The link on the main domoticz.com page prominently includes the manual, source code and wiki which all allude to the Linux priority.. even a blurb on the front page says: Linux/Windows/Embedded Devices. This system is designed to operate in various operating systems.

look, they dont have an OSX version so it points me to the RPI Binary:
Screen Shot 2016-02-11 at 4.06.59 PM.png
Screen Shot 2016-02-11 at 4.06.59 PM.png (110.24 KiB) Viewed 2951 times
Last edited by nayr on Friday 12 February 2016 0:31, edited 3 times in total.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
HeMan321
Posts: 5
Joined: Thursday 11 February 2016 14:22
Target OS: Windows
Domoticz version:
Contact:

Re: run a python script

Post by HeMan321 »

I didn't know that, clever, but perhaps the web has gotten a little too clever for its own good as I imagine most people run this on a dedicated box so the box its downloaded on is of little importance. A bit more in the Wiki about the differences between platforms might be useful too...

But don't even get me started on the evils of Apple... ;o)
HeMan321
Posts: 5
Joined: Thursday 11 February 2016 14:22
Target OS: Windows
Domoticz version:
Contact:

Re: run a python script

Post by HeMan321 »

But otherwise, thanks and keep up the good work!
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: run a python script

Post by nayr »

well the logical counter argument is anyone whom is looking for a specific platform will obviously know what platform it is they are looking for and will naturally click other operating systems.. heaven knows thats the route I nearly always take since I have alot of different platforms floating about on my network.

I dont buy Apple so I feel yeh there, I built my OSX workstation and my employer kindly provides me with the laptop and upgrades it periodically for free.. its hard to beat a free MacBook Pro that keeps getting better I tell you what.

If your stubborn you may still be able to all this stuff to work on windows, but it'll take a bit of work to get all those scripting environments setup in windows so make sure you document your experiences in the Wiki, a quick google search I found plenty of Windows Python Binaries.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Alzie
Posts: 2
Joined: Thursday 04 February 2016 18:32
Target OS: Windows
Domoticz version:
Contact:

Re: run a python script

Post by Alzie »

Image

I try it on a Pi
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest