« first day (283 days earlier)      last day (2118 days later) » 

10:38 AM
any idea on what to do @DMA57361?
 
@IvoFlipse hmm, sorry, for what?
 
I want to make numpy a builtin (in my app)
or well, I wanted to bundle all third party libraries in my app, just to be sure they're there
but matplotlib depends on numpy :\
 
and you can't bundle numpy?
 
the import statements in matplotlib say: import numpy
but that's expecting its in the same folder or something :\
 
@IvoFlipse doesn't it just expect it to be in the sys path?
 
10:42 AM
so I should just append my library folder to the sys.path?
 
probably, yes
I'd have to test it to be sure
note that changing sys.path mid-execution makes the changes only work for that program instance, they're not a permanent change
 
yeah so I've noticed
well I would append them in my mainview (which runs the place)
 
have you tried any of the things that try to package a Python app up in to an exe?
 
well I'm having trouble finding what I need
because I don't know the words they use to describe it
 
ah, the only one I've heard of is Py2Exe, but only having seen it mentioned on SO, I've never tried it
 
10:49 AM
well my only other option is to ignore matplotlib + numpy
and only bundle the rest
then they just have to install python(x,y)
 
true
 
too bad I have to check ALL my modules now to reverse it
(why didn't I just test it in a couple of places... sigh)
Btw I stumbled over this tool
I guess I could tweak my little program to just use that colourchooser instead of the separate 0-1 values
 
have you made it so the users can change the output colours then? I'd assumed that was only for your benefit
 
you can change the sliders for R G B with 5 intervals
by pressing those buttons you display the result
and it get's printed to the command line
but off course its mostly for my benefit, unless I share it with others
 
11:05 AM
f/e
 
huzzah, something with my database doesn't work :\
but no errors...
 
:/ oh dear, what kind of "doesn't work"
 
well my app loads, but the data doesn't :\
 
ah
 
what's strange is that pub sub seems to work, since some modules get called that get triggered by it.
the database works, since I can retrieve the username
though perhaps that only tests sqlite :\
soooo stupid... forgot to update the pubsub imports for the panels
apparently if they don't important the same module, they can't connect
 
11:16 AM
ah, so the DB was fine, but they just weren't getting the data?
 
no, all my views could talk to each other, but not to the controllers or models
very confusing, hehe
 
oic, you had two separate pubsub groups
 
well due to the different imports yes
 
fun :/
 
argh, I've been updating the pubsub imports, only to spot I'm forgetting to update the wx one...
still doesn't work :\
and off course, no errors
double image uploading bug strikes again!
anyway, I split up my pressure over time in running vs walking
I wanted to make a panel with some statistics and detect outliers and such
but when I looked at measurements that deviated 2 STDEVs almost none qualified, because those two conditions were mixed up. Which causes too much variation
 
11:34 AM
@IvoFlipse and they claim it was fixed - meta.stackoverflow.com/questions/94649/…
 
perhaps its not yet fixed
 
11:53 AM
> Fixed a modulefinder crash on certain relative imports.
that's from py2exe.org, so I guess I'm not the only one having problems :P
oh that's apparently not the same problem, too bad :(
 
:/ looks fun to sort out
 
yeah... I was just planning on trying to making an exe
just to see how that goes
 
I guess if it works it will make deployment a lot easier for you
 
well I still have that thorn in my eye called mysql
but yes, having everything in a .exe would make it more dummy proof
lol I can't even replicate the hello world example
 
12:13 PM
:/ doesn't bode well
 
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied
# Parse the command line; any command-line errors are the end user's
# fault, so turn them into SystemExit to suppress tracebacks.
right
I need to call it through the command line
it worked, but an app that just does hello world crashes without notice :\
ah it does work :)
now I wonder how to extrapolate that to my own app :P
 
@IvoFlipse well that's the "fun" bit :/
 
I think it just quits after running
rather than keeping the interpreter or stdout open
hmmm I pointed it to my mainview and it did do 'something'
but it doesn't remain open very long :\
d'oh ==> console=['hello.py']
I don't want a console, I want a window
strange, now it create a whole bunch of files, but no .exe
 
