Re: ongoing browser projects

2018-07-23 Thread Thomas Jollans
On 23/07/18 03:43, Akkana Peck wrote: > There used to be a Python-WebKit-GTK2 library that was fairly easy > to use and even had documentation, but it's been orphaned for years, > and in any case a lot of the modern web no longer works with the old > WebKit engine. You'd think there would be someth

Re: ongoing browser projects

2018-07-23 Thread Thomas Jollans
On 23/07/18 09:00, Thomas Jollans wrote: > On 23/07/18 03:43, Akkana Peck wrote: >> There used to be a Python-WebKit-GTK2 library that was fairly easy >> to use and even had documentation, but it's been orphaned for years, >> and in any case a lot of the modern web no longer works with the old >> W

Re: import in code

2018-07-23 Thread Cameron Simpson
On 22Jul2018 15:38, Mark Lawrence wrote: On 22/07/18 05:45, Cameron Simpson wrote: Circular imports: 2 codependent modules. If you have:  module A:    import B  module B:    import B That won't work: the second import (whichever it turns out to be) will fail. One workaround is to make one of

Re: For next loops

2018-07-23 Thread Brian Oney via Python-list
What if ply != com in the first (0th) iteration?  It's better to have an 'else:'-statement in your case, I suppose. -- https://mail.python.org/mailman/listinfo/python-list

Re: coding style - where to declare variables

2018-07-23 Thread Gregory Ewing
Steven D'Aprano wrote: So let me see if I understand your argument... - we should stop using the term "binding", because it means nothing different from assignment; - binding (a.k.a. "assignment") comes from lambda calculus; - which has no assignment (a.k.a. "binding"). No, that's not what

Re: coding style - where to declare variables

2018-07-23 Thread Ben Finney
Gregory Ewing writes: > Marko is asking us to stop using the word "binding" to refer to > assignment because of the potential confusion with this other meaning. That's about as reasonable as my request that we stop using the term “variable” for what is, in Python, an un-typed reference to an obj

Re: coding style - where to declare variables

2018-07-23 Thread Marko Rauhamaa
Ben Finney : > Gregory Ewing writes: > >> Marko is asking us to stop using the word "binding" to refer to >> assignment because of the potential confusion with this other meaning. > > That's about as reasonable as my request that we stop using the term > “variable” for what is, in Python, an un-ty

Re: coding style - where to declare variables

2018-07-23 Thread Frank Millman
"Marko Rauhamaa" wrote in message news:87zhyitjz2@elektro.pacujo.net... People new to Python are unnecessarily confused by talking about names and binding when it's really just ordinary variables and assignment. It seems to be mostly some sort of marketing lingo that seeks to create an air

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 20:24:30 +1200, Gregory Ewing wrote: > Steven D'Aprano wrote: >> So let me see if I understand your argument... >> >> - we should stop using the term "binding", because it means >> nothing different from assignment; >> - binding (a.k.a. "assignment") comes from lambda calcul

Re: coding style - where to declare variables

2018-07-23 Thread Ben Bacarisse
Mark Lawrence writes: > On 22/07/18 14:51, Abdur-Rahmaan Janhangeer wrote: >> except local vars >> >> Abdur-Rahmaan Janhangeer >> https://github.com/Abdur-rahmaanJ >> Mauritius >> > > Python doesn't have variables, it has names. I think we should cut beginners (and probably everyone) some slack

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 11:49:37 +0300, Marko Rauhamaa wrote: > People new to Python are unnecessarily confused by talking about names > and binding when it's really just ordinary variables and assignment. It really isn't, not to those people who expect ordinary variables and assignment to be the sa

Re: coding style - where to declare variables

2018-07-23 Thread Marko Rauhamaa
Steven D'Aprano : > Lambda calculus has the concept of a binding operator, which is > effectively an assignment operator: it takes a variable and a value > and binds the value to the variable, changing a free variable to a > bound variable. In other words, it assigns the value to the variable, > j

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 09:22:55 +0300, Marko Rauhamaa wrote: > Dennis Lee Bieber : [...] >> In my world, Java and Python are the ones that are not "common". > > Yes, "boxed" is a Java term. However, the programming pattern of using > dynamic memory and pointers is ubiquitous and ancient: Not t

Re: coding style - where to declare variables

2018-07-23 Thread Chris Angelico
On Mon, Jul 23, 2018 at 9:39 PM, Steven D'Aprano wrote: > [1] The CPython interpreter uses pointers; the Jython interpreter uses > whatever kind of memory indirection the JVM provides; when I emulate a > Python interpreter using pencil and paper, there's not a pointer in sight > but a lot of copyi

Re: For next loops

2018-07-23 Thread Neil Cerutti
On 2018-07-23, no@none.invalid wrote: > never mind. > x = range (5) > y = range (5) > for ply in x: > > for com in y: > if ply==com: > result="Tie" > > print(ply,com,result) > result = "" Something like this is possible. "x", "y" and "result" can be unecess

