MikePia / structjour

A tool to automate the daily review of trades
GNU General Public License v3.0
42 stars 9 forks source link

A great project! #5

Open HanumanH opened 4 years ago

HanumanH commented 4 years ago

Hi, I found you on bearbulltraders forum. I find this project really interesting. I would love to help in anyway that I can, just say it.

Oh... I don't know anything about programming. I been watching a few video on Python because I want to learn how to code in Python. I have always wanted to program my own trading journal but never know where to start. Your project will definitely be my launch pad. Thank you.

Just want to say nice to meet you and what a wonderful project you are working on. I will definitely be visiting this page much more often.

Cheers, Ethan

MikePia commented 4 years ago

Sorry, I have been absent from git hub. I'm back. I would love some help. This is pre alpha and full of errors. Have you installed the program? Were there errors? I would also like to change the user interface to make it far simpler. Anything is possible. Any suggestions or design ideas?

HanumanH commented 4 years ago

Sadly, no. I have not install it yet. I just recently make a life changing decision on switching to Arch Linux and now I am grappling with what to do when I run across a program that I must absolutely use Windows. The answer I have for myself is to run Windows in Virtual Box but I have not done that yet. My second issue is how to create a virtual environment inside of Windows so that my amateur programming journey would not mess up all my other programs and application along the way.

You would not happened to also package this program in Linux also, would you?

I hope to have better answer soon to your question.

Thanks, Ethan

MikePia commented 4 years ago

I develop this program on Windows because I use DAS. But there is very little in structjour that is specific to Windows. Then only thing I know of (but have not tested on Linux) is the call to get the clipboard buffer: PIL.ImageGrab.grabClipboard() Its in xlimage.py. Everything else should work. (Of course, its untested, and that could be a long way from actually running). The gui is PyQT and should work the same as it does in Windows. Python packaging works on Linux. All the dependencies should be collected when you type: pip3 install structjour structjour If the scripts directory is in your path, that should work. Otherwise you'll need to locate the installed file.

Try installing from pip on Linux and see what happens. If you have trouble finding the installed structjour script, let me know.

HanumanH commented 4 years ago

I am able to install on Arch Linux in a venv with the command pip3 install structjour so this package does work on Linux as far as pip installation goes.

You might like to know that after installed the program reside in a /bin directory and in my case PyProjects/structjour/venv/bin

As you have predicted I am not able to open the program because of the clipboard buffer issue. You can use me as a test subject for a Linux side project. I know you don't have any plan on making structjour for Linux but I trust this is worthwhile down the road or just simply a wider distribution.

With your permission I would like to explore and research this issue and hopefully fixed it and share back with you a package for Linux that actually run.

In the meantime here is the error just in case you would like to point me to a direction that I could quicker learn how to solve this issue.

Traceback (most recent call last): File "/home/ethan/PyProjects/structjour/venv/bin/structjour", line 5, in from structjour.view.runtrade import main File "/home/ethan/PyProjects/structjour/venv/lib/python3.8/site-packages/structjour/view/runtrade.py", line 40, in from structjour.view.sumcontrol import SumControl File "/home/ethan/PyProjects/structjour/venv/lib/python3.8/site-packages/structjour/view/sumcontrol.py", line 44, in from structjour.view.exportexcel import ExportToExcel File "/home/ethan/PyProjects/structjour/venv/lib/python3.8/site-packages/structjour/view/exportexcel.py", line 42, in from structjour.layoutsheet import LayoutSheet File "/home/ethan/PyProjects/structjour/venv/lib/python3.8/site-packages/structjour/layoutsheet.py", line 43, in from structjour.xlimage import XLImage File "/home/ethan/PyProjects/structjour/venv/lib/python3.8/site-packages/structjour/xlimage.py", line 27, in from PIL import ImageGrab File "/home/ethan/PyProjects/structjour/venv/lib/python3.8/site-packages/PIL/ImageGrab.py", line 26, in raise ImportError("ImageGrab is macOS and Windows only") ImportError: ImageGrab is macOS and Windows only

MikePia commented 4 years ago

That is an awesomely specific error. You could try replacing the ImageGrab module with pyscreenshot (pip3 install pyscreenshot) In xlimage.py try replacing:

from PIL import ImageGrab

with

import pyscreenshot as ImageGrab

If that works, you could try come conditional code to try to keep the file the same on all operating systems. Something like

if os.name == 'linux':
    import pyscreenshot as ImageGrab
else:
    from PIL import ImageGrab

I like that it identified the one problem I already knew about, but it hasn't even gotten past all the imports yet. If that is the only problem with getting it to run on Linux, all hail to python!