#pyqt | Logs for 2019-02-06
Back
[16:13:24] -!- logs has joined #pyqt
[16:18:29] -!- mintograde has joined #pyqt
[16:22:09] -!- Siecje has parted #pyqt
[16:29:46] -!- malberts has quit [Quit: Leaving.]
[16:38:21] -!- headrx has joined #pyqt
[16:47:53] <headrx> Anyone able to lend a hand ?
[16:47:53] <headrx> cannot import name 'QtWebEngineWidgets' from 'PyQt5' (C:\Users\Laura\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\__init__.py)
[16:48:00] <headrx> 5.11.3
[16:48:14] <altendky> headrx: 32-bit?
[16:48:23] <altendky> err, yeah
[16:48:45] <altendky> headrx: yes, 32-bit on windows doesn't have that because qt isn't including it in their 32-bit builds. it might change at some point
[16:48:57] <altendky> 64-bit should work
[16:49:37] <headrx> Alrighty
[16:49:41] <headrx> Appreciated
[17:36:10] <BPL> gotta question, let it be editor a QSciScintilla object https://bpaste.net , my question is... after i've replaced the text of the editor I can't undo it to a previous state... am I using incorrectly beginUndoAction & endUndoAction? I don't get it :/
[17:37:57] <BPL> refs: http://pyqt.sourceforge.net & http://pyqt.sourceforge.net , i don't understand... :/
[17:39:00] <BPL> dammit --> http://pyqt.sourceforge.net :'( ==> `Replaces all of the current text with text. Note that the undo/redo history is cleared by this function.` :O
[17:39:23] <BPL> ideas?
[17:40:29] <BPL> guess I need to find a better way to replace text on QSciScintillas
[17:42:22] -!- kdas_ has joined #pyqt
[17:43:29] -!- kushal has quit [Ping timeout: 256 seconds]
[17:45:09] <BPL> n.mind, got an idea :P
[18:36:12] <headrx> altendky: is there a alternate version of QtWebEngineWidgets?
[18:36:18] <headrx> for 32bit
[18:38:23] <altendky> headrx: afaik it can be built, qt just didn't
[18:38:44] <altendky> headrx: do you need 32 for some reason?
[18:41:33] <headrx> was just making sure if i needed to compile on 32, my code would be compliant
[18:47:57] <BPL> this lack of support for 32bits is really a pain in the ... https://forum.qt.io , fought about this fact the last week and i ended up embedding directly chrome on my app, which is far from being ideal as I've got to communicate with chromes protocol or other nasty tricks :P
[18:48:46] <headrx> As long as im not the only one with a problem :)
[18:50:27] <altendky> headrx: nope, but you'd have to build qt itself and then pyqt also
[18:50:42] <BPL> and about the "do you need 32 for some reason?" question i'd ask it the other way around... do you need 64 for some reason? that said, think I'm off, gn pyquters \o
[18:50:48] -!- BPL has quit [Quit: Leaving]
[18:51:08] <altendky> Kind of pointless to turn that around like that
[18:51:11] <headrx> he jumped off before you could get em
[18:51:24] <headrx> trolled you !
[18:51:39] <altendky> (yup, but you are still here) The question was 'do you need this thing that isn't provided'
[18:51:55] <headrx> Maybe.
[18:51:58] <headrx> idk yet.
[18:52:11] <headrx> Can i ask a non pyqt question here?
[18:52:16] <altendky> Also, 64 is pretty darn standard (other than cpython defaulting to 32 bit download)
[18:52:26] <headrx> altendky: agreed on the standard
[18:52:45] <altendky> headrx: go for it
[18:52:48] <headrx> https://pastebin.com
[18:53:01] <headrx> im trying to install pyinstaller, and getting that error
[18:53:33] <altendky> headrx: downgrade pip to 18.1
[18:53:47] <altendky> It's a whole debacle they are working on a solution
[18:54:33] <altendky> They is pip and setuptools
[18:55:12] <headrx> gotcha
[18:55:24] <headrx> so it says its already satisfied
[18:55:28] <headrx> how do i use it
[18:55:44] <headrx> not like, normally
[18:55:58] <headrx> but where is it ? bc previously when i used it , it was an executable
[18:56:03] <altendky> I think install --upgrade pip<19
[18:56:12] <headrx> no i meant pyinstaller
[18:56:18] <altendky> Ah
[18:56:22] <headrx> pyinstaller file.py --onefile
[18:56:28] <headrx> something like that
[18:56:29] <altendky> headrx: where did you install it?
[18:56:50] <headrx> c:\users\laura\appdata\local\programs\python\python37\lib\site-packages\pyinstaller-3.4-py3.7.egg
[18:56:52] <headrx> whats an egg
[18:57:11] <headrx> nvm
[18:57:36] <headrx> i went ot the dir ... and theres a pyinstaller folder.. but still, theres the __init__ and __main__ , but previously i had a pyinstaller executable
[18:57:42] <headrx> and i cant python -m pip pyinstaller
[18:57:47] <altendky> I always with in a virtualenv or venv
[18:57:57] <altendky> Then I don't have to deal with these silly paths
[18:58:19] <altendky> Yes, the runnable files go else where
[18:58:30] <altendky> Trying to remember...
[18:58:42] <altendky> Maybe just search appdata for pyinstaller.exe
[18:59:00] <headrx> it was on a diff pc
[18:59:42] <headrx> ya i found it
[18:59:43] <headrx> sorry
[18:59:46] <headrx> half dumb today
[19:00:06] <altendky> envs are nice
[19:00:22] <headrx> yeah its what i did
[19:00:24] <headrx> much nicer
[19:06:50] <headrx> altendky: have any experience with pyinstaller ?
[19:07:13] <altendky> headrx: been using it for a couple years
[19:07:32] <headrx> I built a pyqt5 application, it just uses QWebEngineView to load a local html file and some js and css
[19:07:37] <headrx> and one picture
[19:07:47] <headrx> i do pyinstaller --onefile pythonscript.py
[19:08:18] <headrx> generally it spit out a exe file in the build
[19:08:26] <headrx> in this case, it spits out a whole heap of stuff
[19:08:35] <headrx> non of which are actually executable
[19:09:53] <headrx> altendky: ['Analysis-00.toc', 'base_library.zip', 'EXE-00.toc', 'hotrack.exe.manifest', 'PKG-00.pkg', 'PKG-00.toc', 'PYZ-00.pyz', 'PYZ-00.toc', 'warn-hotrack.txt', 'xref-hotrack.html']
[19:10:23] <altendky> headrx: is it a public project?
[19:10:33] <headrx> i can give ya source real quick if ya like
[19:10:50] <altendky> headrx: I've got an example at GitHub.com/altendky/basicpyqt5example
[19:11:44] <headrx> altendky: https://pastebin.com
[19:12:18] <headrx> my app is working though, it just isnt 'compiling' the way it usually does on other apps
[19:12:25] <headrx> other app had no resources tho
[19:14:20] <headrx> altendky: did you build that pyinstaller spec ?
[19:20:04] <altendky> headrx: you mean write the file in the repo i linked?
[19:21:07] <headrx> ya
[19:21:19] <headrx> thats ouput from pyinstaller right
[19:21:30] <altendky> i did. well, the entry point stuff was mostly on the wiki, i tweaked it a bit
[19:25:38] <headrx> my current project file includes : hotrack.py , ui.html, logo.png, and src folder . . it contains all the css and js stuff
[19:26:13] <headrx> like i said when i hit it with pyinstaller is throws the other stuff.. im not properly initiated in such things... advice?
[19:27:20] <altendky> headrx: i was setting up to run that myself
[19:27:33] <altendky> headrx: but generally sharing full code and output is the way to go
[19:27:36] -!- thomasross has quit [Remote host closed the connection]
[19:27:44] <headrx> one sec and i got gotcha, i make ya a zip
[19:28:07] <altendky> headrx: project on github or other place it can be cloned is good, and output in a pastebin (other than pastebin.com)
[19:28:22] <altendky> well, cloned or browsed online
[19:29:44] <altendky> headrx: and i wouldn't expect the other files to be included unless you have a config to make them so or a project with setup.py or such which includes them
[19:30:28] <headrx> Oh.. which im guessing is the problem
[19:30:34] <headrx> bc they are effectively the UI
[19:30:39] <altendky> you can just put a literal copyright symbol in the code
[19:31:02] <headrx> ya
[19:31:06] <headrx> char(169)
[19:31:08] <headrx> https://ufile.io
[19:31:13] <headrx> Theres a copy
[19:31:26] -!- thomasross has joined #pyqt
[19:31:51] <altendky> headrx: no, i mean a literal instance of that symbol instead of a code
[19:32:48] <headrx> Im not entirely sure. I did it with chr(169) , but i know there is the   thing for
[19:32:49] <headrx> html
[19:32:57] <headrx> but i dunno other than that
[19:33:03] <headrx> alt-something or another
[19:33:07] <altendky> find a place where there's the symbol you want, select it, copy it, and paste it...
[19:33:22] <altendky> ©
[19:33:24] <headrx> alt-0169
[19:33:49] <altendky> 'ab©' is a perfectly valid python literal (for py3 in a utf-8 encoded file anyways)
[19:35:12] <headrx> Fair point
[19:35:15] <headrx> i fixed it
[19:35:30] <headrx> the symbol in the window title
[19:36:49] <altendky> hitting some other pyinstaller issue, not finding some python libs or somesuch. trying latest from git
[19:38:48] <altendky> nope
[19:39:54] <headrx> On my last project it did the same thing, but still outputs a file, and it worked fine
[19:41:57] <altendky> nothing in my dist, only biuld
[19:41:58] <altendky> biuld
[19:42:00] <altendky> build
[19:42:11] <altendky> which looks like the list you provided. and it should be in dist iirc
[19:42:19] <headrx> altendky: i compiled without the --onefile option, and it spits out an exe this time, but gives the error : Error loading Python DLL 'C:\Users\Laura\Code\Hot Rack\build\hotrack\python37.dll'. LoadLibrary: The specified module could not be found.
[19:42:22] <altendky> are you getting an error when you run pyinstaller?
[19:43:38] <headrx> it compiled , in the build folder hotrack.exe throws that error ^^^
[19:45:32] <altendky> https://github.com
[19:45:41] <altendky> switching to virtualenv
[19:47:16] <headrx> altendky: so i copied the python37.dll from python folder.. and it now throws this
[19:47:16] <headrx> Error loading Python DLL 'c:\Users\Laura\Code\Hot Rack\build\hotrack\python37.dll'. No error messages generated. FormatMessageW: The parameter is incorrect. LoadLibrary: PyInstaller: FormatMessageW failed.
[19:53:08] <altendky> headrx: yeah, worked in a virtualenv
[19:53:30] <headrx> hmm
[19:53:51] <headrx> did you only do the pyinstaller, or did you pyi-makespec as well ?
[19:55:26] <altendky> just pyinstaller
[19:55:34] <altendky> didn't bother with the non-.py files
[19:59:55] <altendky> sorry, that wasn't --onefile, trying that now
[20:02:25] <altendky> yep, still worked
[20:02:56] <altendky> win10, python3.7.2-64, pyinstaller 3.4
[20:03:02] <altendky> and just hotrack.py
[20:03:06] <altendky> headrx: ^^^
[20:03:07] <headrx> hmm
[20:03:19] <headrx> how do i give it all the other assetts?
[20:03:21] <headrx> assets
[20:03:55] <altendky> headrx: i would personally make a proper python project and use the associated methods (which i have cheated on, so ask #python, i'll go listen in and learn)
[20:04:12] <altendky> especially for the onefile you probably have to do it properly
[20:04:28] <altendky> and will have to use a library rather than a path to get at the data
[20:05:13] <headrx> for the bundling , or in general ?
[20:05:15] <altendky> honestly, i'd rather go away from --onefile and not bother shoving anything together. raw .py files etc
[20:05:46] <headrx> in a virtualenv i cant get it to compile still.. all i did was pyinstaller --onefile hottrack.py .. . it spits out the same
[20:05:51] <altendky> headrx: i make proper python projects regardless. to work with --onefile you have to access the data without using a path because there won't be a .css file etc
[20:06:00] <headrx> oh
[20:06:04] <headrx> fair enough..
[20:06:08] <altendky> probably going to be a pain with the qt stuff and the webpage trying to refer to a .css etc
[20:06:28] <altendky> you'll have to extract them to a temp location etc (pyinstaller might handle at least some of this, i forget the details)
[20:06:38] <headrx> What if i throw it all in one big file
[20:06:41] <altendky> headrx: but why do you need --onefile?
[20:06:41] <headrx> so theres no linking
[20:07:07] <headrx> i mean, i dont really care if its one file per se, but i dont want the html and such visible
[20:07:19] <altendky> headrx: everything in the .html directly? more chance, but still, i don't know if you can give a file-like object to the qt web engine stuff
[20:07:29] <altendky> headrx: why not?
[20:09:20] <headrx> Its for a gas station POS
[20:09:46] <headrx> just trying to make it non-accessible as possible, since its gonna be available to every employee
[20:10:49] <altendky> if they want to mess it up, they can delete it, yes?
[20:11:12] <altendky> or you could not give them write/delete access to the whole directory
[20:11:46] <headrx> the user/pass for the admin will have to be read/write access
[20:11:57] <headrx> which will be in a json file, hashed
[20:12:10] <altendky> headrx: basically, os security is how you handle security, not pyinstaller
[20:12:44] <headrx> i understand, im just trying to undestand the principles of bundling data such as css, and html in a file
[20:12:52] <headrx> maybe i should just add the whole files as variables
[20:12:58] <headrx> and render it
[20:13:12] <headrx> not the most elegant thing, but could be useful
[20:16:01] <altendky> headrx: the questions is what does the web engine accept
[20:16:14] <altendky> headrx: if you are just going to have to write it out to a temp directory anyways.. *shrug*
[20:18:46] <headrx> lol
[20:28:10] <headrx> altendky: eek @ the thought of having a 5k line variable
[20:29:02] <altendky> headrx: figure out if you can even use such a thing first. or skip it because theres no real point it seems
[20:29:15] <headrx> can render it
[20:29:35] <altendky> ?
[20:29:38] <headrx> im wondering if i can compile html like those compiled html help files
[20:29:52] <headrx> https://stackoverflow.com
[20:29:56] <altendky> headrx: it will still be an external file?
[20:30:22] <headrx> I dont really care as long as its not recognizable as html/css
[20:30:38] <headrx> in fact, id prefer it so its not stupid cluttered code
[20:30:47] <headrx> That way on my end, its easy to add features
[20:31:03] <altendky> headrx: why does this matter? also, you can probably give a user rights to run a program as another user
[20:33:26] <headrx> basically the program owner doesnt want a browser solution, worried if he sees some html, hes gonna think its that way
[20:34:08] <headrx> im wondering now if i should just encode all the data, store it in a file non descript, and just unencode before output
[20:36:30] <altendky> headrx: this is just silly
[20:36:45] <altendky> headrx: why are you developing a browser solution?
[20:37:47] <altendky> headrx: I have literally negative interest in helping you convolute stuff when it will be worse than doing things sensibly
[20:38:32] <headrx> Its low budget, easy to change, and wont be a browser solution necessarily, its being rendered by webkit, not by a broweser, so it will be low weight, and it wont need to connect outwards to anything, which i think was the main concern
[20:39:00] <headrx> Im not trying to HIDE that from him, im literally just making it unreadable as regular html files
[20:39:02] <altendky> headrx: not a browser? You mean you aren't existing a back button?
[20:39:12] <headrx> Correct
[20:39:16] <headrx> no buttons, no nothing
[20:39:22] <altendky> headrx: ... :[
[20:39:38] <headrx> just that window, shows a table, allows him to add foodstuffs
[20:39:56] <headrx> Hes going to be aware
[20:40:10] <altendky> headrx: this is all silly
[20:40:18] <altendky> Qt can do tables
[20:40:19] <headrx> its no secret amigo, its just on a gasstation POS , so he didnt want it to load in a browser
[20:40:28] <altendky> Windows can do security
[20:40:48] <altendky> Browsers can be locked down
[20:41:13] <headrx> Thats a no go ghostrider, no browser whatsoever
[20:41:26] <headrx> Hence trying to obfuscate the html
[20:41:28] <altendky> headrx: you are using a browser
[20:41:55] <altendky> Yes, obfuscation is stupid when real security would likely be easier
[20:41:58] <headrx> I should say, no regular browsers. he doesnt want to unlock that for the users.
[20:42:10] <altendky> headrx: browsers can be locked down
[20:42:15] <headrx> Not my call
[20:42:22] <altendky> headrx: the rest is
[20:42:50] <headrx> This seems like the quickest, low budget solution.
[20:43:15] <headrx> but tbh, i totally agree with you
[20:43:42] <headrx> id RATHER write it out with tables with qt
[20:43:53] <headrx> how much overhead could it be, right ?
[20:44:04] <headrx> I was doing it css and js bc its way easier to style
[20:44:22] <headrx> altendky:
[20:44:37] <altendky> Because styling is important for a gas station POS on a budget...
[20:44:56] kdas_ is now known as kushal
[20:45:29] <altendky> Sounds like maybe a locked down spreadsheet
[20:47:17] <headrx> i think he'll be okay with this solution
[20:47:26] <headrx> although im sympathetic to your plight
[20:57:05] <headrx> altendky: i think ill just make them all hidden files
[20:57:07] <headrx> seems easier
[20:57:15] <headrx> and less convoluted
[20:57:24] <altendky> headrx: hidden isn't security
[20:57:51] <altendky> headrx: check with windows people about letting one user run a program as another user. setuid in linux
[20:58:07] <headrx> yeah im familiar with runas
[20:58:08] <altendky> headrx: then you can give the operators user no other access to the files
[20:58:34] <headrx> thats more dangerous tbh , i just did a CTF game where i went from regular non priv user to domain controller using runas
[20:58:36] <altendky> and do anything with the files and actually have security, rather than making things convoluted for everyone (including me) to get not-security
[20:58:46] <altendky> headrx: i didn't say do it stupidly
[21:49:22] <headrx> altendky: damn your logical ways
[21:57:21] <headrx> appealing to sensible ways.
[21:58:02] <headrx> im gonna complete this way, then im going to rewrite it with the pyqt5 as well, to learn. i dont know how to do it yet, is truth
[21:58:11] <headrx> havent learned gui yet very well
[21:58:24] <headrx> havent learned gui yet very well
[21:58:26] <headrx> oops
[22:08:24] -!- mintograde has quit [Ping timeout: 272 seconds]
[22:48:23] -!- Mrokii has quit [Ping timeout: 245 seconds]
[23:02:39] -!- Mrokii has joined #pyqt