Re: coding style - where to declare variables

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 14:39:56 +0300, Marko Rauhamaa wrote: > Steven D'Aprano : > >> Lambda calculus has the concept of a binding operator, which is >> effectively an assignment operator: it takes a variable and a value and >> binds the value to the variable, changing a free variable to a bound >>

Re: Non-GUI, single processort inter process massaging - how?

2018-07-23 Thread Anders Wegge Keller
På Sat, 21 Jul 2018 09:07:23 +0100 Chris Green skrev: > So - what's the best approach to this? I've done some searching and > most/many of the solutions seem rather heavyweight for my needs. Am I > overlooking something obvious or should I try rethinking the original > requirement and look for a

Python shuts down when I try to run a module

2018-07-23 Thread Lyra
Hello, I’ve just started to learn Python coding, and downloaded version 3.7.0 from the website.  I’ve written 5 or 6 small programs and saved them, but whenever I try to run them, Python doesn’t work right.  The user answers the first question and presses ENTER, but then the Python window just c

Re: Python shuts down when I try to run a module

2018-07-23 Thread Calvin Spealman
This is an unfortunate property of running command line programs on Windows. If you run the script directly (like by double clicking on it?) the console window will close when the program is done, so you can't see the final output. To get around this you could run them in the IDLE editor, which co

Re: list of lists

2018-07-23 Thread Sharan Basappa
On Sunday, 22 July 2018 21:07:17 UTC+5:30, Thomas Jollans wrote: > On 22/07/18 14:53, Sharan Basappa wrote: > > Thanks. I initially thought about this but did not know if this is legal > > syntax. > > In this kind of situation – you think you know how to do something but > you're not quite sure

Python in the news

2018-07-23 Thread Rich Shepard
The lead article in science section and technology section of this week's 'The Economist' is about Python: Enjoy, Rich -- https://mail.python.org/mailman/listinfo/pytho

Re: Python shuts down when I try to run a module

2018-07-23 Thread Neil Cerutti
On 2018-07-23, Calvin Spealman wrote: > This is an unfortunate property of running command line > programs on Windows. If you run the script directly (like by > double clicking on it?) the console window will close when the > program is done, so you can't see the final output. > > To get around th

Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-23 Thread Bartosz Golaszewski
Hi! A user recently reported a memory leak in python bindings (C extension module) to a C library[1] I wrote. I've been trying to fix it since but so far without success. Since I'm probably dealing with a space leak rather than actual memory leak, valgrind didn't help much even when using malloc a

Re: PyCharm

2018-07-23 Thread Michael Vilain
I used the pycharm edu version from here: https://www.jetbrains.com/pycharm-edu/download/download-thanks.html?platform=mac input works fine on it. YMMV. > On 20-Jul-2018, at 9:15 PM 🌙, no@none.invalid wrote: > > On Fri, 20 Jul 2018 20:56:41 -0700, Michael Vilain > wrote: > >> I'm running PyC

Want to be a rockstar programmer?

2018-07-23 Thread Larry Martell
https://github.com/dylanbeattie/rockstar -- https://mail.python.org/mailman/listinfo/python-list

Re: Want to be a rockstar programmer?

2018-07-23 Thread Brian Oney via Python-list
meh, I'm more into 90s and 00s metal rock and punk rock. Oh well, I knew it wasn't meant to be. ;) -- https://mail.python.org/mailman/listinfo/python-list

Re: Tracking a memory leak in C extension - interpreting the output of PYTHONMALLOCSTATS

2018-07-23 Thread Thomas Jollans
On 23/07/18 20:02, Bartosz Golaszewski wrote: > Hi! Hey! > A user recently reported a memory leak in python bindings (C extension > module) to a C library[1] I wrote. I've been trying to fix it since > but so far without success. Since I'm probably dealing with a space > leak rather than actual m

Re: Non-GUI, single processort inter process massaging - how?

2018-07-23 Thread Chris Green
Anders Wegge Keller wrote: > På Sat, 21 Jul 2018 09:07:23 +0100 > Chris Green skrev: > > > So - what's the best approach to this? I've done some searching and > > most/many of the solutions seem rather heavyweight for my needs. Am I > > overlooking something obvious or should I try rethinking t

Re: ongoing browser projects

2018-07-23 Thread Akkana Peck
> > On 23/07/18 03:43, Akkana Peck wrote: > >> You'd think there would be something newer (ideally > >> based on Blink) that worked with GTK3/GIO, but I never found anything. Thomas Jollans writes: > > This gi-based example looks like Gtk3, right? > > https://gist.github.com/kklimonda/890640#file

curses, ncurses or something else

2018-07-23 Thread John Pote
I recently wrote a command line app to take a stream of numbers, do some signal processing on them and display the results on the console. There may be several output columns of data so a title line is printed first. But the stream of numbers may be several hundred long and the title line disap

Python 2.7.14 and Python 3.6.0 netcdf4

2018-07-23 Thread jorge . conrado
Hi, Please someone can help me with this error message; for Python 2.7.14 I did: from netCDF4 import Dataset and I didn't have no message But, for Python 3.6.0 from netCDF4 import Dataset I had: Traceback (most recent call last): File

