Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Michael Torrie
On 07/30/2018 11:04 AM, Akkana Peck wrote:
> Yes, this is the future, since it lets you use both GTK3 and Python3.

Unfortunately the automatically-generated bindings, while fast and
complete, are not quite as pythonic as the old PyGTK bindings were.  The
abstraction layer pygobject provides leaks some of the underlying C-isms
through.  I can't remember exactly which bits feel the most foreign as
it's been a while since I used it.  But who am I kidding?  PyQt (my
preferred toolkit) or PySide aren't terribly Pythonic either; lots of
C++ and Qt abstractions leaking through various Qt types when native
Python types would be preferable (like lists and dictionaries).
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Why did logging not undergo PEP8 API change?

2018-07-30 Thread Ben Finney
Skip Montanaro  writes:

> There was some discussion of the idea (before the thread predictably
> wandered off into the weeds). I've not found anything else obviously
> related to the topic. Perhaps it was nothing more than that the
> threading module had a PEP-8 champion while logging didn't?

Sometimes, even with a champion for improving the API through renames,
it doesn't happen. There is still the BDFL (or whatever comes to replace
that role) to reckon with
https://mail.python.org/pipermail/python-dev/2008-July/081263.html>.

In that case, it was the inertia of the existing body of code using the
API names which gave justification to reject renames. I would expect
that was significant also in the decision not to change the ‘logging’
API names.

