Re: I have anaconda, but Pycharm can't find it

2017-11-26 Thread Miki Tebeka
You need to set the Python interpreter for the project to be the Anaconda one. See https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html On Monday, November 27, 2017 at 1:56:58 AM UTC+2, C W wrote: > Hello all, > > I am a first time PyCharm user. I have Python 3 and Anaconda

Re: connect four (game)

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 3:04 PM, Rustom Mody wrote: >> Aviators have pinned down the best solution to this, I think. A pilot >> is not expected to be perfect; he is expected to follow checklists. A >> preflight checklist. A departure checklist. A landing checklist. >> Everything that needs to be d

Re: connect four (game)

2017-11-26 Thread Rustom Mody
On Monday, November 27, 2017 at 9:08:42 AM UTC+5:30, Chris Angelico wrote: > On Mon, Nov 27, 2017 at 1:55 PM, Michael Torrie wrote: > > On 11/26/2017 07:11 AM, bartc wrote: > >>> You may argue that testing doesn't matter for his small game, written > >>> for his own education and amusement. The f

Re: connect four (game)

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 1:55 PM, Michael Torrie wrote: > On 11/26/2017 07:11 AM, bartc wrote: >>> You may argue that testing doesn't matter for his small game, written >>> for his own education and amusement. The fact is that software in >>> general is of abysmal quality across the boards, and pr

Re: connect four (game)

2017-11-26 Thread Michael Torrie
On 11/25/2017 12:58 PM, namenobodywa...@gmail.com wrote: > the idea is that there should be exactly one object posinf (positive > infinity) that compares as strictly greater than any number ever considered, > and exactly one object neginf that compares as strictly less; as the code > stands now

Re: connect four (game)

2017-11-26 Thread Michael Torrie
On 11/26/2017 08:39 AM, bartc wrote: > The problem was traced to two lines that were in the wrong order (in the > original program). I can't see how unit tests can have helped in any way > at all, and it would probably have taken much longer. What makes you think that? Surely other decoders wer

Re: connect four (game)

2017-11-26 Thread Michael Torrie
On 11/26/2017 07:11 AM, bartc wrote: >> You may argue that testing doesn't matter for his small game, written >> for his own education and amusement. The fact is that software in >> general is of abysmal quality across the boards, and promoting a habit >> of unit testing is good, even for trivial,

Re: [META] Why are duplicate posts coming through?

2017-11-26 Thread Rustom Mody
On Monday, November 27, 2017 at 5:35:09 AM UTC+5:30, Skip Montanaro wrote: > Chris, > > Please forward one or two to me. Mark Sapiro and I have been banging on the > SpamBayes instance which supports the Usenet gateway. I suppose it's > possible some change caused the problem you're seeing. > > S

Re: nospam ** infinity?

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 12:14 PM, Skip Montanaro wrote: >> There seems to be a gateway loop of some sort going on. >> I'm seeing multiple versions of the same posts in >> comp.lang.python with different numbers of "nospam"s >> prepended to the email address. > > This is the second thread about thi

Re: nospam ** infinity?

2017-11-26 Thread Skip Montanaro
> There seems to be a gateway loop of some sort going on. > I'm seeing multiple versions of the same posts in > comp.lang.python with different numbers of "nospam"s > prepended to the email address. This is the second thread about this. I was thinking it might be related to recent changes to the g

Re: [META] Why are duplicate posts coming through?

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 11:04 AM, Skip Montanaro wrote: > Chris, > > Please forward one or two to me. Mark Sapiro and I have been banging on the > SpamBayes instance which supports the Usenet gateway. I suppose it's > possible some change caused the problem you're seeing. > > Skip Sent a couple t

Re: Pros and cons of Python sources?

2017-11-26 Thread Cameron Simpson
On 26Nov2017 10:00, nospam.Martin Schöön wrote: Den 2017-11-26 skrev Cameron Simpson : On 25Nov2017 08:34, rusi wrote: On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote: The problem with mixing repository-installed packages with pip-installed packages is that there'

Re: [META] Why are duplicate posts coming through?

2017-11-26 Thread Skip Montanaro
Chris, Please forward one or two to me. Mark Sapiro and I have been banging on the SpamBayes instance which supports the Usenet gateway. I suppose it's possible some change caused the problem you're seeing. Skip On Nov 26, 2017 5:22 PM, "Chris Angelico" wrote: Not sure whether this is an issue

