You are not logged in.
Pages: 1
So, I need to use some software called Opencaster to test some code I am writing. I've patched some of it already so it would work in Arch Linux, and for the most part, it works as intended; one final issue though, is this particular bit of code:
#! /usr/bin/env python
def CRC_32(data):
return 0xFFFFFFFF
try:
import _crc32
CRC_32 = _crc32.sectioncrc
except ImportError:
print "### WRONG CRC32!!!"
passI'm not exactly sure on how I go about fixing this, because it always has an ImportError, and thus my script won't work.
If you get the source, it is located under /libs/dvbobjects/dvbobjects/utils
Any idea what could be going on here?
I would go to the forums for this software, but they're a ghost town.
Offline
switch to zlib.crc32? Btw, does this software really work with python3?
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
switch to zlib.crc32? Btw, does this software really work with python3?
Python isn't a language I am too familiar with, enough to do what I need to do.
No, from what I have tried, it has issues with space and tab mixing in code. I use python2 (2.7). 'python2 script.py'
Offline
Mixing tabs and spaces is insanity in any language, it makes the code unreadable, and since python actually relies on indentation for structure, mixing tabs and spaces can break your code.
For python use 4 spaces, expand all tabs.
http://legacy.python.org/dev/peps/pep-0008/
Last edited by Mr.Elendig (2014-08-23 12:14:32)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Mixing tabs and spaces is insanity in any language, it makes the code unreadable, and since python actually relies on indentation for structure, mixing tabs and spaces can break your code.
For python use 4 spaces, expand all tabs.
http://legacy.python.org/dev/peps/pep-0008/
This wouldn't be an issue if it was my code, I next mix things like that--problem is, they did, and I'm not too sure how to handle this. I don't want to manually fix each script by hand...
Offline
a sane editor, like vim, can fix it for you (with some limitations)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Pages: 1