12:34 PM
:/
 
ah! now it does work :)
well on this example that is :)
crap, its missing pubsub :(
I wonder if its a problem that its trying to import those modules I just added there and something going wrong with that
 
Hey guys, how's things?
 
@slotishtype Hot.
 
Wow.... :-)
 
@slotishtype Very hot
 
12:41 PM
Wow wow....
Is this in reference to .... weather? Please say weather :-)
 
@slotishtype yep, afraid it's the bad type of hot
 
@slotishtype No I was referring to my GF :P
 
Sweeeeeeet...... ;-)
 
this is a useful tool @DMA57361
too bad it get's the same errors as py2exe
 
@IvoFlipse ah, almost helpful then
 
12:53 PM
Traceback (most recent call last):
File "MainView.py", line 10, in <module>
ImportError: cannot import name Publisher
still this error :\
2
Q: ImportError: cannot import name Publisher

ShansalI created succesfully an executable version (Py2exe, Pyinstaller) of my application. When I try to run the app from .exe, I get an error as follows in the log file: Traceback (most recent call last): File "CreateAS.pyw", line 8, in <module> ImportError: cannot import name Publisher I am ...

huzzah for SO
perhaps I should just update to wxpython 2.9
 
the first answer says "version of wxPython that is >= 2.8.11.0?" so presumably upgrading isn't going to help..?
 
doesn't it also say the structure has been changed?
 
well yes... I guess it depends on if your current version is >= 2.8.11.0, doesn't it.... so what version are you on? :)
 
2.8.11
currently I import with:
from libs.wx.wx.lib.pubsub import Publisher as pub
 
ah, f/e, so the answer should match your needs?
 
1:03 PM
(where libs.wx is the folder with my wx library)
 
so, that's a no then?
 
well it didn't give that error this time
I tweaked some dial
about bundling stuff
the stupid thing is, because I changed all the paths, I think py2exe can't resolve them for me :(
ah at least I managed to replicate the error
if I include from libs.wx.wx.lib.pubsub import setuparg1I also get the ImportError
Traceback (most recent call last):
File "C:\IvoPython\App\MainView.py", line 11, in <module>
from libs.wx.wx.lib.pubsub import Publisher as pub
ImportError: cannot import name Publisher
that setuparg1 says: Import this file before the first 'from pubsub import pub' statement to make pubsub use the arg1 messaging protocol
 
1:32 PM
I don't know what version of the API I'm using :\
I wonder if I should try to revert my changes and see if that helps
 
@IvoFlipse it's probably worth a try
 
ImportError: No module named listenerimpl
 
1:53 PM
ah I'm using the old protocol
at least that's clarifying
oh boy, I'm so not going to rewrite every single line that uses the old protocol
it looks awesome and useful, but at the moment, that's waaaaaay to much work...
 
2:08 PM
> Starting with wxPython 2.8.11, wx.lib.pubsub integrated the new PyPubSub. In wxPython 2.8.11, wx.lib.pubsub is configured to expose PyPubSub's "version 1" API rather than the newer, more capable version 3 API. This will give pubsub users a chance to upgrade their wxPython-based application to pubsub version 3 if and when they are ready. To use the new version 3 API in wxPython >= 2.8.11.0, an application must specifically request it via a configuration module, discussed later.
 
3:06 PM
ah, when I use: from wx.lib.pubsub import setuparg1
I need to replace every instance of Publisher to pub ==> Done
but it seems I need to add that line (from wx.lib.pubsub import setuparg1) to every module :\
interesting, now I'm getting matplotlib errors instead :\
 
3:52 PM
hey @IvoFlipse how are you today?
 
flabbergasted mostly :P
 
lol how so?
 
I've been trying to make an .exe
but I'm getting errors in strange places
 
lib import errors?
 
and all these things I don't really understand :\
everything!
wx.lib.pubsub.core.topicexc.ListenerSpecInvalid: Invalid listener spec: Params [] missing inherited [message] for topic "SessionModel.selectall.nosessions" required args
this is the latest
 