-- 
 \ “[F]reedom of speech does not entail freedom to have your ideas |
  `\accepted by governments and incorporated into law and policy.” |
_o__)   —Russell Blackford, 2010-03-06 |
Ben Finney

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


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Liste guru

Il 30/07/2018 19:31, Chris Green ha scritto:


OK, thanks, where is its home and full API documentation etc.?
-- Chris Green·-- https://mail.python.org/mailman/listinfo/python-list


On the first page of the official docs, 
http://pygobject.readthedocs.io/en/latest/, there are the links to the 
Python Gtk3 Tutorial, to the Python GI API Reference and all you need to 
start to work with Pygobject and Gtk3.


Just a side note: Gtk3 uses the gobject-introspection (and, for Python, 
PyGobect) to 'connect' the library to Python (or with Lua or Vala) but 
the same introspection system is used also for different library, 
graphical (GStreamer or Goocanvas) or not (Gio).


    Daniele Forghieri

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


Re: hello from a very excited and totally blind python programmer and game player

2018-07-30 Thread Amirouche Boubekki
Of course I forgot the static page generator program read (or listen)
direct text of the link at the code follows
https://raw.githubusercontent.com/amirouche/xp-maji/master/maji.py

xp is for experience :smallsmile:

I am a recovering lisp dev, so all my new programs are small. If you want a
pure Python webdev try: git clone https://github.com/amirouche/beyondjs

Le lun. 30 juil. 2018 à 20:33, Amirouche Boubekki <
amirouche.boube...@gmail.com> a écrit :

>
>
> Le mar. 24 juil. 2018 à 22:10, Daniel Perry  a
> écrit :
>
>> Hi there everyone, my name is Daniel Perry
>
>
> Hello!
>
>
>> and I'm a totally blind new Python user.
>
>
> Ok!
>
>
>> I've only just recently started picking up python and playing with it and
>> I intend on building some unique audio computer games for the blind.
>
>
> That. Is. An. Adventure. If you plan on a multi touch experience I
> recommend you look into #kivy and #python especially on freenode IRC
> network.
>
>
>> Such things mostly as simulation games like farming, building type games
>> and even eventually a virtual world built completely with audio but
>> building it in such a way that both we as totally blind colonists can live
>> inside of it but also that our fully sighted counterparts could live here
>> as well and not need any sort of guidance from the other group. That is,
>> the blind would not need any help from our sighted counterparts and you in
>> turn would not need any guidance from us as to how to live in the world or
>> grow in it.
>
>
> Well, that reads like an real adventure here. I've listening to books and
> while it's different, you still enjoy the story, so maybe I can enjoy a
> game made of sounds.
>
>
>> Of course this virtual world idea is down the road, I've got other game
>> ideas first of all but I would eventually like to get to the point I've
>> just described above.
>
>
> At some point, you might stop at the point where it pays the bills!
>
>
>> Preferably building my own server on which to park not only my virtual
>> world and games but also my web site that I would most likely need to put
>> these items up to be downloaded.
>
>
> I attach a small program that does render jinja2 templates and markdown, I
> hope you like it.
>
>>
>> Also, When I opened up the first message that I had gotten from this
>> list, I got a prompt hat popped up asking if I wanted to make windows live
>> mail my default news client and I answered no. From that point on, I've
>> been getting an error message and the message would not open. How must I
>> fix this? or am I able to correct this situation. Have a wonderful day and
>> I look forward to hearing from you soon.
>>
>
>  That's a nast3 behavior.
>
-- 
https://mail.python.org/mailman/listinfo/python-list


How to start gnuradio

2018-07-30 Thread bengt . tornq
My gnuradio program does not start in my Mint 17.3 installation.

When I invoke the command "gnuradio-companion" I get the following message:

-
Cannot import gnuradio.

Is the python path environment variable set correctly?

All OS: PYTHONPATH
Is the library path environment variable set correctly?

Linux: LD_LIBRARY_PATH
Windows: PATH
MacOSX: DYLD_LIBRARY_PATH
-

My exported paths, in the .bashrc file, are:

export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/bin

Grateful for hints on how to find out the reason and to solve the problem. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: hello from a very excited and totally blind python programmer and game player

2018-07-30 Thread Amirouche Boubekki
Le mar. 24 juil. 2018 à 22:10, Daniel Perry  a
écrit :

> Hi there everyone, my name is Daniel Perry


Hello!


> and I'm a totally blind new Python user.


Ok!


> I've only just recently started picking up python and playing with it and
> I intend on building some unique audio computer games for the blind.


That. Is. An. Adventure. If you plan on a multi touch experience I
recommend you look into #kivy and #python especially on freenode IRC
network.


> Such things mostly as simulation games like farming, building type games
> and even eventually a virtual world built completely with audio but
> building it in such a way that both we as totally blind colonists can live
> inside of it but also that our fully sighted counterparts could live here
> as well and not need any sort of guidance from the other group. That is,
> the blind would not need any help from our sighted counterparts and you in
> turn would not need any guidance from us as to how to live in the world or
> grow in it.


Well, that reads like an real adventure here. I've listening to books and
while it's different, you still enjoy the story, so maybe I can enjoy a
game made of sounds.


> Of course this virtual world idea is down the road, I've got other game
> ideas first of all but I would eventually like to get to the point I've
> just described above.


At some point, you might stop at the point where it pays the bills!


> Preferably building my own server on which to park not only my virtual
> world and games but also my web site that I would most likely need to put
> these items up to be downloaded.


I attach a small program that does render jinja2 templates and markdown, I
hope you like it.

>
> Also, When I opened up the first message that I had gotten from this list,
> I got a prompt hat popped up asking if I wanted to make windows live mail
> my default news client and I answered no. From that point on, I've been
> getting an error message and the message would not open. How must I fix
> this? or am I able to correct this situation. Have a wonderful day and I
> look forward to hearing from you soon.
>

 That's a nast3 behavior.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Chris Green
Akkana Peck  wrote:
> Chris Green writes:
> > I wrote a Python GUI program a little while ago that uses Python GTK
> > with:-
> > 
> > import gtk
> > 
> > I *think* this is probably GTK 2, or something.  I can't find the
> > proper documentation for this.  Is it old/obsolescent?
> 
> Yes, it's obsolete, and AFAIK it only works with Python 2, making
> it even more obsolete; but the documentation is at
> https://developer.gnome.org/pygtk/stable/
> 
> > I'm just starting to write another program now and I seem to be using
> > GTK 3 (maybe!) by doing:-
> > 
> > import gi
> > gi.require_version('Gtk', '3.0')
> > from gi.repository import Gtk
> > 
> > Is this the right/best place to be?
> 
> Yes, this is the future, since it lets you use both GTK3 and Python3.
> 
OK, thanks, where is its home and full API documentation etc.?

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


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Akkana Peck
Chris Green writes:
> I wrote a Python GUI program a little while ago that uses Python GTK
> with:-
> 
> import gtk
> 
> I *think* this is probably GTK 2, or something.  I can't find the
> proper documentation for this.  Is it old/obsolescent?

Yes, it's obsolete, and AFAIK it only works with Python 2, making
it even more obsolete; but the documentation is at
https://developer.gnome.org/pygtk/stable/

> I'm just starting to write another program now and I seem to be using
> GTK 3 (maybe!) by doing:-
> 
> import gi
> gi.require_version('Gtk', '3.0')
> from gi.repository import Gtk
> 
> Is this the right/best place to be?

Yes, this is the future, since it lets you use both GTK3 and Python3.

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


Re: How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Chris Green
Chris Green  wrote:
> I want to decide which is the 'best' Python GTK to use on my Linux
> (xubuntu) systems.  There seem to be quite a few versions of Python
> GTK bindings out there and I'm confused!  
> 
> I wrote a Python GUI program a little while ago that uses Python GTK
> with:-
> 
> import gtk
> 
> I *think* this is probably GTK 2, or something.  I can't find the
> proper documentation for this.  Is it old/obsolescent?
> 
> 
> I'm just starting to write another program now and I seem to be using
> GTK 3 (maybe!) by doing:-
> 
> import gi
> gi.require_version('Gtk', '3.0')
> from gi.repository import Gtk
> 
> Is this the right/best place to be?
> 
> 
> I know this is a bit of a "how long is a piece of string" question but
> some guidance would be very welcome.  The stuff I write is purely for
> my own use and will only ever run on Linux (mostly xubuntu but also
> some other Debian derived systems such as Rasbian and Debian on
> Beaglebone).
> 
Further to the above the following page:-

https://docs.python.org/3/library/othergui.html

Seems to muddy the water even further as the links don't *seem* to
take one to the places one would expect them to go to.  The PyGObject
link goes to https://wiki.gnome.org/Projects/PyGObject and the PyGtk
link goes to https://pygobject.readthedocs.io/en/latest/ which would
also appear to be pygobject.

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


How to decide (and know) which Python GTK version to use?

2018-07-30 Thread Chris Green
I want to decide which is the 'best' Python GTK to use on my Linux
(xubuntu) systems.  There seem to be quite a few versions of Python
GTK bindings out there and I'm confused!  

I wrote a Python GUI program a little while ago that uses Python GTK
with:-

import gtk

I *think* this is probably GTK 2, or something.  I can't find the
proper documentation for this.  Is it old/obsolescent?


I'm just starting to write another program now and I seem to be using
GTK 3 (maybe!) by doing:-

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

Is this the right/best place to be?


I know this is a bit of a "how long is a piece of string" question but
some guidance would be very welcome.  The stuff I write is purely for
my own use and will only ever run on Linux (mostly xubuntu but also
some other Debian derived systems such as Rasbian and Debian on
Beaglebone).

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


RE: Python bug in ArcGIS - Urban Network analysis tool

2018-07-30 Thread David Raymond
A note that Arc may have installed its own version of Python, which it is using 
from within its own tools. For example, I've got a full Python installation in 
C:\Python27\ArcGIS10.2 which Arc installed on top of a preexisting installation 
in C:\Python27. So you may need to explicitly run it with that version to get 
it to work and to import arcpy ok.

ie instead of just running...

pydevd.py

or...

python pydevd.py

You might need to explicitly do...

C:\Python27\ArcGIS10.2\python.exe pydevd.py

...or the equivalent of wherever it installed it on your system.


-Original Message-
From: Python-list 
[mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of 
? 
Sent: Monday, July 30, 2018 2:03 AM
To: python-list@python.org
Subject: Re: Python bug in ArcGIS - Urban Network analysis tool

понеделник, 30 юли 2018 г., 3:29:44 UTC+3, MRAB написа:
> On 2018-07-29 22:00, Станимира Николова wrote:
> > неделя, 29 юли 2018 г., 23:41:01 UTC+3, MRAB написа:
> >> On 2018-07-29 18:56, stanimira.s...@gmail.com wrote:
> >> > Hi there,
> >> > 
> >> > I'm trying make reach analyze with Urban network analysis (UNA) tool in 
> >> > ArcGIS. It's based on points for buildings and pedestrian network of 
> >> > acceptability steets. The aim is to show how many people from each 
> >> > building can reach different building in radius of 150 meters (so i can 
> >> > find the density of the pedestrian routes).
> >> > 
> >> > I run Urban network analysis but It shows similar mistake several times. 
> >> > The UNA tool is free plugin that i downloaded, it's not from the default 
> >> > intalled in ArcGIS packed. It ask for integer data.
> >> > I checked the type of the attributes, it's all integer. PLus it's all in 
> >> > geo data based file.
> >> > 
> >> > Unfortunately I don't understand Python, I'm one of those who use ArcGIS 
> >> > as sample customer.
> >> > 
> >> > This is the mistake:
> >> > 
> >> > Start Time: Fri Jul 27 14:48:32 2018
> >> > Running script Centrality...
> >> > [started] Copying input buildings
> >> > [finished]
> >> > [1 started] Computing adjacency list
> >> > [1 failed]
> >> > Not successful
> >> > Completed script Centrality...
> >> > Succeeded at Fri Jul 27 14:48:36 2018 (Elapsed Time: 4,56 seconds)
> >> > 
> >> > Any suggestions? How it's calling these adjaency list? What could be 
> >> > wrong? I even don't know how to get debugger, so it could give me more 
> >> > information.
> >> > 
> >> > Thank you previously,
> >> > Mira
> >> > 
> >> All you've shown is that says that it was unsuccessful, and it doesn't 
> >> say why.
> >> 
> >> We'd need a lot more info than that!
> >> 
> >> The best way to debug it is to try it with the minimal amount of test 
> >> data that should give a result.
> > 
> > I'm sorry.
> > Could someone help me by telling me how to make these test data? (so i 
> > could send it to You)
> > 
> > I realize the review of the bug is just the customer view. Any chance to 
> > help me out with the test of the process?
> > 
> > Thank you previously. If there is another forum that i have to write to, i 
> > will switch. The fact is that in the Themes for UNA tool or GIS software, 
> > almost no one respond.
> > 
> I'm unfamiliar with ArcGIS, so I doubt I could help.
> 
> It might have generated a log file somewhere that gives more details.

Ok, thank you for the patiance.
I installed PyCharm for trying make some tests. 

I add in a project the .py file for the adjacency list.

That's the main from the debuger:

pydev debugger: process 8904 is connecting

Connected to pydev debugger (build 182.3684.100)
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", 
line 1664, in 
main()
  File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", 
line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", 
line 1068, in run
pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files\JetBrains\PyCharm 
2018.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "D:/INSTALL/Urban Network Analysis Toolbox 
1.01/src/Centrality/Adjacency_List_Computation.py", line 14, in 
from arcpy import AddField_management
ModuleNotFoundError: No module named 'arcpy'

May I found the following lines from the code?
-- 
https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Why did logging not undergo PEP8 API change?

2018-07-30 Thread Skip Montanaro
In the run-up to Python 3, the threading module's API went from a
Java-reminiscent set of names to a PEP-9 set of names, so
threading.currentThread became threading.current_thread. Also (though
they didn't get a change in case), some of the set/get methods in
threading.Thread received the property treatment with admonition in
the module documentation to use the property style.

Why wasn't the logging package similarly updated? I imagine there
might have been some python-dev discussion about this, but have yet to
find anything. I found this thread here from 2009:

https://mail.python.org/pipermail/python-list/2009-April/thread.html#533823

There was some discussion of the idea (before the thread predictably
wandered off into the weeds). I've not found anything else obviously
related to the topic. Perhaps it was nothing more than that the
threading module had a PEP-8 champion while logging didn't?

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


Re: Python bug in ArcGIS - Urban Network analysis tool

2018-07-30 Thread Andrew MacIntyre



On 30/07/2018 4:02 PM, Станимира Николова wrote:


I run Urban network analysis but It shows similar mistake several times. The 
UNA tool is free plugin that i downloaded, it's not from the default intalled 
in ArcGIS packed. It ask for integer data.
I checked the type of the attributes, it's all integer. PLus it's all in geo 
data based file.

Unfortunately I don't understand Python, I'm one of those who use ArcGIS as 
sample customer.

This is the mistake:

Start Time: Fri Jul 27 14:48:32 2018
Running script Centrality...
[started] Copying input buildings
[finished]
[1 started] Computing adjacency list
[1 failed]
Not successful
Completed script Centrality...
Succeeded at Fri Jul 27 14:48:36 2018 (Elapsed Time: 4,56 seconds)

Any suggestions? How it's calling these adjaency list? What could be wrong? I 
even don't know how to get debugger, so it could give me more information.


If it's a third party plugin, contact the author or source.  This 
mailing list sees very little traffic about ArcGIS usage as it is a 
highly specialised commercial product.



I add in a project the .py file for the adjacency list.

That's the main from the debuger:

pydev debugger: process 8904 is connecting

Connected to pydev debugger (build 182.3684.100)
Traceback (most recent call last):
   File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", line 
1664, in 
 main()
   File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", 
line 1658, in main
 globals = debugger.run(setup['file'], None, None, is_module)
   File "C:\Program Files\JetBrains\PyCharm 2018.2\helpers\pydev\pydevd.py", 
line 1068, in run
 pydev_imports.execfile(file, globals, locals)  # execute the script
   File "C:\Program Files\JetBrains\PyCharm 
2018.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
 exec(compile(contents+"\n", file, 'exec'), glob, loc)
   File "D:/INSTALL/Urban Network Analysis Toolbox 
1.01/src/Centrality/Adjacency_List_Computation.py", line 14, in 
 from arcpy import AddField_management
ModuleNotFoundError: No module named 'arcpy'

May I found the following lines from the code?


Is it documented that the file you've attempted to run via PyCharm 
actually supports being run from outside ArcGIS?  Most plugins don't 
seem to be...  This failure is because PyCharm isn't starting the script 
with the necessary environment (including the arcpy ArcGIS Python 
module) accessible.


The fact that it starts running from within ArcGIS and produces some 
status messages before bailing out with the failure message strongly 
suggests to me that the plugin is working properly but the input given 
is not sufficient to produce the expected output.  In the absence of 
sufficient documentation for you to figure out the required input, my 
advice above stands: contact the author or the download source.


If you or your organisation has a current ArcGIS maintenance agreement, 
you might also be able to access the community forums that ESRI run to 
ask for more info about this plugin.


--
-
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: andy...@bullseye.apana.org.au  (pref) | Snail: PO Box 370
andy...@pcug.org.au (alt) |Belconnen ACT 2616
Web:http://www.andymac.org/   |Australia
--
https://mail.python.org/mailman/listinfo/python-list


Re: `import somemodule` does not check all paths in `sys.path`

2018-07-30 Thread stefand986
Note that in the `sys.path`variable the path is given as absolute path (I only 
wrote it relative to `~` in the in my post, but in the script the absolute path 
is used everywhere). See line 2:

  ``` 
  ['/home/pyuser/.homeassistant', 
   '/home/pyuser/.homeassistant/deps/lib/python3.7/site-packages',
   '/home/pyuser', 
   '/usr/local/lib/python37.zip', 
   '/usr/local/lib/python3.7', 
   '/usr/local/lib/python3.7/lib-dynload', 
   '/home/pyuser/.local/lib/python3.7/site-packages', 
   '/usr/local/lib/python3.7/site-packages'] 
  ``` 

Also by the time the import happens, the directory is existing. It is not 
existing from the beginning, but I also tried calling 
`importlib.invalidate_caches()` after installing the packages, which should 
force python to check the directories again.

Another interesting thing that I found out is that if I use the (now 
deprecated) `imp.find_module('sqlalchemy')` it returns the correct path. 
However if I do the same with `importlib.util.find_spec('sqlalchemy')`  the 
package is not found! (`importlib` is the suggested replacement for `imp`).

To me it really looks like a bug in `importlib`.



Am Montag, 30. Juli 2018 07:16:01 UTC+2 schrieb dieter:
> When I remember right:
> 
>  * Python silently ignores non existent directories in "sys.path"
>  * "~" is not automatically expanded into the home directory.
> 
> This would suggest, remplace "~/.homeassistent/..." by
> "/home/pyuser/.homeassistent/..." and try again.
-- 
https://mail.python.org/mailman/listinfo/python-list