Re: Instance vs Class variable oddity

2019-05-17 Thread dieter
Irv Kalb writes: > ... > The only thing that threw me was that in a line like: > > self.x = self.x + 1 > > in a method, these two uses of self.x can refer to different variables. I > actually teach Python, and this would be a very difficult thing to explain to > students. > > I have never run

Re: Import module from a different subdirectory

2019-05-17 Thread dieter
Rich Shepard writes: >> The project directory contains subdirectories, including gui/ (with the >> tkinter views) and classes/ with the SQLAlchemy model.py. > ... > Second, in ~/.bash_profile I added two lines, the first is the project's > root directory: > > PYTHONPATH=$HOME/development/bustrac >

Re: Instance vs Class variable oddity

2019-05-17 Thread jfong
Correct me if I am wrong, please. I always think that the LEGB rule (e.g. the namespace to look up for) was applied at compile-time, only the binding was resolved "dynamically" at run-time. For example: def foo(): print(x) foo() will cause a NameError. But after x = 5 foo() will run corr

Re: Instance vs Class variable oddity

2019-05-17 Thread Ethan Furman
On 05/17/2019 11:37 AM, Irv Kalb wrote: self.x = self.x + 1 I have never run across this issue because I would never use the same name as an instance attribute and a class attribute. So you treat your class attributes as if they were static? -- ~Ethan~ -- https://mail.python.org/mailman/lis

Re: Instance vs Class variable oddity

2019-05-17 Thread Chris Angelico
On Sat, May 18, 2019 at 4:40 AM Irv Kalb wrote: > > Thanks for your comments. I am very aware of all the other issues that you > explained. > > The only thing that threw me was that in a line like: > > self.x = self.x + 1 > > in a method, these two uses of self.x can refer to different variables

Re: Instance vs Class variable oddity

2019-05-17 Thread Irv Kalb
> On May 15, 2019, at 5:41 PM, Ben Finney wrote: > > Irv Kalb writes: > >> I just saw some code that confused me. The confusion has to do with >> class variables and instance variables. > > (Perhaps unrelated, but here's another confusion you may be suffering > from: There's no such thing as

Re: subscribe

2019-05-17 Thread Ethan Furman
You have been subscribed. Welcome to Python List! -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

subscribe

2019-05-17 Thread Matthias Weckbecker
-- https://mail.python.org/mailman/listinfo/python-list

Re: Import module from a different subdirectory

2019-05-17 Thread Rich Shepard
On Thu, 16 May 2019, Rich Shepard wrote: The project directory contains subdirectories, including gui/ (with the tkinter views) and classes/ with the SQLAlchemy model.py. Getting closer, but still missing a piece of the solution. First, I added __init__.py to each module subdirectory to speci

Re: Import module from a different subdirectory

2019-05-17 Thread Rich Shepard
On Fri, 17 May 2019, Inada Naoki wrote: This is slightly off topic (not relating to your problem), but please don't think "Python 3 doesn't require __init__.py for packages". It is common misunderstanding. Inada, Actually, your response is on topic and probably the reason I have the import pr

About: Python not recognizing command even after installed Python 3.7.3

2019-05-17 Thread Jpn Jha
Dear Team I have already installed python 3.7.3 64-bit in my window 8.1. I started learning Django using python. But after few days 4-5 days I found python not recognizing command. Could you please advise me. Is there any possibilities of Antivirous update and running for removing virous . Than

Re: repr = expression representation?

2019-05-17 Thread Ben Bacarisse
Christian Gollwitzer writes: > Am 17.05.19 um 06:13 schrieb Stefan Ram: However, look at this >> >> |>>> print( str( print )) >> | >> >> |>>> print( repr( print )) >> | >> >>. While it is nice that »str( print )« gives some useful >>information, I would expect »repr( print )« to give >>

Re: How to read barcoded value from PDF

2019-05-17 Thread damianleejob
在 2011年6月28日星期二 UTC+8下午5:30:21,Robin Becker写道: > On 28/06/2011 06:59, Asif Jamadar wrote: > > Hi, > > > ... > > > > In Reportlab I can do the following code to generate barcode and to get the > > value of that barcode > > > > > > > > > > barcode=code39.Extended39("123456789",barW

EuroPython 2019: Sponsor brochure available

2019-05-17 Thread M.-A. Lemburg
We are pleased to present our EuroPython 2019 Sponsor Brochure: * https://ep2019.europython.eu/sponsor/brochure/ * We have worked with our designer to compile all relevant information about the conference in a nice to read brochure, you can use to discuss a possible sponsorship in your

Re: repr = expression representation?

2019-05-17 Thread Christian Gollwitzer
Am 17.05.19 um 06:13 schrieb Stefan Ram: However, look at this |>>> print( str( print )) | |>>> print( repr( print )) | . While it is nice that »str( print )« gives some useful information, I would expect »repr( print )« to give »print« - This is impossible. Python does not use "