You should look into using PyQt or PySide. They are python bindings for
the very popular Qt GUI framework.
On Wed, Oct 5, 2016 at 2:33 PM, Beverly Howard wrote:
> >> if it is a pi controlling the system I would tend towards controlling it
> from a web page via the network. to keep it updating
Define your colors as actual number variables instead of a string
color = (255,0,0)
color2 = (0,0,255)
Then use argument expansion to pass them in as separate arguments to the
function
colorFunction(*color)
Brendan
On Wed, Oct 5, 2016 at 12:17 PM, John McKenzie
wrote:
>
> Hello, all.
>
> I
> a = 1
if condition:
print(a) # UnboundLocalError: local 'a' referenced before assignment
a += 1
For-loops are no different. Making them their own namespace is a very
strange thing to do, it would mean you couldn't re-bind a value inside a
for-loop:
count = 0
for x in sequence:
cou
Yes, loops don't have their own scope. Indeed, very few flow elements in
python -- if, with, try/except -- create a new scope. In that sense, it's
fairly consistent, but can be unexpected for people that have used
languages with many nested scopes.
The lambda behavior is a common gotcha - there
> Splitting it up would make it slower to load.
It's usually the opposite. When packages are split up, you only have to
load the specific portions you need. Putting it all in a single module
forces you to always load everything.
On Fri, Sep 23, 2016 at 11:59 PM, Lawrence D’Oliveiro <
lawrenced.
Unless you're actually distributing python (as in, the interpreter or it's
source code), you don't need to include the python license or the copyright
notice. You also don't need a Contributor agreement just to distribute a
python library. That is more for people who are contributing to core
Pyth
unction is concerned.)
On Tue, Sep 13, 2016 at 11:31 AM, Chris Angelico wrote:
> On Wed, Sep 14, 2016 at 4:28 AM, Brendan Abel <007bren...@gmail.com>
> wrote:
> > This looks like a decorator function that optionally accepts arguments to
> > change the behavior.
>
&g
This looks like a decorator function that optionally accepts arguments to
change the behavior.
You can safely ignore the warning form PyCharm. the variable won't be
shadowed it's included in the function signature of the inner function.
A lot of times, the outside decorator will just use the *ar
Generally, all your unittests will be inside a "tests" directory that lives
outside your package directory. That directory will be excluded when you
build or install your project using your setup.py script. Take a look at
some popular 3rd party python packages to see how they structure their
proj
You could create your own generator that wraps enumerate
def reverse_enumerate(iterable):
for i, val in enumerate(reversed(iterable)):
yield len(iterable) - 1 - i, val
for i, val in reverse_enumerate(x):
...
On Wed, Jul 20, 2016 at 10:42 AM, Ian Kelly wrote:
> I had occasion to
A lot of these arguments and points have already been made and hashed out
on the python-dev list. There's a very good article that one of the python
core developers wrote about the decision to move to github
http://www.snarky.ca/the-history-behind-the-decision-to-move-python-to-github
Basically,
Consider the following example python package where `a.py` and `b.py`
depend on each other:
/package
__init__.py
a.py
b.py
There are several ways I could import the "a.py" module in "b.py"
import package.a # Absolute import
import package.a as a_mod
I have a relatively large python package that has several cyclical
dependencies. The cyclical dependencies typically aren't a problem so long as
I'm just importing modules, and not named attributes (ie. function, class,
globals), which may not be defined at a given point in the import routine
On Jul 7, 3:00 pm, MRAB wrote:
> Brendan Abel wrote:
> >>>> One thing that would be very useful is how to maintain something that
> >>>> works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up
> >>>> versions below 2.6 is out of the ques
> > > One thing that would be very useful is how to maintain something that
> > > works on 2.x and 3.x, but not limiting yourself to 2.6. Giving up
> > > versions below 2.6 is out of the question for most projects with a
> > > significant userbase IMHO. As such, the idea of running the python 3
> >
While I think most of the disagreement in this long thread results
from different beliefs in what "freedom" means, I wanted to add, that
most of the responses that argue that the MIT license permits the user
more freedom than the GPL, suffer from the broken window fallacy.
This fallacy results from
On Apr 30, 9:04 am, Jabapyth wrote:
> At least a few times a day I wish python had the following shortcut
> syntax:
>
> vbl.=func(args)
>
> this would be equivalent to
>
> vbl = vbl.func(args)
>
> example:
>
> foo = "Hello world"
> foo.=split(" ")
> print foo
> # ['Hello', 'world']
>
> and I guess
On Apr 28, 11:44 am, Richard Lamboj wrote:
> Hello,
>
> is there any way to get the name from the actual called function, so that the
> function knows its own name?
>
> Kind Regards,
>
> Richi
If you want to get the function name from within the function itself,
check out the inspect module.
http
On Apr 27, 7:20 pm, goldtech wrote:
> Hi,
>
> This is undoubtedly a newbie question. How doI assign variables
> multiline strings? If I try this i get what's cited below. Thanks.
>
> >>> d="d
> d"
> >>> d
>
> Traceback (most recent call last):
> File "", line 1, in
> NameError: name 'd'
19 matches
Mail list logo