remove path forever

2017-09-06 Thread Andrej Viktorovich
Hello, I have 64 bit python on my windows 10 machine. Install contains 32 bit python libs in path and I would like to remove them. I do imprt sys sys.path.remove("C:\\Users\\me\\AppData\\Local\\Programs\\Python\\Python36-32") It works for current python instance, but paths appears in new one.

Re: print without ()

2017-09-06 Thread Glenn Hutchings
On Thursday, 7 September 2017 07:14:57 UTC+1, Andrej Viktorovich wrote: > Sometimes I find code with strange print function usage. String is passed > without brackets. > > #!/usr/bin/python > list = ['physics', 'chemistry', 1997, 2000]; > print "Value available at index 2 : " > print list[2] > l

Re: print without ()

2017-09-06 Thread Jan Erik Moström
On 7 Sep 2017, at 8:14, Andrej Viktorovich wrote: If I use command print "aaa" in console I get error. So, why this is allowed in sample? You're probably using Python 2 for the listed script and Python 3 when you try in the console. = jem -- https://mail.python.org/mailman/listinfo/python-l

print without ()

2017-09-06 Thread Andrej Viktorovich
Hello, Sometimes I find code with strange print function usage. String is passed without brackets. #!/usr/bin/python list = ['physics', 'chemistry', 1997, 2000]; print "Value available at index 2 : " print list[2] list[2] = 2001; print "New value available at index 2 : " print list[2] If I use

Re: Setting property for current class from property in an different class...

2017-09-06 Thread Christopher Reimer
> On Sep 6, 2017, at 9:14 PM, Stefan Ram wrote: > > I can run this (your code) without an error here (Python 3.6.0), > from a file named "Scraper1.py": I'll check tomorrow. I recently switched from 3.5.x to 3.6.1 in the PyCharm IDE. It's probably FUBAR in some obscure way. Thanks, Chris R.

Re: Setting property for current class from property in an different class...

