bython icon indicating copy to clipboard operation
bython copied to clipboard

How to use on Windows?

Open FireController1847 opened this issue 7 years ago • 7 comments

Is it even possible to use this on Windows? If so, how?

FireController1847 avatar Jun 17 '18 04:06 FireController1847

I just tried it on windows (using it in a Git Bash Shell) and it works well. I ran

python ./setup.py install

Then I had to copy the python.exe to python3.exe

Then it worked a treat! I was delighted when I ran the following code (yes - even without semi-colons - brilliant!)

for i in range(10) {
    print("Bython is awesome!")
    print("Hello")
    if (i == 5) {
        print("yo")
    }
}

xagyg avatar Jul 12 '18 10:07 xagyg

Currently, I'm only developing for Unix-like systems, simply because I don't own a Windows machine to develop on.

I believe the only changes necessary to port Bython to (native) Windows is to adapt where the install script puts the executable, and find a Windows alternative to the shebangs, but I'm not sure.

If you're familiar with using Python on Windows, you are of course very welcome to look into the issue yourself and submit the changes.

mathialo avatar Oct 30 '18 14:10 mathialo

The instructions say to run Bython in a shell. However, in Windows, there is no bython.exe. How do you run Bython in Windows?

ardee00 avatar May 26 '21 21:05 ardee00

Maybe my custom build would work better. I wrote it and use it on windows My Build of Bython

xXCrash2BomberXx avatar Aug 06 '22 00:08 xXCrash2BomberXx

No offense to xXCrash2BomberXx, but I don't know if I can trust an executable downloaded from GitHub. This is easy enough to make work on Windows. Note that I install Python into C:\Python312, which means that Bython installs into C:\Python312\Scripts. I have both of these directories in my Windows path.

Here are the steps I took to make Bython work:

  1. Since on Windows the python installs as just python.exe in a directory for python3, I created a batch file in the python install directory called python3.bat that contains these lines: @echo off python %*

  2. I then created a batch file in the python install directory called bython.bat with these two lines: @echo off python "C:\Python312\Scripts\bython" %*

  3. I put a test program in c:\temp\test.by: print("Bython is awesome!"); for i in range(10) { print(i); }

That's it, now I can run: C:\temp>bython test.by Bython is awesome! 0 1 2 3 4 5 6 7 8 9

42degrees avatar Mar 12 '24 01:03 42degrees

And then I looked at the project more closely and realized that the parser isn't really parsing and the whole project has been abandoned long ago. Oh well.

42degrees avatar Mar 12 '24 02:03 42degrees

You can convert the scripts into python entrypoints which you can then define in your package configuration. This makes them available cross-platform.

See https://setuptools.pypa.io/en/latest/userguide/entry_point.html#console-scripts for documentation how to do this.

pavelzw avatar Mar 15 '24 21:03 pavelzw