3:55 PM
well I'm not the best at this either... that's a pubsub error isn't it?
 
yeah, I needed to change something, because else py2exe doesn't know which version of pubsub to use...
that means I had to update EVERY import statement
class ListenerSpecInvalid(RuntimeError):
    '''
    Raised when an attempt is made to define a topic's Listener Protocol
    Specification to something that is not valid.

    The argument names that are invalid can be put in the 'args' list,
    and the msg should say what is the problem and contain "%s" for the
    args, such as ListenerSpecInvalid('duplicate args %s', ('arg1', 'arg2')).
    '''

    def __init__(self, msg, args):
        argsMsg = msg % ','.join(args)
        RuntimeError.__init__(self, 'Invalid listener spec: ' + argsMsg)
 
couldn't you just create an 'installer' that installs python 2.6 and then create an '.exe' that just is like a .bat file and runs the right .py file?
@IvoFlipse ew
 
well I'm sure py2exe isn't much more than that
I actually got it working on a 1 file wxpython + pubsub example
so its possible
 
oh that's a program to convert py to exe?
didn't realize that
 
yup
and with gui2exe its pretty 'easy'
other than the errors I keep getting
 
3:58 PM
> able to run without requiring a Python installation.
 
I just can't understand what the problem is
what's worse, its talking about: "SessionModel.selectall.nosessions"
def selectall(self, values):
    print('SessionModel.selectall')
    query = """SELECT sessionid, subjectid, sessionname, sessiondate
            FROM `sessions`
            WHERE subjectid = %s
            """
    self.cur.execute(query, values)
    results = self.cur.fetchall()
    self.sessions = [] # What happens if I only the subject has no sessions?
    for result in results:
        count = self.countmeasurements(result[0]) # assuming result[0] == sessionid
        self.sessions.append(Session(result, count))
I don't see any nosessions :\
argh ffs
now I spot it
 
just in case
0
A: How to bundle a python application including dependencies for windows?

Cody Brociouspy2exe is the best way to do this. It's a bit of a PITA to use, but the end result works very well.

appears you're not the only one that has had issue with py2exe
but it looks like py installer might be a better option...
20
A: An executable Python app

JamieAnother system (not mentioned in the accepted answer yet) is PyInstaller, which worked for a PyQt project of mine when py2exe would not. I found it easier to use. http://pyinstaller.python-hosting.com/ Pyinstaller is based on Gordon McMillan's Python Installer. Which is no longer available.

 
3
Q: ImportError: cannot import name Publisher

ShansalI created succesfully an executable version (Py2exe, Pyinstaller) of my application. When I try to run the app from .exe, I get an error as follows in the log file: Traceback (most recent call last): File "CreateAS.pyw", line 8, in <module> ImportError: cannot import name Publisher I am ...

This is the real problem (with regards to pubsub)
and you are effected by it as well
we need to clean up all your pubsub statements to stay compatible with upcoming versions of wxpython
 
Hmmm... well I really need to get a grasp of 'pubsub' anyways...
what needs to be changed?
 
4:06 PM
there is also this:
but it looks a little more involved...
 
one 'upside' to all this is that all the errors are legit problems with my code
 
@IvoFlipse lol... well that's what we get for being 'fake programmers'
is thinking where to start today on the app
 