nospam ** infinity?

2017-11-26 Thread Gregory Ewing
There seems to be a gateway loop of some sort going on. I'm seeing multiple versions of the same posts in comp.lang.python with different numbers of "nospam"s prepended to the email address. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

I have anaconda, but Pycharm can't find it

2017-11-26 Thread C W
Hello all, I am a first time PyCharm user. I have Python 3 and Anaconda installed. They work together on Sublime Text, but not on Pycharm. Pycharm tells me it cannot find modules numpy, matplotlib, etc. What should I do? I tried to set the interpreter environment, and a few other options, none s

Merits of otherwise of test-first (Re: connect four (game))

2017-11-26 Thread Gregory Ewing
bartc wrote: Testing everything comprehensively just wouldn't be useful for me who works on whole applications, whole concepts, not just a handful of functions with well-defined inputs and outputs. I had this experience with Pyrex (the precursor to Cython). The various parts are so interdepend

[META] Why are duplicate posts coming through?

2017-11-26 Thread Chris Angelico
Not sure whether this is an issue for -owner or not; apologies if not. I'm seeing a whole lot of reasonably-recent posts getting re-sent, with "nospam" attached to the posters' names. And they're getting re-sent multiple times. Sometimes the posts have encoding problems (small amounts of mojibake)

Re: connect four (game)

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 10:08 AM, Gregory Ewing wrote: > Chris Angelico wrote: > >> On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: > >> >>> >>> If I had to bother with such systematic tests as you suggest, and finish >>> and >>> sign off everything before proceeding further, then nothing would eve

Re: connect four (game)

