Hundemeier / sacn

A simple ANSI E1.31 (aka sACN) module for python.
MIT License
47 stars 21 forks source link

Syntax Error....Possibly because of python version? #13

Closed geese780 closed 3 years ago

geese780 commented 4 years ago

Hey Everyone,

I hope this finds y'all well. I'm starting my first project with Python after taking an online venture through Code Academy for a better understanding of Python and learning to code. I have a need to get the sACN[E1.31] protocol from the network port on my machine into another program that I'm using and I found this script and was hoping that it did the trick with my basc understanding of python. I've been getting some syntax errors in the program Cinema4d (C4D) in which is the program I'm hoping to get sACN streamed into. I guess the first question I should ask is what version of python is this script written in? As of right now, C4D only supports Python 2.7, so this might be the issue but I can't tell what the difference is between 2.7 and other versions. Below is the "errors" I've been getting from the C4D console:

From the source file: image

When I edit the syntax error in the main file and lose the-- : str part of the line, the error goes away, is this a versioning issue?

image

Thank you for your time and I hope I can get a better understanding of things here.

Cheers!

MattG

Hundemeier commented 4 years ago

Hello MattG, first of all, this library requires Python >= 3.6 see the setup for more details. And I strongly suggest that you are not writing any Python scripts in anything below Python 3. The time for Python 2.7 is running out. I have no knowledge in Cinema 4D, so I fear I am not able to answer any C4D specific questions. So I can not answer wether C4D will ever support Python 3.

To answer your question: Yes this is a version issue and one of the reasons this library requires Python 3.6. The feature with : str you are seeing is typing introduced only for Python 3. Off the top of my head I actually don't know if any more serious version specifics where used in this library, so if you are desperate to use Cinema 4D, you could try to remove all the : type things from the function declarations. Obviously I can not guarantee anything. (And if you find print("string") statements replace them with print "string" (remove the parentheses))

PS: You can post code snippets here on GitHub with this syntax.

I'll leave this issue open for now, but feel free to close it, if you think that you do not have more questions about this problem.

geese780 commented 4 years ago

Hey Hundemeier!

Thanks for the response! Yea, I've confirmed that C4D is still working on getting to support python 3...so, that pretty answered a lot of my questions haha! As I know more I'll keep everyone updated on this! Thank you for your time and I hope ya'll have a great weekend!

Cheers!

MattG