@KronoS well we were having this discussion friday night
like I said, you can create a patient/observation on the fly
we just add a search option which lists all patients on a certain day (you'll see the session in that list)
 
but here's a situation that I don't know how to handle....
 
if its chronological (datetime, rather than just date) you can simply see which patient it is
 
4:10 PM
the doctor has a list of patients that he will see... we are going to be creating a list that is 'chronological' of patients that are going to be seen and write down those patient 'numbers' to reference back later on...
 
@KronoS just write down what patient you saw at what time
 
but then during the middle of our observing a patient walks-in and wants an appointment... how do we keep track of that?
 
are you going to track him?
 
so just write down patient 'numbers' as we go?
 
yeah pretty much
 
4:11 PM
@IvoFlipse 'him' being the patient? if so, then no...
 
well I wouldn't write down anything, because its pointless or at least doesn't add anything
do you need to track that your doctor is doing something to that patient? (who just walked in)
 
@IvoFlipse it basically gives a 'sense of comfort' to the doctors to go back as a reference in case data 'blows up'....
 
@KronoS the only way they cannot go back is if you don't track what he's doing
 
but if the observer can take notes for each patient... in other words ability to say 'hey this patient was psycho!' then I don't see the need of referencing it back
 
@KronoS the advantage of using Python is that its probably much easier to create a dashboard, where we can compare the current patient with all the others
instead of noticing what a psycho the patient was at the end of the day, you'll notice while the patient is there
even better, the doctor can use how much time he spend on stuff as feedback to see if he's doing an OK job on the patient and/or how severe the problems are
like a measure of efficiency (even though that shouldn't matter to a doctor)
 
4:15 PM
Hmmmm.... Well since we're using the Access one right now... I say we make this one the way that we want and then convince them later on why our way is better...
 
btw welcome back @DMA57361
 
@IvoFlipse agreed but the goal is going to be measuring the difference between using paper med records, vs electronic med records
 
@IvoFlipse howdy
 
@KronoS well he should be able to see the difference on the fly
 
so efficiency is important to track... though it's not the exactly the goal of the doctor
@DMA57361 hey @DMA57361
 
4:17 PM
like in Mario Kart, you can see how long the time took with the other method and how you're doing
 
@IvoFlipse i don't understand...
how would we see it on the fly?
 
@DMA57361 it seems that I needed to tell pubsub which version I want, every time I create a sendMessage thing
@KronoS because with Python its very easy to compare the results against some average stats
I wouldn't know where to begin with access and how to interface that
 
I didn't either... but my compadre kinda does... and he's dead set on using it...
as much as he's my friend... I'm slightly hoping that the database tanks on him to prove my point of his inefficiencies
but then I'd kinda feel bad at the same point....
 
@KronoS that GDocs you sent me, compared to probably even sqlite its just plain slow
 
@IvoFlipse exactly! but he feels that these times are great! he's like hey I'm processing 1.4 million entries in 4 seconds... but I'm trying to tell him he can do that in fractions of a second...
even in Access if he restructured his database... but he's dead set on what he's got...
 
4:24 PM
@KronoS I thought it was taking him even longer
well I guess we need something to convince him that with Python he would rock even more ;)
rather than that you rock more than his Access
probably adding some good documentation, so he can easily migrate would help too
 
@IvoFlipse I've been trying to tell him that... but he's just being stubborn... I don't know what to do at this point, other than just continue on....
@IvoFlipse your right... it was 4 minutes to export to a text document, 53 seconds to load the table, and 20 seconds to 'process' the data
 
@KronoS right, with mysql I insert 4 million records in 6 seconds, which includes parsing the input file
 
@IvoFlipse wow that's fast!
I wonder what it'd be like with SQLite
 
not much different
just don't let sqlite grow to 20 Gb
which it won't in your case btw
 
anyways... enough of my complainin... I'm gonna get back to work...
 
4:29 PM
well, we need those calculations for the weights
 
oh ya... I can work on that...
 
5:17 PM
ok @IvoFlipse you around?
 
5:31 PM
not really, cooking dinner
but shoot
 
I just sent a push your way... but need to figure out how to implement the code
take your time and get some dinner though... I'll work on it in a few... I'm getting some things done with SU and then blog.SU
 
@KronoS like scheduling my router post ;P
hi @dmckee
 
Hey.
 
@IvoFlipse ya :)
hey @dmckee
 
6:13 PM
getting a step closer every time
 
ok... got my errands done :P
are you free now @IvoFlipse
 
well not free, but at least I'm online :)
pulling the latest version
 
lol... well lemme know when you can take some time to help me out
don't wanna impose on your stuff you need to get done
 
I see you changed some things in the model, but didn't update those on the mainpanel + ribbonpanel (button + objectlistview)
 
well that's what I need to talk to you about....
so here's my thinking and kinda my dilemma...
 
6:17 PM
And I notice you've added a Weights class
 