2017-09-06 Thread Christopher Reimer via Python-list
On 9/6/2017 7:41 PM, Stefan Ram wrote: The following code runs here: Your code runs but that's not how I have mine code set up. Here's the revised code: class Requestor(object):     def __init__(self, user_id, user_name ):     self._page_start = -1     @property     def page_start(sel

Re: Hatch - A modern project, package, and virtual env manager

2017-09-06 Thread ofekmeister
Just released https://github.com/ofek/hatch#060 -- https://mail.python.org/mailman/listinfo/python-list

Setting property for current class from property in an different class...

2017-09-06 Thread Christopher Reimer via Python-list
Greetings, My web scraper program has a top-level class for managing the other classes. I went to set up a property for the top-level class that changes the corresponding property in a different class. class Scraper(object):     def __init__(self, user_id, user_name):     self.requestor

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Chris Angelico
On Thu, Sep 7, 2017 at 11:32 AM, Steve D'Aprano wrote: > On Thu, 7 Sep 2017 03:56 am, Chris Angelico wrote: > >> On Thu, Sep 7, 2017 at 3:53 AM, Rhodri James wrote: >>> On 06/09/17 18:16, Stefan Ram wrote: > [...] Whenever someone yells at me, »HTML is not a programming language!«,

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Steve D'Aprano
On Thu, 7 Sep 2017 03:56 am, Chris Angelico wrote: > On Thu, Sep 7, 2017 at 3:53 AM, Rhodri James wrote: >> On 06/09/17 18:16, Stefan Ram wrote: [...] >>>Whenever someone yells at me, »HTML is not a programming language!«, >>>I show them the interactive tic-tac-toe by Flo Kreidler, writte

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Steve D'Aprano
On Thu, 7 Sep 2017 01:31 am, Ian Kelly wrote: > On Wed, Sep 6, 2017 at 1:37 AM, Marko Rauhamaa wrote: >> >> Which reminds me of this puzzle I saw a couple of days ago: >> >>1 + 4 = 5 >>2 + 5 = 12 >>3 + 6 = 21 >>8 + 11 = ? >> >> A mathematician immediately comes up with a "wrong" a

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Steve D'Aprano
On Thu, 7 Sep 2017 12:11 am, Antoon Pardon wrote: [...] > No it would not translate to the above diagram. It would translate to my > diagram. All variables in pascal refer to some object (in memory), they don't > refer to other variables. If you have a pointer variable, you have a variable > that

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Steve D'Aprano
On Wed, 6 Sep 2017 11:08 pm, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:59:17 PM UTC+5:30, nopsidy wrote: >> https://www.youtube.com/watch?v= [...] >> Thank you, >> -Alex Goretoy >> [...] Please don't quote nopsidy's spam. He is spamming the list with multiple links to the same v

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Steve D'Aprano
On Wed, 6 Sep 2017 11:02 pm, Stefan Ram wrote: > Chris Angelico writes: >>The 'is' operator tests if two things are the same thing. > > »Roughly speaking, to say of two things that they are > identical is nonsense, and to say of one thing that it > is identical with itself is t

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Steve D'Aprano
On Wed, 6 Sep 2017 10:11 pm, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote: >> On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: >> >> >> > Can you explain what "id" and "is" without talking of memory? >> >> Yes. >> >> id() returns an abstract

Python 3.3.7rc1 now available prior to Python 3.3 end-of-life

2017-09-06 Thread Ned Deily
On behalf of the Python development community and the Python 3.3 release teams, I would like to announce the availability of Python 3.3.7rc1, the release candidate of Python 3.3.7. It is a security-fix source-only release. Python 3.3.0 was released 5 years ago on 2012-09-29 and has been in sec

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Terry Reedy
On 9/6/2017 12:30 PM, Chris Angelico wrote: On Thu, Sep 7, 2017 at 2:17 AM, MRAB wrote: On 2017-09-06 14:00, Chris Angelico wrote: I'm not 100% sure, but I think that having two different versions of CPython X.Y isn't supported on Windows. I have both 64-bit and 32-bit Python 3.6 installed

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Ben Bacarisse
Rustom Mody writes: > I posted it because I genuinely thought I had missed some obvious way > of splitting a set into an (arbitrary) element and a rest without > jumping through hoops. Evidently not Curious, because I posted because I thought you had. Anyway, for speed you probably just want

Re: execfile and import not working

2017-09-06 Thread Friedrich Rentsch
On 06.09.2017 10:55, Thomas Jollans wrote: On 2017-09-06 10:14, Friedrich Rentsch wrote: Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a thorough one, leaving no survivors. Everything is fine, IDLE opens, ready to go. Alas, execfile and import commands don't do my bidding, b

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Ben Bacarisse
Gregory Ewing writes: > Seems to me you're making life difficult for yourself (and > very inefficient) by insisting on doing the whole computation > with sets. If you want a set as a result, it's easy enough > to construct one from the list at the end. Yes, but my intent was to show that the pat

Re: Run python module from console

2017-09-06 Thread Thomas Jollans
On 05/09/17 17:14, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > The runpy module can help you do this. https://docs.python.o

Re: a Boulder Dash clone with retro graphics and sound

2017-09-06 Thread Irmen de Jong
On 05/09/2017 00:02, Irmen de Jong wrote: https://github.com/irmen/bouldercaves > There's just two things missing I think: > - high score table > - being able to play multiple sounds simultaneously, as the amoeba and > magic wall sounds are lacking at the moment. In version 1.2 sound mixing is i

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2017-09-06 Thread geojitmailus
On Saturday, June 1, 2013 at 9:14:36 PM UTC+5:30, Νικόλαος Κούρας wrote: > /home/nikos/public_html/cgi-bin/metrites.py in () > 217 template = htmldata + counter > 218 elif page.endswith('.py'): > => 219 htmldata = subprocess.check_output( > '/home/n

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Chris Angelico
On Thu, Sep 7, 2017 at 3:53 AM, Rhodri James wrote: > On 06/09/17 18:16, Stefan Ram wrote: >> >> Dennis Lee Bieber writes: >>> >>> Not to mention there are four rotations of the board, along with >>> reflections... One could, internally, keep track of the rotation needed >>> to >>> normal

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Rhodri James
On 06/09/17 18:16, Stefan Ram wrote: Dennis Lee Bieber writes: Not to mention there are four rotations of the board, along with reflections... One could, internally, keep track of the rotation needed to normalize the first moves (eg: if a corner was the first move, rotate the board as n

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Tony van der Hoff
On 06/09/17 16:31, Ian Kelly wrote: > On Wed, Sep 6, 2017 at 1:37 AM, Marko Rauhamaa wrote: >> Which reminds me of this puzzle I saw a couple of days ago: >> >>1 + 4 = 5 >>2 + 5 = 12 >>3 + 6 = 21 >>8 + 11 = ? >> >> A mathematician immediately comes up with a "wrong" answer. > There

Re: A question on modification of a list via a function invocation

2017-09-06 Thread breamoreboy
On Wednesday, September 6, 2017 at 1:12:22 PM UTC+1, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote: > > On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: > > > > > > > Can you explain what "id" and "is" without talking of memory? > > > > Yes. > >

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Ian Kelly
On Tue, Sep 5, 2017 at 6:15 PM, Stefan Ram wrote: > Ian Kelly writes: >>Usually I've seen Tic Tac Toe implemented using the Minimax algorithm >>since the decision tree for Tic Tac Toe is quite shallow. > > This thread made me want to write a tic-tac-toe game. > > I am naïve in this field. I d

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread breamoreboy
On Wednesday, September 6, 2017 at 2:42:06 PM UTC+1, Andrej Viktorovich wrote: > Found that pythons have different paths. It might be related? Definitely :) > > 64 bit > > C:\Users\me\AppData\Local\Programs\Python\Python36-32 > C:\Users\me\AppData\Local\Programs\Python\Python36-32\DLLs > C:\Use

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Antoon Pardon
On 06-09-17 15:14, Stefan Ram wrote: > Steve D'Aprano writes: >> or any of the other things we can do in a language with references-as-values, >> like C or Pascal. > > I have always taken the stance that one has to use the words > as the language specification of the language one talks > ab

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Chris Angelico
On Thu, Sep 7, 2017 at 2:17 AM, MRAB wrote: > On 2017-09-06 14:00, Chris Angelico wrote: >> >> On Wed, Sep 6, 2017 at 10:41 PM, Andrej Viktorovich >> wrote: >>> >>> Hello, >>> >>> I have 32Bit and 64Bit installations on my Windows 10 machine. I do >>> import importlib in both of them. >>> >>> 32b

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread MRAB
On 2017-09-06 14:00, Chris Angelico wrote: On Wed, Sep 6, 2017 at 10:41 PM, Andrej Viktorovich wrote: Hello, I have 32Bit and 64Bit installations on my Windows 10 machine. I do import importlib in both of them. 32bit works fine while 64bit prints error: import importlib Traceback (most re

tool interface in Python

2017-09-06 Thread Xiang Zhang
Is there any project in Python about tool interface? In Java, it gets JVMTI which allows users easily build tools upon it. For example, for an APM framework, it allows you use Java agent to dynamically trace functions in your application. And you don't have to modify or restart your application

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:41 PM, Andrej Viktorovich wrote: > Hello, > > I have 32Bit and 64Bit installations on my Windows 10 machine. I do import > importlib in both of them. > > 32bit works fine while 64bit prints error: > import importlib > Traceback (most recent call last): > File "",

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Ian Kelly
On Wed, Sep 6, 2017 at 1:37 AM, Marko Rauhamaa wrote: > > Which reminds me of this puzzle I saw a couple of days ago: > >1 + 4 = 5 >2 + 5 = 12 >3 + 6 = 21 >8 + 11 = ? > > A mathematician immediately comes up with a "wrong" answer. There are no "wrong" answers with these kinds of p

ANN: Wing Python IDE 6.0.7 released

2017-09-06 Thread Wingware
Hi, We've just released Wing 6.0.7, a minor release that further improves and documents remote development, adds default file encoding to remote host configuration, supports syntax highlighting for .json files, and makes about 30 other minor improvements. For details, see https://wingware.co

non-standard glibc location

2017-09-06 Thread Fetchinson . via Python-list
Hi folks, I'm trying to install a binary package (tensorflow) which contains some binary C extensions. Now my system glibc is 2.15 but the binaries in the C extensions were created (apparently) with glibc 2.17. So I thought no problemo I installed glibc 2.17 to a custom location, built python2.7 f

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Antoon Pardon
Op 06-09-17 om 14:58 schreef Steve D'Aprano: > On Wed, 6 Sep 2017 05:12 pm, Antoon Pardon wrote: > > [...] >>> I'm not saying that we should never use this model. Its a good model. But we >>> should be clear that it is a model of the implementation, and it describes >>> entities which are not part

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rhodri James
On 06/09/17 14:02, Stefan Ram wrote: Chris Angelico writes: The 'is' operator tests if two things are the same thing. »Roughly speaking, to say of two things that they are identical is nonsense, and to say of one thing that it is identical with itself is to say nothing at

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 11:02 PM, Stefan Ram wrote: > Chris Angelico writes: >>The 'is' operator tests if two things are the same thing. > > »Roughly speaking, to say of two things that they are > identical is nonsense, and to say of one thing that it > is identical with itself i

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Andrej Viktorovich
Found that pythons have different paths. It might be related? 64 bit C:\Users\me\AppData\Local\Programs\Python\Python36-32 C:\Users\me\AppData\Local\Programs\Python\Python36-32\DLLs C:\Users\me\AppData\Local\Programs\Python\Python36-32\Lib C:\Program Files\Python36\python36.zip C:\Program Files\P

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 5:59:17 PM UTC+5:30, nopsidy wrote: > https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1 > Thank you, > -Alex Goretoy > http://launchpad.net/~a1g You (Alex) are top-posting. I am not fussy. But others here can be In any ca

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Steve D'Aprano
On Wed, 6 Sep 2017 05:12 pm, Antoon Pardon wrote: [...] >> I'm not saying that we should never use this model. Its a good model. But we >> should be clear that it is a model of the implementation, and it describes >> entities which are not part of the Python language. We cannot do this: >> >> >>

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:44 PM, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:48:48 PM UTC+5:30, Chris Angelico wrote: >> On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: >> a = (1,2) >> b = (1,2) >> a is b >> > False >> x = 1 >> y = 1 >> x is y >> >

No importlib in Python 3 64 bit ?

2017-09-06 Thread Andrej Viktorovich
Hello, I have 32Bit and 64Bit installations on my Windows 10 machine. I do import importlib in both of them. 32bit works fine while 64bit prints error: >>> import importlib Traceback (most recent call last): File "", line 1, in File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 5:48:48 PM UTC+5:30, Chris Angelico wrote: > On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: > > On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano > > wrote: > >> On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: > >> > >> > >> > Can you e

Re: Using __init__.py

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1 Thank you, -Alex Goretoy http://launchpad.net/~a1g On Wed, Sep 6, 2017 at 6:42 PM, Steve D'Aprano wrote: > On Wed, 6 Sep 2017 07:30 pm, Kryptxy wrote: > >> I am working on a (cross-platform) project. On l

Re: execfile and import not working

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1 On Wed, Sep 6, 2017 at 6:57 PM, Stefan Ram wrote: > Friedrich Rentsch writes: >>ready to go. Alas, execfile and import commands don't do my bidding, but >>hang IDLE. All I can do is kill the process name

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 4:03:40 PM UTC+5:30, ROGER GRAYDON CHRISTMAN wrote: > On 5 Sep 2017 14:28:44, (Dennis Lee Bier) wrote: > > On 5 Sep 2017 17:57:18 GMT, > >> But what does "a C++ reference" refer to? > >> > > > Per Stroustrup (The C++ Programming Language 4th Ed, page 189) >

Re: A question on modification of a list via a function invocation

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1 Thank you, -Alex Goretoy http://launchpad.net/~a1g On Wed, Sep 6, 2017 at 7:18 PM, Chris Angelico wrote: > On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: >> On Wednesday, September 6, 2017 at 5:08:2

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1 Thank you, -Alex Goretoy http://launchpad.net/~a1g On Wed, Sep 6, 2017 at 7:22 PM, Stefan Ram wrote: > Rustom Mody writes: >>Because the abstract idea of a permutation is a list (sequence) > > Traditio

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote: >> On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: >> >> >> > Can you explain what "id" and "is" without talking of memory? >> >> Yes. >> >> id() returns an abstract

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote: > On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: > > > > Can you explain what "id" and "is" without talking of memory? > > Yes. > > id() returns an abstract ID number which is guaranteed to be an integer, and > guara

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 4:29:56 PM UTC+5:30, Gregory Ewing wrote: > Seems to me you're making life difficult for yourself (and > very inefficient) by insisting on doing the whole computation > with sets. If you want a set as a result, it's easy enough > to construct one from the list at

Re: execfile and import not working

2017-09-06 Thread Peter Otten
Friedrich Rentsch wrote: > > > On 06.09.2017 10:52, Peter Otten wrote: >> Friedrich Rentsch wrote: >> >>> Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a >>> thorough one, leaving no survivors. Everything is fine, IDLE opens, >>> ready to go. Alas, execfile and import commands

Re: Using __init__.py

2017-09-06 Thread Steve D'Aprano
On Wed, 6 Sep 2017 07:30 pm, Kryptxy wrote: > I am working on a (cross-platform) project. On linux system, the imprts work > fine, but in windows I get imort error (I have no idea why. I tried searching > everywhere, but couldn't get it to work). Anyways, the issue seem to be > resolved by adding

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Steve D'Aprano
On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: > Can you explain what "id" and "is" without talking of memory? Yes. id() returns an abstract ID number which is guaranteed to be an integer, and guaranteed to be distinct for all objects which exist at the same time. When an object ceases to exis

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Gregory Ewing
Seems to me you're making life difficult for yourself (and very inefficient) by insisting on doing the whole computation with sets. If you want a set as a result, it's easy enough to construct one from the list at the end. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Gregory Ewing
Steven D'Aprano wrote: Not in standard Pascal, but most actual Pascal compilers let you perform pointer arithmetic. Well, sort of. In the ones I've seen, it's more like being able to cast a pointer to an integer, do arithmetic on that and then cast it back. The results are about as implementati

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Gregory Ewing
Steven D'Aprano wrote: But many (perhaps even most) people have no problem dealing with location as a metaphor, where being in two places (metaphorically) is no problem at all: - I am in love, in trouble and in denial all at once. Sometimes the word "in" implies physical location, sometimes

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rhodri James
On 05/09/17 23:29, Grant Edwards wrote: On 2017-09-05, Marko Rauhamaa wrote: Pointer arithmetics is not an essential part of C. One could argue that it was a mistake to include it in the language. One may argue that it was a mistake, but I remember at least one implementation where pointer ar

Re: A question on modification of a list via a function invocation

2017-09-06 Thread ROGER GRAYDON CHRISTMAN
On 5 Sep 2017 14:28:44, wlfr...@ix.netcom.com (Dennis Lee Bier) wrote: > On 5 Sep 2017 17:57:18 GMT, https://webmail.psu.edu/webmail/retrieve.cgi?mailbox=inbox&start_num=14200&limit=50&sort=0&display=4×tamp=20170906045729&mid=mailman%2e%2e1504662834%2e2732%2epython%2dlist%40python%2eorg#";>r.

Re: execfile and import not working

2017-09-06 Thread Friedrich Rentsch
On 06.09.2017 10:52, Peter Otten wrote: Friedrich Rentsch wrote: Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a thorough one, leaving no survivors. Everything is fine, IDLE opens, ready to go. Alas, execfile and import commands don't do my bidding, but hang IDLE. All I can

Re: execfile and import not working

2017-09-06 Thread Thomas Jollans
On 2017-09-06 10:14, Friedrich Rentsch wrote: > Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a > thorough one, leaving no survivors. Everything is fine, IDLE opens, > ready to go. Alas, execfile and import commands don't do my bidding, but > hang IDLE. All I can do is kill the p

Using __init__.py

2017-09-06 Thread Kryptxy via Python-list
I am working on a (cross-platform) project. On linux system, the imprts work fine, but in windows I get imort error (I have no idea why. I tried searching everywhere, but couldn't get it to work). Anyways, the issue seem to be resolved by adding project directory to sys.path(). I wanted to know

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 7:13 PM, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 12:51:25 PM UTC+5:30, Gregory Ewing wrote: >> Rustom Mody wrote: >> > 2. is — machine representation, too fine to be useful >> >> Disagree - "is" in Python has an abstract definition that >> doesn't depend on m

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 7:01 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> You can't do this with Python, since pointer arithmetic fundamentally >> doesn't exist. > > > Pointer arithmetic doesn't exist in Pascal either, yet > Pascal most definitely has pointers as a distinct data > type. >

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Rustom Mody
On Wednesday, September 6, 2017 at 12:51:25 PM UTC+5:30, Gregory Ewing wrote: > Rustom Mody wrote: > > 2. is — machine representation, too fine to be useful > > Disagree - "is" in Python has an abstract definition that > doesn't depend on machine representation. > > -- > Greg There is this (AFA

Re: cant't use package internals

2017-09-06 Thread Peter Otten
Andrej Viktorovich wrote: > Hello, > > I have Python package tst in my workspace. > > tst has files: > __init__.py > tst.py > > > content of __init__.py: > print("importing Tst") > > > content of tst.py: > class Tst: > def __init__(self): > print("init Tst") > > > I run python

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Gregory Ewing
Chris Angelico wrote: You can't do this with Python, since pointer arithmetic fundamentally doesn't exist. Pointer arithmetic doesn't exist in Pascal either, yet Pascal most definitely has pointers as a distinct data type. Insisting that only pointer arithmetic counts as "manipulating" pointer

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Gregory Ewing
Steve D'Aprano wrote: No, they aren't first-class. Maybe not fully, but you can do a lot more with them than you can in Pascal or Modula-2. - Containers of references are not allowed. You can't have arrays of references, but struct and class members can be references, so you can certainly b

Re: execfile and import not working

2017-09-06 Thread Peter Otten
Friedrich Rentsch wrote: > Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a > thorough one, leaving no survivors. Everything is fine, IDLE opens, > ready to go. Alas, execfile and import commands don't do my bidding, but > hang IDLE. All I can do is kill the process named "python

cant't use package internals

2017-09-06 Thread Andrej Viktorovich
Hello, I have Python package tst in my workspace. tst has files: __init__.py tst.py content of __init__.py: print("importing Tst") content of tst.py: class Tst: def __init__(self): print("init Tst") I run python console in workspace directory. I do >>>import tst Run without erro

execfile and import not working

2017-09-06 Thread Friedrich Rentsch
Hi, I am setting up Python 2.7 after an upgrade to Ubuntu 16.04, a thorough one, leaving no survivors. Everything is fine, IDLE opens, ready to go. Alas, execfile and import commands don't do my bidding, but hang IDLE. All I can do is kill the process named "python" from a bash terminal. IDLE t

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread Marko Rauhamaa
Ben Finney : > r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> In mathematics, every author is free to give his own definitions to >> concepts and create his own notation. > > [...] > > For established terms in the field, an author has freedom to redefine > those terms only to the extent tha

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Gregory Ewing
Rustom Mody wrote: 2. is — machine representation, too fine to be useful Disagree - "is" in Python has an abstract definition that doesn't depend on machine representation. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: A question on modification of a list via a function invocation

2017-09-06 Thread Antoon Pardon
Op 04-09-17 om 17:43 schreef Steve D'Aprano: > On Tue, 5 Sep 2017 01:17 am, Rustom Mody wrote: > >> Anton gave a picture explaining why/how references are needed and to be >> understood > Antoon gave a picture demonstrating one model of Python's semantics. > > It's a nice model that has a lot going