Re: Python shuts down when I try to run a module

2018-07-23 Thread Michael Torrie
On 07/23/2018 01:00 AM, Lyra wrote: > Hello, > I’ve just started to learn Python coding, and downloaded version 3.7.0 from > the website.  I’ve written 5 or 6 small programs and saved them, but whenever > I try to run them, Python doesn’t work right.  The user answers the first > question and pr

Re: curses, ncurses or something else

2018-07-23 Thread Rich Shepard
On Mon, 23 Jul 2018, John Pote wrote: So I thought it might be quick and easy to do something with curses to keep the title line visable while the numbers roll up the screen. But alas I'm a Windows user and the 'curses' module is not in the Windows standard library for Python. John, I don't

Re: curses, ncurses or something else

2018-07-23 Thread Dale Marvin via Python-list
On 7/23/18 3:24 PM, John Pote wrote: I recently wrote a command line app to take a stream of numbers, do some signal processing on them and display the results on the console. There may be several output columns of data so a title line is printed first. But the stream of numbers may be several

Re: curses, ncurses or something else

2018-07-23 Thread Thomas Jollans
On 24/07/18 00:24, John Pote wrote: > Ideas invited. This doesn't answer your question at all, but when I want a small script to produce largish streams of numbers, I write them to a (csv) file and plot them using matplotlib then and there. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 2.7.14 and Python 3.6.0 netcdf4

2018-07-23 Thread Thomas Jollans
On 24/07/18 00:39, jorge.conr...@cptec.inpe.br wrote: > from netCDF4 import Dataset > > I had: > > Traceback (most recent call last): > File "", line 1, in > ModuleNotFoundError: No module named 'netCDF4' > > > What can I do to solve this error for Python 3.6.0 I

Re: Python 2.7.14 and Python 3.6.0 netcdf4

2018-07-23 Thread Steven D'Aprano
On Mon, 23 Jul 2018 19:39:18 -0300, jorge.conrado wrote: > Traceback (most recent call last): > File "", line 1, in > ModuleNotFoundError: No module named 'netCDF4' > > > What can I do to solve this error for Python 3.6.0 Just because you have the Python 2.7 version of

Re: Python 2.7.14 and Python 3.6.0 netcdf4

2018-07-23 Thread MRAB
On 2018-07-23 23:39, jorge.conr...@cptec.inpe.br wrote: Hi, Please someone can help me with this error message; for Python 2.7.14 I did: from netCDF4 import Dataset and I didn't have no message That's because you've installed netCDF4 for Python 2.7.

Format list of list sub elements keeping structure.

2018-07-23 Thread Sayth Renshaw
I have data which is a list of lists of all the full paths in a json document. How can I change the format to be usable when selecting elements? data = [['glossary'], ['glossary', 'title'], ['glossary', 'GlossDiv'], ['glossary', 'GlossDiv', 'title'], ['glossary', 'GlossDiv', 'GlossList'], ['

Re: curses, ncurses or something else

2018-07-23 Thread eryk sun
On Mon, Jul 23, 2018 at 10:24 PM, John Pote wrote: > > So I thought it might be quick and easy to do something with curses to keep > the title line visable while the numbers roll up the screen. But alas I'm a > Windows user and the 'curses' module is not in the Windows standard library > for Pytho

Re: Format list of list sub elements keeping structure.

2018-07-23 Thread Sayth Renshaw
> > > > for item in data: > > for elem in item: > > out = ("[{0}]").format(elem) > > print(out) > > Hint: print implicitly adds a newline to the output string. So collect all > the values of each sublist and print a line-at-time to output, or use the > end= argument of Py3's p

Re: Format list of list sub elements keeping structure.

2018-07-23 Thread Sayth Renshaw
I am very close to the end result. I now have it as Output [ ['[glossary]'], ['[glossary]', '[title]'], ['[glossary]', '[GlossDiv]'], ['[glossary]', '[GlossDiv]', '[title]'], ['[glossary]', '[GlossDiv]', '[GlossList]'], ['[glossary]', '[GlossDiv]', '[GlossList]', '[GlossEntry

Re: Format list of list sub elements keeping structure.

2018-07-23 Thread Sayth Renshaw
On Tuesday, 24 July 2018 14:25:48 UTC+10, Rick Johnson wrote: > Sayth Renshaw wrote: > > > elements = [['[{0}]'.format(element) for element in elements]for elements > > in data] > > I would suggest you avoid list comprehensions until you master long-form > loops. My general issue is that I wa

Re: Format list of list sub elements keeping structure.

2018-07-23 Thread Sayth Renshaw
On Tuesday, 24 July 2018 14:25:48 UTC+10, Rick Johnson wrote: > Sayth Renshaw wrote: > > > elements = [['[{0}]'.format(element) for element in elements]for elements > > in data] > > I would suggest you avoid list comprehensions until you master long-form > loops. I actually have the answer ex