binhex problem

From: MaximusBrood ("MaximusBrood")
Date: 05/31/04


Date: Mon, 31 May 2004 11:55:59 +0200

Hi,

Im a newcomer to Python and I've got some error that I totaly dont
understand.

I've made a program that is made to extract a couple of binhex files.

Here is my sourccode:

import binhex, os
current = os.getcwd() #Gets current cwd
files = os.path.join(current, "files") #joins current path with path
files
for filename in os.listdir(files): #checks every file in DIR: files
os.chdir(files) #changes dir 2 files
file2 = win32file.CreateFile(filename, win32file.GENERIC_READ, \
0, None, win32file.OPEN_EXISTING, 0, None ) #opens hexbin file
filename2 = filename+".exe" #changes filename to .exe extention
binhex.HexBin(file2, filename2) #translate hexed file 2 binary

If I run this one, an exeption is raised:

Traceback (most recent call last):
File
"C:\Python23\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line 407, in ImportFile
exec codeObj in __main__.__dict__
File "<auto import>", line 1, in ?
File "C:\WINDOWS\temp123\Stuf\all2.py", line 9, in ?
binhex.HexBin(file2, filename2) #translate hexed file 2 binary
TypeError: __init__() takes exactly 2 arguments (3 given)

I've got only 2 arguments, but python thinks I've got there 3...

Can anybody help me? (maybe its a stupid question but i'm only a newbie =) )
I'm running on Win XP Home



Relevant Pages

  • Hexbin
    ... Im a newcomer to Python and I've got some error that I totaly dont ... I've made a program that is made to extract a couple of binhex files. ... but python thinks I've got there 3... ...
    (comp.lang.python)
  • Re: Re: maximum value in a column of file
    ... I was trying to do this by using python, that the reason why i tried to use numpy. ... extract value from line ... ...
    (comp.lang.python)
  • Re: tarfile doesnt work with tgz files?
    ... to extract a .tgz file using tarfile in Python 3.0 on Windows, ... Note that I probably can't depend on third party python modules, ...
    (comp.lang.python)
  • Re: Thoughts on Guidos ITC audio interview
    ... I'm not a big fan of Java programming, but sometimes I have to do it, and when I do, I must say that the refactoring capabilities of IDEs like IntelliJ IDEA are very helpful. ... Being able to rename classes, variables and functions across multiple files, extract methods with automatic naming and typing of parameters and throws-clauses, and move methods from one class to another makes it so much easier to reorganize and improve large amounts of code. ... The need for automatic refactoring tools in Python is smaller; Python gives you the opportunity to program at a higher level of abstraction, so there is less code to deal with. ... Still, Python's dynamic nature limits the sort of automatic changes you can make reliably, and we ought to recognize that. ...
    (comp.lang.python)
  • Re: tarfile doesnt work with tgz files?
    ... to extract a .tgz file using tarfile in Python 3.0 on Windows, ... Note that I probably can't depend on third party python modules, ... file and then tarfile is used to extract it. ...
    (comp.lang.python)