Re: python3.7 error PYQT5 - NameError: name 'self' is not defined

2018-09-21 Thread Christopher Mullins
>
> Hi when I disconnect the internet I get an error NameError: name 'self' is
> not defined. I really dont get it.. thanks all. Is that a bug? or my fault?

Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "C:\programming Alon\stock market app\PROJECT\AlonStockMarket.py",
> line 93, in secret
> print(ping('google.com'))
>   File "C:\programming Alon\stock market app\PROJECT\AlonStockMarket.py",
> line 72, in ping
> conn.connect((addr, 80))
> socket.gaierror: [Errno 11001] getaddrinfo failed
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):
>   File
> "C:\Users\Alon\AppData\Local\Programs\Python\Python37-32\lib\threading.py",
> line 917, in _bootstrap_inner
> self.run()
>   File
> "C:\Users\Alon\AppData\Local\Programs\Python\Python37-32\lib\threading.py",
> line 865, in run
> self._target(*self._args, **self._kwargs)
>   File "C:\programming Alon\stock market app\PROJECT\AlonStockMarket.py",
> line 95, in secret
> self.pushButton.setDisabled(True)
> NameError: name 'self' is not defined


Looks like `self` is supposed to be referring to an instance of the class
`Ui_AlonStockMarketApp` (which has the pushButton attribute) but you've
defined the secret function outside of that class.  Try defining that
function inside your class.

HTH,
Chris
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask: request vs Request

2018-03-12 Thread Christopher Mullins
>
> Could you please give some context when you reply, TIA
>

Whoops, thanks for the reminder Mark.

So what for the Request is used  for then?


In general when you see that something in Python starts with a capital
letter, that indicates a class. Check out the relevant section of the PEP8
coding style [1], this is a good reference to have on hand.  (This
generalization doesn't apply to builtin types which follow a separate
convention, also outlined in [1] -- and of course there are a numerous
exceptions.)

This holds for your variable in question "request" which is an instance of
the Request class.  Check out [2] for more information on this.  PyCharm
tries to do its best but I've had this problem too.  You can always open up
a python REPL and look at the object yourself:

>>> import flask
>>> r = flask.Request
>>> r

>>> dir(r)

and so on.  When I'm working in python I like to keep one of these open for
this purpose.

HTH,
Chris

[1] https://www.python.org/dev/peps/pep-0008/#class-names
[2] http://flask.pocoo.org/docs/0.12/api/#incoming-request-data
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flask: request vs Request

2018-03-10 Thread Christopher Mullins
In the code you linked, I don't see where the *R*equest is used. The
request variable is setup by flask when you annotate the function with the
resource endpoint and POST method. It contains the content of the request
which can be converted to json if that content type was specified.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Christopher Mullins
> Would it be possible to emulate a minimally functional brain-to-brain
coupling system entirely in Python?

I don't know what that would entail, but the links I shared have a mailing
list and a very responsive gitter, both of which would be great places to
ask about that!  (You're welcome to ask here of course, but this being the
general python mailing list, it's a shot in the dark.)  Good luck!

Chris
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: psychocomputational analysis toolkit in Python?

2018-03-08 Thread Christopher Mullins
You might find MNE useful, and if what you're doing happens to fit
somewhere in their package you could contribute to it -- they're a good
group to work with.

https://www.martinos.org/mne/stable/index.html
https://github.com/mne-tools/mne-python
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Hi

2015-07-27 Thread Christopher Mullins

 I downloaded files(Python 2.7.10 - 2015-05-23
 https://www.python.org/downloads/release/python-2710/) to setup on your
 website.
 (also got the version of x64 because of my cpu)
 But when I try to install it, there is an error.
 The error is There is a problem with this Windows Installer package. A
 DLL required for this install to complete could not be run. Contact your
 support personnel or package vendor.


According to this link, it could be a permissions issue [1].

[1]
http://superuser.com/questions/478631/dll-could-not-be-run-for-msi-installers
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Which GUI?

2015-07-24 Thread Christopher Mullins
You might checkout pyqtgraph.  I think a ton of the examples will be
relevant to your use case.

On Fri, Jul 24, 2015 at 1:31 PM, Paulo da Silva 
p_s_d_a_s_i_l_v_a...@netcabo.pt wrote:

 Hi all!

 I am about to write an application (python3 in linux) that needs:

 1. Display time series graphics dynamically changed as the application
 runs, i.e. the graphics should reflect some internal variables states.

 2. The same but for some network like diagrams. Basically nodes and
 connections (straight lines). Nodes can have different colors depending
 on their activity levels and also, together with connection lines, may
 be created and deleted dynamically.

 3. Interaction with the user (not sure yet, here).

 4. Some modules may need to be moved to C++ in case of lack of enough
 speed. So, the possibility of the GUI libs be used with C++ may be an
 advantage. Anyway I can always stay in Python and write a C++ extension.

 5. Several multi processor segments.

 6. For now single user - possible but unlikely multi-user in the future.

 Which technology is better?
 matplotlib?
 tkinter?
 wxwidgets?
 qt?
 Web: ajax (I don't know much about this - need to learn), using cherrypy
 or django?
 Any other?

 Thanks for any help or comments.
 --
 https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: ImportError: No module named site

2015-07-23 Thread Christopher Mullins
What did you set those variables to?

Also, output from python -v would be helpful.
On Jul 23, 2015 10:15 PM, Laura Creighton l...@openend.se wrote:

 In a message of Fri, 24 Jul 2015 09:37:35 +0800, chenc...@inhand.com.cn
 write
 s:
 hi:
 I'm Needing to get python 2.7.10 to cross compile correctly for an ARM
 embedded device. When I execute python using shell, it comes out this
 error:ImportError: No module named site.I have setted environment
 varible:PYTHONHOME and PYTHONPATH. Is there some good idea to sovle this
 issue?

 You might want to try that question over here:
 https://mail.python.org/mailman/listinfo/mobile-sig

 I think you have an issue with dynamic library linking, but I don't
 know how to find out for sure.   People there do.

 Laura
 --
 https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list