python setup.py install
Hope this helps,
Jeremy
Once you're at the command line there will be a little variation
depending on where things are located on your PC. If Python is
installed properly, you should be able to invoke the Python
interpreter from the command-line regardless of your current working
directory, so you don't need to unzip java2python under the Python 2.5
folder. You should do something like this:
cd \path\to\java2python\unzipped
python setup.py install
hi andy,
you want to run the windows command prompt, which is called "cmd.exe"
in windows xp. press the "start menu", then select "run", then type
"cmd.exe" without the quotes.
a window will pop up that looks black, and it will have a prompt like
"C:\" or "D:\something". with this window, you need to type several
commands. the first command is "cd", which changes the working
directory. you'll want to type the name of the drive and folder where
you extracted the j2py package. this can be anywhere, and it doesn't
have to be in your python folders. example:
C:\> cd D:\temp\java2python-0.2
next, you'll need to run the setup script with python. you can test
for python at the prompt like this:
D:\temp\java2python-0.2\> python -V
if you get "Python 2.5", you're ready to run the script. if you don't
get that, or if you get something along the lines of "command not
found", then you'll have to qualify the command with the full path to
the 2.5 interpreter. for example:
D:\temp\java2python-0.2\> C:\Python2.5\python.exe -V
i don't know where you installed python, nor do i remember much about
how the windows installation layout, so you'll have to figure out
these paths on your own.
once you get the "Python 2.5" response, you can install the package.
this is the easy part. use whatever command you got to reply "Python
2.5", enter it again, along with a space followed by "setup.py
install" (again, no quotes). continuing the example above:
D:\temp\java2python-0.2\> C:\Python2.5\python.exe setup.py install
you should read all of the output closely -- look for errors. you
might have problems installing the software if you're not an
administrator.
if you don't have problems, the setup process will have copied a
script named "j2py" somewhere in your system path. try "j2py --
version", and if everything works, you'll get the reply "j2py 0.2".
once the script is installed, change to the directory of your java
files (using "cd"), then do something like this, substituting your
file names where appropriate:
D:\myjavafiles\> j2py -i someclass.java -o someclass.py
best of luck to you, and please do let me (or the group) know how
everything works out.
that doesn't look right -- it looks like you found what the setup
script left behind. what you should look for is j2py in either (a)
your python directories or (b) in your system directories. look in
c:\python2.5 first.
> Meaning under scripts-2.5 folder, there are two files j2py and
> jast_print but without any file extension though!
correct, they don't have extensions. once you find the real scripts,
rename them to include the .py extension. these scripts are meant to
run from a prompt, and double-clicking them in the windows file
manager won't do any good.
Hi Troy, Windows users don't really "want" to do that. They'd prefer
to download a Windows installer, and "double-click on it".
http://docs.python.org/dist/postinstallation-script.html
This might save some wear'n'tear on their nervous systems, and
yours :-)
HTH,
John
Hi John,
Understood and agreed. I was thinking about Andy's problem, and I
realized that many users would benefit from a gui to do side-by-side
translation. If I ever have the time, I could write one I think.
> This might save some wear'n'tear on their nervous systems, and
> yours :-)
Like so many projects, it works for me the way it is -- I'm driving
j2py via makefiles, and a gui just isn't something I need. But of
course patches are welcome -- even gui ones!
Did you think I was suggesting that you write a GUI version of
java2python? Please carefully (re)?read the documentation link that I
gave you. The idea is that with a simple variation of your setup.py
build comamnd, you create a Windows installer for your existing
package, and make it available for download. Then, all the Windows
user has to do is to double-click on it, and it guides them through
the installation. This would save wear'n'tear on you having to try to
explain to some newbie Windows user how to install your package.
HTH take 2,
John
You're right, and what I didn't communicate was the thought process
that was between "users need an installer" and "users need a gui". I
jumped to the end and only typed that. Sorry for any confusion.
I doubt that users need a GUI (but TMMV of course).
No need to say sorry -- I wasn't confused :-)
Cheers,
john
> On Feb 28, 5:27 am, "troy.melh...@gmail.com" <troy.melh...@gmail.com>
> wrote:
>> you want to run the windows command prompt, which is called "cmd.exe"
>> in windows xp. press the "start menu", then select "run", then type
>> "cmd.exe" without the quotes.
> FYI, a quicker way to the command prompt is Start->All Programs-
>> Accessories->Command Prompt.
I dont like navigating deep menu structures... I prefer [WindowsKey]+R,
cmd, [Enter]
--
Gabriel Genellina