#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    New to Python, module help


    Hi guys,

    I am really not a Python programmer. I am in need of a decoder for SWL files, and I have this Python module doing just that, but I am having difficulties getting it to work.

    Basically, I have this SWL.py module and a test.py module I use to decode my SWL file. I am getting some errors when running test.py, and I am hoping someone can help me.

    This is what I am getting:
    (apparently I can't post links, but this is a link to a screenshot)

    s2.postimg.org/9rnxan4a1/python.jpg

    Any help would be much appreciated!
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    Remove the leading dot in file SWL.py and try that,
    otherwise you could change directory to the correct directory before you try to run test.py.

    Good luck.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0
    Hey b49P23TIvg, thanks for the reply, i really appreciate it,. I tried removing the dot but I'm getting the exact same result.

    Can you tell me what do you mean by "change directory to the correct directory"?
    By the way, I am running the test.py module from the "menu > run module" option.
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,966
    Rep Power
    481
    http://stackoverflow.com/questions/72852/how-to-do-relative-imports-in-python

    Read the 2 PEPs referenced in the first answer.
    [code]Code tags[/code] are essential for python code and Makefiles!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0
    Hey, thanks for trying to help but I gave up on this.

    I have decoded the files using a different solution.

IMN logo majestic logo threadwatch logo seochat tools logo