Jump to content

WingCommander

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by WingCommander

  1. The "encounter_counter.pyw" is a plain ASCII text file. Notepad can open it for example. However, with the file extension "pyw", your computer doesn't know how to open it (which should be to call the Python interpreter, passing the file as an argument). However, "start.bat" is ALSO a plain ASCII text file. But, with the file extension "bat", Windows know how to execute each line (if properly formatted).
  2. I noticed that the script was double-plus-one counting. I made a few modifications and it seems to be working better now. I include the diff command and output here (comparing the old version with mine) for the OP. Among the changes, I add a simple python header (for linux hash-bang, and to indicate the source) and modify the main() function call to be standard python. Edit: Initial fix did not work as expected. Fixed the code again and replaced the code in post for the update. Edit 2: Another minor code change, and formatting change.
  3. I got this working on Linux (Xubuntu 18.04). Mostly, I followed the steps of the OP. But, here are the additional steps that I had to do to make this work. Step 1: Skip. Xubuntu comes with Python, no need to download Windows version of Python. Step 2: Download the file as described Step 3: Skip. I will be using a different method. I will be running it from the terminal (xfce4-terminal, although all terminals should work). Which shell you use shouldn't matter. Step 4: This is where the differences begin. I opened the "initial_setup.bat" file, then modified each line from "python -m ..." to "python3 -m ..." (Yes, it uses Python3.) I then copied each line and pasted it to the terminal to run it. Also, I had to install the following program (requires administrator privilages). sudo apt-get install scrot Step 5: I edited "encounter_counter.pyw" with my favorite text editor (leafpad). Then, I changed the Character Coding to Linux encoding (from windows) (LF only) and save the file. To run the script, in the terminal, use two commands (corrected for my unzipped location): cd /path/to/script/folder python3 /path/to/script/folder/encounter_counter.pyw Step 6: Follow as instructed. If you want to have the counter on top of other windows, right click on it's entry on the task bar, and select "On Top of Other Windows" or similar methods for your Desktop Environment. Also note that for my personal taste, I added the hash-bang (#!/usr/bin/python3) at the start of the python script and marked the executable flag because I prefer just typing the file name. Hopefully this will help those Linux users out there. Edit: Forgot to mention the installation of scrot and a few font changes.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.