2017-11-26 Thread Gregory Ewing
Chris Angelico wrote: On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: > If I had to bother with such systematic tests as you suggest, and finish and sign off everything before proceeding further, then nothing would ever get done. (Maybe it's viable if working from an exacting specification that

Re: connect four (game)

2017-11-26 Thread Gregory Ewing
bartc wrote: (Maybe it's viable if working from an exacting specification that someone else has already worked out.) In my experience, for anything non-trivial that hasn't been done before, these "exacting specifications" never exist. Even if someone handles wnat they *think* are exact and comp

Re: Stopping an iterator and continuing later

2017-11-26 Thread Gregory Ewing
november nihal wrote: I should have added I switch off the machine when I stop. ( I dont have options to keep it in a sleep mode or in hibernation ) The iterator returned by itertools.combinations is pickleable: >>> from pickle import dumps, loads >>> from itertools import combinations >>> c

Re: connect four (game)

2017-11-26 Thread nospam . nospam . bartc
On 26/11/2017 14:23, Chris Angelico wrote: > On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: >> The way I write code isn't incrementally top down or bottom up. It's >> backwards and forwards. Feedback from different parts means the thing >> develops as a whole. Sometimes parts are split into distinc

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . nospam . bartc
On 26/11/2017 09:09, Greg Tibbet wrote: > > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectanges, ellipses, etc...) and s

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . nospam . Wanderer
On Sunday, November 26, 2017 at 4:10:12 AM UTC-5, Greg Tibbet wrote: > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectang

Re: connect four (game)

2017-11-26 Thread nospam . nospam . bartc
On 25/11/2017 23:49, Terry Reedy wrote: > On 11/25/2017 4:57 PM, namenobodywa...@gmail.com wrote: >> On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: >> >>> I did, and it looks buggy to me.â The top and left frame lines are >>> missing.â If I click a square, the bottom squa

Re: connect four (game)

2017-11-26 Thread nospam . nospam . bartc
On 25/11/2017 16:07, Michael Torrie wrote: > On 11/25/2017 06:00 AM, bartc wrote: >> And there's a quite lot left of the rest of the program to worry about too! >> >> If you add 'window()' at the end of the program, then it seems to run on >> Python 3. I'd play around with it first before thinking

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Rustom Mody
On Sunday, November 26, 2017 at 3:43:29 AM UTC+5:30, Chris Angelico wrote: > On Sun, Nov 26, 2017 at 9:05 AM, wojtek.mula wrote: > > Hi, my goal is to obtain an interpreter that internally > > uses UCS-2. Such a simple code should print 65535: > > > > import sys > > print sys.maxunicode > > >

Re: Stopping an iterator and continuing later (Posting On Python-List P

2017-11-26 Thread november nihal
On Saturday, 25 November 2017 20:59:02 UTC, Lawrence Dâ ÖOliveiro wrote: > On Sunday, November 26, 2017 at 6:43:05 AM UTC+13, novembe...@gmail.com wrote: > > I worked out how to use iterators to generate values one at a time > > then ran into a second problem which is time. Is it possible to > > s

Re: Stopping an iterator and continuing later

2017-11-26 Thread Stefan Ram
r...@zedat.fu-berlin.de (Stefan Ram) writes: >Then you can use pickle or custom methods to save and >restore the object, or get the state from an iterator >and create a new iterator with that state later. One does not always have to write a custom class, for example: main.py import pickle

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Ned Batchelder
On 11/25/17 5:05 PM, wojtek.m...@gmail.com wrote: > Hi, my goal is to obtain an interpreter that internally > uses UCS-2. Such a simple code should print 65535: > >import sys >print sys.maxunicode > > This is enabled in Windows, but I want the same in Linux. > What options have I pass to th

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Terry Reedy
On 11/25/2017 5:12 PM, Chris Angelico wrote: > On Sun, Nov 26, 2017 at 9:05 AM, wrote: >> Hi, my goal is to obtain an interpreter that internally >> uses UCS-2. Such a simple code should print 65535: >> >>import sys >>print sys.maxunicode >> >> This is enabled in Windows, but I want the s

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Chris Angelico
On Sun, Nov 26, 2017 at 10:59 AM, Terry Reedy wrote: > On 11/25/2017 5:12 PM, Chris Angelico wrote: >> >> On Sun, Nov 26, 2017 at 9:05 AM, wrote: >>> >>> Hi, my goal is to obtain an interpreter that internally >>> uses UCS-2. Such a simple code should print 65535: >>> >>>import sys >>>pr

Re: connect four (game)

2017-11-26 Thread nospam.nospam.alister via Python-list
On Sat, 25 Nov 2017 12:26:52 -0800, namenobodywants wrote: > On Friday, November 24, 2017 at 8:07:07 AM UTC-8, Chris Angelico wrote: > >> This is the kind of function that needs a docstring and some comments. >> What exactly is this doing? What are the "lines" of the board? What's >> the differenc

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . nospam . Cameron Simpson
On 26Nov2017 01:09, Greg Tibbet wrote: >I've got a small program that uses PIL to create an image, draw some >primitives (rectanges, ellipses, etc...) and save it. Works fine... >no issues. > >I've found in the past, the best way to "really learn" the language >was to "dig into the guts" and unde

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . nospam . Peter Otten
Greg Tibbet wrote: > > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectanges, ellipses, etc...) and save it. Works fine.

C-api: Executing several scripts as __main__: globals are gone

2017-11-26 Thread nospam . nospam . Hartmut Goebel
Hello, in PyInstaller we execute several Python scripts one after each other. The primary use of this is to run some setup prior to the actual appication. Up to now all scripts shared the same global variables, which worked well for 15 years, but now showed an error. The new code (scratched below)

Re: Pros and cons of Python sources?

2017-11-26 Thread nospam . nospam . Martin Schöön
(Martin =?UTF-8?Q?Sch=C3=B6=C3=B6n?=) Den 2017-11-26 skrev Cameron Simpson : > On 25Nov2017 08:34, rusi wrote: >>On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote: >>> The problem with mixing repository-installed packages with pip-installed >>> packages is that there's a

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . nospam . Gisle Vanem
Greg Tibbet wrote: > ellipse() uses the method self.draw.draw_ellipse() Okay, fine... > but WHERE is draw_ellipse defined?? What magic is happening there? > I've searched the entire PIL directory tree, and the ONLY two places > draw_ellipse is mentioned are right there in the ellipse() functio

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wxjmfauth
Le dimanche 26 novembre 2017 05:53:55 UTC+1, Rustom Mody a ÄCcritâ : > On Sunday, November 26, 2017 at 3:43:29 AM UTC+5:30, Chris Angelico wrote: > > On Sun, Nov 26, 2017 at 9:05 AM, wojtek.mula wrote: > > > Hi, my goal is to obtain an interpreter that internally > > > uses UCS-2. Such a simple co

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Stefan Ram
Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >ink, fill = sel

Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . nospam . Greg Tibbet
I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit of Java and trying to learn this new-fangled Python language! I've got a small program that uses PIL to create an image, draw some primitives (rectanges, ellipses, etc...) and save it. Works fine... no issues. I've found in

Re: connect four (game)

2017-11-26 Thread nospam . nospam . Terry Reedy
On 11/25/2017 4:57 PM, namenobodywa...@gmail.com wrote: > On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: > >> I did, and it looks buggy to me. The top and left frame lines are >> missing. If I click a square, the bottom square in the column lights >> up. But then I have

Re: connect four (game)

2017-11-26 Thread namenobodywants
On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: > I did, and it looks buggy to me. The top and left frame lines are > missing. If I click a square, the bottom square in the column lights > up. But then I have no idea whether those are your intentions or not. i hadn't no

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . nospam . Chris Angelico
On Sun, Nov 26, 2017 at 9:05 AM, wrote: > Hi, my goal is to obtain an interpreter that internally > uses UCS-2. Such a simple code should print 65535: > > import sys > print sys.maxunicode > > This is enabled in Windows, but I want the same in Linux. > What options have I pass to the configur

Re: connect four (game)

2017-11-26 Thread namenobodywants
On Friday, November 24, 2017 at 8:07:07 AM UTC-8, Chris Angelico wrote: > This is the kind of function that needs a docstring and some comments. > What exactly is this doing? What are the "lines" of the board? What's > the difference between "linear" and "lines"? What exactly is it > returning? p

Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wojtek mula
Hi, my goal is to obtain an interpreter that internally uses UCS-2. Such a simple code should print 65535: import sys print sys.maxunicode This is enabled in Windows, but I want the same in Linux. What options have I pass to the configure script? w. -- https://mail.python.org/mailman/listi

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . bartc
On 26/11/2017 09:09, Greg Tibbet wrote: > > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectanges, ellipses, etc...) and s