whenever a button is 'clicked' I need to run this the weights function on ALL buttons that have been pressed
@IvoFlipse wait what did I change in the model?
 
@KronoS The object list view:
ObjectListView.SetColumns(self.observationList, [
ColumnDefn('PatientID', "left", 75, 'patientid'),
ColumnDefn('Subject', "left", 120, 'subjectid'),
ColumnDefn('Observer', "left", 120, 'observerid'),
ColumnDefn('Clinic', "left", 145, 'clinicid'),
ColumnDefn('AM/PM', "left", 60, 'sessionname'),
ColumnDefn('Date', "left", 75, 'date', isSpaceFilling=True),
])
the first thing is what you put above the columns
left = alignment
 
oh yes... I made those changes to better fit onto our tablets that we're working with
 
the 75 = the width
when you set an class instance (or something with attributes) or dictionary to the OLV
it fills the columns based on the attributes in the last column
class Observation():
    """
    Create an instance of this and pass the results of your query to this class.
    This will create attributes based on the columns of the database
    """
    def __init__(self, results):
        self.items = ['observationid','subjectid','clinicid','observerid','date','sessionname']
        for item, result in zip(self.items, results):
            setattr(self, item, result)
observationid != patientid so that's empty
and I thought another was empty
Ah you probably changed something so observerid isn't written to the database
 
Hmmm... well maybe I'll just find&replace all 'observation' --> 'patient'
 
6:24 PM
well you don't have 60 modules like I do :P
 
@IvoFlipse that's so crazy!
 
"""INSERT INTO patient(subjectid, clinicid, patientid, sessionname) VALUES (?, ?, ?, ? )"""
right, you don't insert the observerid, so we can't retrieve it either
strange, because it used to work ;P
@KronoS now you can imagine why its a problem when I have to update the import statement all over the place
 
@IvoFlipse gee I wonder who screwed that up ;)
@IvoFlipse ya for sure... so are you working on fixing that?
or should i?
 
@KronoS I'll let you :P
 
oldy foldy
 
6:29 PM
so I can continue finding what my own error is
 
ok done... now let's see if it worked
crosses fingers
Ha Ha! I looks like it works!
 
so you passed it to that function and then managed to retrieve it?
 
lemme send you a push...
ok pushed... so here's what I did.... changed all the instances of 'observation' to patient
 
ok
just the observation portion I reckon
so observationid = patientid
 
yep!
but I still get some weird 'unique id errors'
 
6:42 PM
well then you check what makes records in that table unique
and see what you try to put in it (just print the values)
 
7:01 PM
you know what the problem was @DMA57361 @KronoS? All those errors weren't due to pubsub, but because it didn't know where to find my models/controllers/views...
sigh
 
so does this mean you've found a solution?
 
@DMA57361 well most functions seem to work
now I'm slightly regretting renaming stuff all over the place :P
though I think I can rollback some of the changes
though if gui2exe/py2exe can make sure all libraries are included, I don't need local versions to get it working
and I need to trim it, since its 97 MB at the moment :P
 
ouch, sizable
 
haven't excluded any matplotlib stuff though
so there's room to trim
 
f/e
 
7:09 PM
I had to tweak the setup.py by hand though, so I'm trying to find out how to do this through gui2exe
 
@IvoFlipse how did it not know where to find the models?
 
ah apparently I have
@KronoS because I was using from models import *
but didn't tell gui2exe to include this folder
lol it craps it get's errors
but the error is UnicodeEncodeError: 'ascii' codec can't encode character u'\xb1' in position 0: ordinal not in range(128)
 
well I gotta head... i figured out the unique id error.... I'll send the push
 
I'll be back later tonight i think... maybe... I'm picking up my sis from the airport, and will be dealing with that most of the day
 
7:14 PM
ok, well my GF has a nightshift again, so I'll be around for some time
 
lol ok...
l8rs
 
now to try and built a compact version, with everything in one big exe file
 
 
3 hours later…
9:55 PM
@KronoS It works for me :)
 

« first day (283 days earlier)      last day (2118 days later) »