Jump to content

Welcome, Guest!

Be a part of CinemaVision today! Once registered and logged in, you will have access to public chat and your own private messenger, you can view and contribute guides, collaborate on the forums, review downloads, give reputation to your fellow members, contribute content and so much more. Registering is quick and completely free, so what are you waiting for?
   Sign In    Sign Up

Become a RedCarpet Club Member Today!

Lorem ipsum dolor sit amet, sea eu causae aperiri periculis, iusto affert soleat an sea, soluta petentium inciderint nec no. Dolorum reprimique ullamcorper sed ad. Ei quo malorum singulis, tota mundi feugait ut pro. Choro utamur inimicus ex sea. Tota dicit te usu. Sea ad erant possim reformidans. An modus detraxit postulant vel. Per no habeo ludus qualisque. Vix legere singulis legendos et, an cum eius soluta accumsan. Facer discere no nec.
   Join Now

Download the Kodi Add-on Today!

Lorem ipsum dolor sit amet, sea eu causae aperiri periculis, iusto affert soleat an sea, soluta petentium inciderint nec no. Dolorum reprimique ullamcorper sed ad. Ei quo malorum singulis, tota mundi feugait ut pro. Choro utamur inimicus ex sea. Tota dicit te usu. Sea ad erant possim reformidans. An modus detraxit postulant vel. Per no habeo ludus qualisque. Vix legere singulis legendos et, an cum eius soluta accumsan. Facer discere no nec.
  • 0
ambro93

open python files automatically

Question

Hello everyone

I created a python script for communication with a crestron home automation processor and if started with python luncher it works perfectly.

from cinema vision I tried to run it both as python: /// as well as as command: /// but it does not work

the Python visualization test: ///script.py is OK but does not run the file when it launches it ...


the test with the command: //script.py returns an os error

the system is running on a macbook pro

the lunch files and the script are in the same directory


what am I doing wrong? I would simply use a correct string to launch a file


P.S. attached the image of the error

thank you so much
Ambrosini Andrea

Screenshot 2017-10-23 14.09.06.png

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
14 hours ago, ambro93 said:

Hello everyone

I created a python script for communication with a crestron home automation processor and if started with python luncher it works perfectly.

from cinema vision I tried to run it both as python: /// as well as as command: /// but it does not work

the Python visualization test: ///script.py is OK but does not run the file when it launches it ...


the test with the command: //script.py returns an os error

the system is running on a macbook pro

the lunch files and the script are in the same directory


what am I doing wrong? I would simply use a correct string to launch a file


P.S. attached the image of the error

thank you so much
Ambrosini Andrea

Screenshot 2017-10-23 14.09.06.png

Hey there! From what I can tell, that's not a problem with your script, but rather an issue with permissions from your OS. Make sure that the scripts are in a directory that everyone can execute from, and that nothing is blocking python scripts from running at the OS level. I'm not sure if there are security settings on a Mac that prevent Python scripts from running or being called like that, but maybe this documentation will help.

Share this post


Link to post
Share on other sites
  • 0

Thank you very much for your answer

this morning I tried to solve that mistake positively, or at least I was hoping


I solved the error [permission denied] error 13 using the command from the terminal: sudo chmod 777 python "python" is the folder created in the main user


then I had an error 8 [Exec format error] and I solved adding the formula to the script: #! / usr / bin / env python


now .... throwing the test or the automation from cinemavision does not give me any errors but does not launch the script and does not do any action ... I do not know where the error is now


* lunch file: lunch.cvaction

command: //script.py or test with python: //script.py


script.py: is a simple launch of the message in tcp


#! / usr / bin / env python
import socket
import sys


def get_constants (prefix):
    "" "Create a dictionary mapping socket module
    constants to their names.
    "" "
    return {
        getattr (socket, n): n
        for n in dir (socket)
        if n.startswith (prefix)
    }


families = get_constants ('AF_')
types = get_constants ('SOCK_')
protocols = get_constants ('IPPROTO_')

# Create a TCP / IP socket
sock = socket.create_connection (('192.168.178.80', 49152))

print ('Family:', families [sock.family])
print ('Type:', types [sock.type])
print ('Protocol:', protocols [sock.proto])
print ()

try:

    # Send data
    message = b'ciao '
    print ('sending {! r}'. format (message))
    sock.sendall (message)

finally:
    print ('closing socket')
    sock.close ()

Share this post


Link to post
Share on other sites
  • 0

now I tried to run the script in the sequence but with the unusual command:

module: //script.py

despite an error executing the script by launching the message I want ... however, the operation works only once, both in test and in sequence ... I also tried to create multiple launch files and scripts with different names but the result is the same ... only executes the first script in sequence and then nothing

I'm sure the command module is wrong to start the script but it nevertheless gave life signs hahahxD

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

About Us

CinemaVision began in 2014 as a collaboration to create content for use with your home theater, offering movie trivia slides and video bumpers. It has since grown to be THE PREMIER WAY to create and customize your preshow experience. Download the CinemaVision add-on for Kodi today from the official Kodi repository, and easily create a sequence of trivia, videos, trailers, home automation triggers and more that will bring the experience of a movie theater straight to your screen!

×

Important Information

By using this site, you agree to our Guidelines and Terms of Use.