Re: connect four (game)

2017-11-26 Thread namenobodywants
On Saturday, November 25, 2017 at 5:00:12 AM UTC-8, bartc wrote: > Actually I've no idea what these tests are supposed to prove. me neither; i think you guys may be getting me out of my depth now > They are to do with one class called 'infinity', which is never used in the rest > of the program

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . Peter Otten
Greg Tibbet wrote: > > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectanges, ellipses, etc...) and save it. Works fine.

Re: connect four (game)

2017-11-26 Thread nospam . nospam . Michael Torrie
On 11/25/2017 06:00 AM, bartc wrote: > And there's a quite lot left of the rest of the program to worry about too! > > If you add 'window()' at the end of the program, then it seems to run on > Python 3. I'd play around with it first before thinking up strategies > for testing it. Actually, no. U

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . Cameron Simpson
On 26Nov2017 01:09, Greg Tibbet wrote: >I've got a small program that uses PIL to create an image, draw some >primitives (rectanges, ellipses, etc...) and save it. Works fine... >no issues. > >I've found in the past, the best way to "really learn" the language >was to "dig into the guts" and unde

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wojtek . mula
On Sunday, November 26, 2017 at 1:00:19 AM UTC+1, Terry Reedy wrote: > You must be trying to compile 2.7. There may be Linux distributions > that compile this way. You're right, I need 2.7. Any hint which distro has got these settings? > If you want to seriously work with unicode, many recommen

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wxjmfauth
Le dimanche 26 novembre 2017 05:53:55 UTC+1, Rustom Mody a ÄCcritâ : > On Sunday, November 26, 2017 at 3:43:29 AM UTC+5:30, Chris Angelico wrote: > > On Sun, Nov 26, 2017 at 9:05 AM, wojtek.mula wrote: > > > Hi, my goal is to obtain an interpreter that internally > > > uses UCS-2. Such a simple co

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . Wanderer
On Sunday, November 26, 2017 at 4:10:12 AM UTC-5, Greg Tibbet wrote: > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectang

Re: connect four (game)

2017-11-26 Thread nospam . Chris Angelico
On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: > The way I write code isn't incrementally top down or bottom up. It's > backwards and forwards. Feedback from different parts means the thing > develops as a whole. Sometimes parts are split into distinct sections, > sometimes different parts are merg

Re: Stopping an iterator and continuing later

2017-11-26 Thread Stefan Ram
r...@zedat.fu-berlin.de (Stefan Ram) writes: >Then you can use pickle or custom methods to save and >restore the object, or get the state from an iterator >and create a new iterator with that state later. One does not always have to write a custom class, for example: main.py import pickle

