GeezerVison is showing github.com — Documentation (kind of) · Issue #1 · Winand/SimplePython
Documentation (kind of) #1DescriptionHi, I am interested in this addin for excel/python
Is there any help for / instructions for this? Installation, running etc.?
Thanks,
David
P.S. I already installed it and I'm getting an error message "Can not connect to macross server" ActivityWinand commented on Feb 11, 2016 Requirements: qt4, python3, excel 2007+. This project still needs many improvements.
You run main.py it stays in system tray, then open xlam add-in, it should see server.
OR
open add-in first, open it's prefs and set paths to server and python. Server will start when needed. (This way will raise a still unresolved problem: Excel stays in process list while server is running, even if you close excel windows.)
See source/default.py for macros examples. You may create more modules in source folder. Modules are auto-reloaded when server detects, you've made any changes.
P.S. i really need to make some docs DaveyD commented on Feb 11, 2016 Hi, thanks for your response - The project sounds great!
- I have python 3.5, excel 2016 but what is qt4??
- Does the main folder have to be placed anywhere specific, or can it be run from anywhere?
- The problem of excel staying in the processes even after the app gets closed, is this a bigger issue than it sounds? Or is it simply not preferred behavior?
Thanks a lot! Winand commented on Feb 11, 2016
- Qt is a GUI framework (in fact not only GUI). It's needed here cause interface is built with it.
1.1. I use WinPython which includes Python and a good set of additional libraries including Qt. Also it's portable.
- It doesn't matter where the main folder is because server and add-in communicate over TCP. (Though add-in should be able to find and start server if you haven't done it beforehand. As stated in my previous comment)
- Honestly, I don't know how big this issue is.) I haven't had enough time recently to investigate and fix this.
DaveyD commented on Feb 11, 2016 Thanks again for your response
Moving forward...
Regarding WinPython - looks nice! However, I have 2 questions
- I see there are 3 versions - which one would I install?
- Does this replace my regular python installation?
Regarding points 2 & 3 above - perfect! Thank you very much
As soon as I get this new package (with qt4) installed, I will begin to test your project
Thanks a lot! Winand commented on Feb 11, 2016
- Cause we use Qt4 here, don't download
3.4.4.1Qt5. You can use 3.5.1.2 and 3.4.4.1, Python3.5 doesn't support mingwpy now, but for my project there's no difference. Also do not download WinPython-XXbit-X.X.X.XZero.exe package
- No, it's portable.
DaveyD commented on Feb 11, 2016 Great, thank you
Started downloading 3.5.1.2 - Hope to try it soon DaveyD commented on Feb 11, 2016 Hi, sorry about this...
Is the lack of Qt4 on my computer
- the reason why I was getting "can not connect to server" error?
- Both Windows and Symantec are warning me about this file. Is the download from sourceforge safe
Thanks in advance Winand commented on Feb 11, 2016 sourceforge is a well-known site, it safe DaveyD commented on Feb 16, 2016 Hi, I finally installed WinPyhton! and I got your add-in to work!!
Question:
- I was only able to run 'main.py' through opening it in spyder. Is this how it has to be done?
- Is there any api to know how we can interact with excel? Are they all listed in context.py?
Thanks,
David Winand commented on Feb 16, 2016
- It's one of the ways to run it. You can also do smth like this:
D:\....\WinPython-32bit-3.4.4.1\python-3.4.4>python "D:\....\main.py". Also Python programs can be converted to .exe with cx_freeze package, but there may be problems with generated cache for COM objects.
- API is the same as VBA cause i use COM objects. See
app_ctxs to find out which top-level attributes are available (you may add something:). They are set in context method when macro is called. Also "Application" (and "App" which is the same) attribute is set.
DaveyD commented on Feb 16, 2016 Thanks!
Regarding # 1, understood, thanks! (I still never tried freeze - till now I'm still in scripting mode... :))
Regarding # 2, Wow, this sounds really nice! A few questions:
- So this means that I can use any objects that I use in VBA?
- What does top-level mean? Do you mean without referencing a parent object? What would that parent object be?
- You mentioned that I can add. You mean to say that I can just add a word into app_ctxs var and it will be added? Unbelievable!
Please clarify
Thank you very much,
David Winand commented on Feb 16, 2016
- Yes, you can
app_ctxs contains names of members of VBA's Application object, which you can use w/o referencing to this object. E. g. you can use Workbooks object directly (instead of Application.Workbooks) as in VBA.
- See above.
UPD:
I also added some additional methods which can be exported from context if needed: Like, DateValue, RGB, TypeName, MsgBox. They aren't supposed to work exactly as in VBA, e. g. Like uses regex to check pattern. DaveyD commented on Feb 16, 2016 changed the title [-]Cannot connect to server[/-] [+]Documentation (kind of)[/+] on Mar 18, 2016
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|