0

I developed a Python program for use on multiple computers. The program is a counter that calculates time splits for every time a barcode scanner reads a QR code, and writes these time splits to CSV files an updates a dashboard with the count. Python does not have focus for this use, which is why pyHook is necessary to receive the barcode scans. Python 2.7 is installed on every computers' hard drive, and the Python program itself is on our network drive so it can write CSV files to the network.

I could not find an installer for pyHook for Windows (64 bit), so I just copied the necessary module file into the site-packages folder in Python on the hard drive.

The issue I'm running into is that the program has worked on every computer multiple times but it's a coin flip whether it will work or not on any given try, which makes no sense to me and is why it's incredibly difficult to troubleshoot.

The program first opens an input window, and then based on the inputs creates a dashboard with tkinter. The user then goes to a different web program for scanning, so the dashboard doesn't have focus at this point, and then starts to scan. Even when the program fails, it gets this far and then nothing from the barcode scanner is read in.

Does anyone have any ideas on why this inconsistent error happens? Do I need to do something else to install pyHook properly? Is there an issue with access to the modules that I can fix?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • have you tried `pip install pyhook`? Python is very good at installing packages and doing it manually may not be a great idea. – Mike - SMT Jul 20 '18 at 15:47
  • @Mike-SMT, I tried it and let the programs run for a few days. The issue is still present. What else should I try? – Aniket P Jul 24 '18 at 12:45
  • Its hard to say without seeing some example code that can reproduce the problem. Maybe try some `print` statements at key points in your code to see where its getting stuck. – Mike - SMT Jul 24 '18 at 13:12
  • @Mike-SMT Will do. It's pretty difficult to reproduce the problem since its not a consistent problem. I'll see what the print statements return though, thanks. – Aniket P Jul 25 '18 at 12:24
  • @Mike-SMT Update: I figured it out using print statements. Certain items scanned by the scanner caused a bug if they were scanned first. It's working perfectly now. Thanks for your help! – Aniket P Jul 25 '18 at 19:14
  • Nice. `print()` is a powerful debugging tool :D. I always start my debugging with `print()` if I don't see the problem right away. glad you got it. – Mike - SMT Jul 25 '18 at 19:17

0 Answers0