Re: connect four (game)

2017-11-26 Thread nospam . bartc
On 25/11/2017 23:49, Terry Reedy wrote: > On 11/25/2017 4:57 PM, namenobodywa...@gmail.com wrote: >> On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: >> >>> I did, and it looks buggy to me.â The top and left frame lines are >>> missing.â If I click a square, the bottom squa

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . Gisle Vanem
Greg Tibbet wrote: > ellipse() uses the method self.draw.draw_ellipse() Okay, fine... > but WHERE is draw_ellipse defined?? What magic is happening there? > I've searched the entire PIL directory tree, and the ONLY two places > draw_ellipse is mentioned are right there in the ellipse() functio

Re: Stopping an iterator and continuing later (Posting On Python-List P

2017-11-26 Thread november nihal
On Saturday, 25 November 2017 20:59:02 UTC, Lawrence Dâ ÖOliveiro wrote: > On Sunday, November 26, 2017 at 6:43:05 AM UTC+13, novembe...@gmail.com wrote: > > I worked out how to use iterators to generate values one at a time > > then ran into a second problem which is time. Is it possible to > > s

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Stefan Ram
Greg Tibbet writes: >I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit >of Java and trying to learn this new-fangled Python language! Which actually is older than Java. >def ellipse(self, xy, fill=None, outline=None): >"""Draw an ellipse.""" >ink, fill = sel

Re: connect four (game)

2017-11-26 Thread nospam.alister via Python-list
On Sat, 25 Nov 2017 12:26:52 -0800, namenobodywants wrote: > On Friday, November 24, 2017 at 8:07:07 AM UTC-8, Chris Angelico wrote: > >> This is the kind of function that needs a docstring and some comments. >> What exactly is this doing? What are the "lines" of the board? What's >> the differenc

Re: connect four (game)

2017-11-26 Thread nospam . bartc
On 26/11/2017 14:23, Chris Angelico wrote: > On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: >> The way I write code isn't incrementally top down or bottom up. It's >> backwards and forwards. Feedback from different parts means the thing >> develops as a whole. Sometimes parts are split into distinc

Re: Pros and cons of Python sources?

2017-11-26 Thread nospam . Martin Schöön
Den 2017-11-26 skrev Cameron Simpson : > On 25Nov2017 08:34, rusi wrote: >>On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote: >>> The problem with mixing repository-installed packages with pip-installed >>> packages is that there's always a chance a Debian update will ove

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Serhiy Storchaka
26.11.17 01:59, Terry Reedy D¿D,ÑêDµ: > On 11/25/2017 5:12 PM, Chris Angelico wrote: >> On Sun, Nov 26, 2017 at 9:05 AM,â wrote: >>> Hi, my goal is to obtain an interpreter that internally >>> uses UCS-2. Such a simple code should print 65535: >>> >>> â â import sys >>> â â print sys.maxunicode

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . Vincent Vande Vyvre
Le 26/11/17 Ä 10:09, Greg Tibbet a ÄCcritâ : > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectanges, ellipses, etc...) a

Re: connect four (game)

2017-11-26 Thread nospam . bartc
On 25/11/2017 16:07, Michael Torrie wrote: > On 11/25/2017 06:00 AM, bartc wrote: >> And there's a quite lot left of the rest of the program to worry about too! >> >> If you add 'window()' at the end of the program, then it seems to run on >> Python 3. I'd play around with it first before thinking

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Chris Angelico
On Sun, Nov 26, 2017 at 3:53 PM, Rustom Mody wrote: > On Sunday, November 26, 2017 at 3:43:29 AM UTC+5:30, Chris Angelico wrote: >> On Sun, Nov 26, 2017 at 9:05 AM, wojtek.mula wrote: >> > Hi, my goal is to obtain an interpreter that internally >> > uses UCS-2. Such a simple code should print 655

C-api: Executing several scripts as __main__: globals are gone

2017-11-26 Thread nospam . Hartmut Goebel
Hello, in PyInstaller we execute several Python scripts one after each other. The primary use of this is to run some setup prior to the actual appication. Up to now all scripts shared the same global variables, which worked well for 15 years, but now showed an error. The new code (scratched below)

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Rustom Mody
On Sunday, November 26, 2017 at 3:43:29 AM UTC+5:30, Chris Angelico wrote: > On Sun, Nov 26, 2017 at 9:05 AM, wojtek.mula wrote: > > Hi, my goal is to obtain an interpreter that internally > > uses UCS-2. Such a simple code should print 65535: > > > > import sys > > print sys.maxunicode > > >

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Ned Batchelder
On 11/25/17 5:05 PM, wojtek.m...@gmail.com wrote: > Hi, my goal is to obtain an interpreter that internally > uses UCS-2. Such a simple code should print 65535: > >import sys >print sys.maxunicode > > This is enabled in Windows, but I want the same in Linux. > What options have I pass to th

Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread nospam . Greg Tibbet
I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit of Java and trying to learn this new-fangled Python language! I've got a small program that uses PIL to create an image, draw some primitives (rectanges, ellipses, etc...) and save it. Works fine... no issues. I've found in

Re: Pros and cons of Python sources?

2017-11-26 Thread nospam . Cameron Simpson
On 25Nov2017 08:34, rusi wrote: >On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote: >> The problem with mixing repository-installed packages with pip-installed >> packages is that there's always a chance a Debian update will overwrite >> a pip package, possibly with an ol

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Chris Angelico
On Sun, Nov 26, 2017 at 10:59 AM, Terry Reedy wrote: > On 11/25/2017 5:12 PM, Chris Angelico wrote: >> >> On Sun, Nov 26, 2017 at 9:05 AM, wrote: >>> >>> Hi, my goal is to obtain an interpreter that internally >>> uses UCS-2. Such a simple code should print 65535: >>> >>>import sys >>>pr

Re: connect four (game)

2017-11-26 Thread nospam . Terry Reedy
On 11/25/2017 4:57 PM, namenobodywa...@gmail.com wrote: > On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: > >> I did, and it looks buggy to me. The top and left frame lines are >> missing. If I click a square, the bottom square in the column lights >> up. But then I have

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Terry Reedy
On 11/25/2017 5:12 PM, Chris Angelico wrote: > On Sun, Nov 26, 2017 at 9:05 AM, wrote: >> Hi, my goal is to obtain an interpreter that internally >> uses UCS-2. Such a simple code should print 65535: >> >>import sys >>print sys.maxunicode >> >> This is enabled in Windows, but I want the s

Re: connect four (game)

2017-11-26 Thread namenobodywants
On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: > I did, and it looks buggy to me. The top and left frame lines are > missing. If I click a square, the bottom square in the column lights > up. But then I have no idea whether those are your intentions or not. i hadn't no

Re: Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread nospam . Chris Angelico
On Sun, Nov 26, 2017 at 9:05 AM, wrote: > Hi, my goal is to obtain an interpreter that internally > uses UCS-2. Such a simple code should print 65535: > > import sys > print sys.maxunicode > > This is enabled in Windows, but I want the same in Linux. > What options have I pass to the configur

Re: connect four (game)

2017-11-26 Thread namenobodywants
On Saturday, November 25, 2017 at 5:00:12 AM UTC-8, bartc wrote: > Actually I've no idea what these tests are supposed to prove. me neither; i think you guys may be getting me out of my depth now > They are to do with one class called 'infinity', which is never used in the rest > of the program

Compile Python 3 interpreter to force 2-byte unicode

2017-11-26 Thread wojtek mula
Hi, my goal is to obtain an interpreter that internally uses UCS-2. Such a simple code should print 65535: import sys print sys.maxunicode This is enabled in Windows, but I want the same in Linux. What options have I pass to the configure script? w. -- https://mail.python.org/mailman/listi

Re: connect four (game)

2017-11-26 Thread nospam . Michael Torrie
On 11/25/2017 06:00 AM, bartc wrote: > And there's a quite lot left of the rest of the program to worry about too! > > If you add 'window()' at the end of the program, then it seems to run on > Python 3. I'd play around with it first before thinking up strategies > for testing it. Actually, no. U

Re: connect four (game)

2017-11-26 Thread namenobodywants
On Friday, November 24, 2017 at 8:07:07 AM UTC-8, Chris Angelico wrote: > This is the kind of function that needs a docstring and some comments. > What exactly is this doing? What are the "lines" of the board? What's > the difference between "linear" and "lines"? What exactly is it > returning? p

Re: connect four (game)

2017-11-26 Thread bartc
On 26/11/2017 14:23, Chris Angelico wrote: On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: The way I write code isn't incrementally top down or bottom up. It's backwards and forwards. Feedback from different parts means the thing develops as a whole. Sometimes parts are split into distinct sectio

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Wanderer
On Sunday, November 26, 2017 at 4:10:12 AM UTC-5, Greg Tibbet wrote: > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectan

Re: connect four (game)

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 1:11 AM, bartc wrote: > The way I write code isn't incrementally top down or bottom up. It's > backwards and forwards. Feedback from different parts means the thing > develops as a whole. Sometimes parts are split into distinct sections, > sometimes different parts are merg

Re: connect four (game)

2017-11-26 Thread bartc
On 25/11/2017 23:49, Terry Reedy wrote: On 11/25/2017 4:57 PM, namenobodywa...@gmail.com wrote: On Saturday, November 25, 2017 at 12:48:38 AM UTC-8, Terry Reedy wrote: I did, and it looks buggy to me.  The top and left frame lines are missing.  If I click a square, the bottom square in the col

Re: connect four (game)

2017-11-26 Thread bartc
On 25/11/2017 16:07, Michael Torrie wrote: On 11/25/2017 06:00 AM, bartc wrote: And there's a quite lot left of the rest of the program to worry about too! If you add 'window()' at the end of the program, then it seems to run on Python 3. I'd play around with it first before thinking up strateg

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Vincent Vande Vyvre
Le 26/11/17 à 10:09, Greg Tibbet a écrit : I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit of Java and trying to learn this new-fangled Python language! I've got a small program that uses PIL to create an image, draw some primitives (rectanges, ellipses, etc...) and save it

Re: Stopping an iterator and continuing later (Posting On Python-List Prohibited)

2017-11-26 Thread november . nihal
On Saturday, 25 November 2017 20:59:02 UTC, Lawrence D’Oliveiro wrote: > On Sunday, November 26, 2017 at 6:43:05 AM UTC+13, novembe...@gmail.com wrote: > > I worked out how to use iterators to generate values one at a time > > then ran into a second problem which is time. Is it possible to > > sav

Re: connect four (game)

2017-11-26 Thread alister via Python-list
On Sat, 25 Nov 2017 12:26:52 -0800, namenobodywants wrote: > On Friday, November 24, 2017 at 8:07:07 AM UTC-8, Chris Angelico wrote: > >> This is the kind of function that needs a docstring and some comments. >> What exactly is this doing? What are the "lines" of the board? What's >> the differen

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread bartc
On 26/11/2017 09:09, Greg Tibbet wrote: I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit of Java and trying to learn this new-fangled Python language! I've got a small program that uses PIL to create an image, draw some primitives (rectanges, ellipses, etc...) and save it.

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Cameron Simpson
On 26Nov2017 01:09, Greg Tibbet wrote: I've got a small program that uses PIL to create an image, draw some primitives (rectanges, ellipses, etc...) and save it. Works fine... no issues. I've found in the past, the best way to "really learn" the language was to "dig into the guts" and understa

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Peter Otten
Greg Tibbet wrote: > > I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit > of Java and trying to learn this new-fangled Python language! > > I've got a small program that uses PIL to create an image, draw some > primitives (rectanges, ellipses, etc...) and save it. Works fin

C-api: Executing several scripts as __main__: globals are gone

2017-11-26 Thread Hartmut Goebel
Hello, in PyInstaller we execute several Python scripts one after each other. The primary use of this is to run some setup prior to the actual appication. Up to now all scripts shared the same global variables, which worked well for 15 years, but now showed an error. The new code (scratched below)

Re: Pros and cons of Python sources?

2017-11-26 Thread Martin Schöön
Den 2017-11-26 skrev Cameron Simpson : > On 25Nov2017 08:34, rusi wrote: >>On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote: >>> The problem with mixing repository-installed packages with pip-installed >>> packages is that there's always a chance a Debian update will ove

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Gisle Vanem
Greg Tibbet wrote: ellipse() uses the method self.draw.draw_ellipse() Okay, fine... but WHERE is draw_ellipse defined?? What magic is happening there? I've searched the entire PIL directory tree, and the ONLY two places draw_ellipse is mentioned are right there in the ellipse() function... W

Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread Greg Tibbet
I'm an old timer, have programmed in Fortran, C, C++, Perl, and a bit of Java and trying to learn this new-fangled Python language! I've got a small program that uses PIL to create an image, draw some primitives (rectanges, ellipses, etc...) and save it. Works fine... no issues. I've found in t