Re: Pandas printing in jupyter
The HTML representation is supplied by the object's _repr_html_
method. See https://ipython.org/ipython-doc/3/config/integrating.html
for some details.
>>> import pandas as pd
>>> df = pd.DataFrame()
>>> df._repr_html_()
'\n\n.dataframe tbody tr th:only-of-type {\n
vertical-align: middle;\n}\n\n.dataframe tbody tr th {\n
vertical-align: top;\n}\n\n.dataframe thead th {\n
text-align: right;\n}\n\n\n \n\n
\n\n \n \n
\n\n'
>>> help(df._repr_html_)
Help on method _repr_html_ in module pandas.core.frame:
_repr_html_() method of pandas.core.frame.DataFrame instance
Return a html representation for a particular DataFrame.
Mainly for IPython notebook.
>>>
Paul
On 11 January 2018 at 04:23, Rustom Mody wrote:
> If I make a data-frame in pandas in jupyter notebook it prints very nicely
> ie it looks quite like a spreadsheet
>
> How does it do it?
> Who does it?
>
> The data-frame does not seem to have str/repr methods…
> --
> https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
Re: Pandas printing in jupyter
On Thursday, January 11, 2018 at 2:13:46 PM UTC+5:30, Paul Moore wrote: > The HTML representation is supplied by the object's _repr_html_ > method. See https://ipython.org/ipython-doc/3/config/integrating.html > for some details. > > >>> import pandas as pd > >>> df = pd.DataFrame() > >>> df._repr_html_() > '\n
Re: Pandas printing in jupyter
On 2018-01-11 09:59, Rustom Mody wrote: > On Thursday, January 11, 2018 at 2:13:46 PM UTC+5:30, Paul Moore wrote: >> The HTML representation is supplied by the object's _repr_html_ >> method. See https://ipython.org/ipython-doc/3/config/integrating.html >> for some details. >> > import pandas as pd > df = pd.DataFrame() > df._repr_html_() >> '\n
Generating SVG from turtle graphics
I'd like to draw something with turtle, then generate a SVG file from it. Is this possible? If not, is there something I can do which lets me plot lines, shapes and curves and output to SVG? Ideally, I'd like to draw a figure pixel by pixel, and then have the SVG library fit a bezier curve to it. -- Steve -- https://mail.python.org/mailman/listinfo/python-list
Re: Generating SVG from turtle graphics
Steven D'Aprano writes: > Ideally, I'd like to draw a figure pixel by pixel, and then have the SVG > library fit a bezier curve to it. Uhm, dunno if it is a good approach, it really depends on the kind of "figures" you are going to draw. Anyway, in the past I used http://pyx.sourceforge.net/ to produce the images for a book[1] on the Carrom game, and I enjoyed its simplicity. ciao, lele. [1] https://bitbucket.org/lele/cta -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. [email protected] | -- Fortunato Depero, 1929. -- https://mail.python.org/mailman/listinfo/python-list
ANN: Python Meeting Düsseldorf - 17.01.2018
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] ANKÜNDIGUNG Python Meeting Düsseldorf http://pyddf.de/ Ein Treffen von Python Enthusiasten und Interessierten in ungezwungener Atmosphäre. Mittwoch, 17.01.2018, 18:00 Uhr Raum 1, 2.OG im Bürgerhaus Stadtteilzentrum Bilk Düsseldorfer Arcaden, Bachstr. 145, 40217 Düsseldorf Diese Nachricht ist auch online verfügbar: http://www.egenix.com/company/news/Python-Meeting-Duesseldorf-2018-01-17 NEUIGKEITEN * Bereits angemeldete Vorträge: Dr. Klaus Bremer "Klimadatenauswertung mit Python" Marc-Andre Lemburg "YouTube API mit Python ansprechen" Philipp Hagemeister "5 Sicherheitslücken in Deiner Python-Anwendung" Charlie Clark "asyncio für schnellere Datenbanken" Weitere Vorträge können gerne noch angemeldet werden: [email protected] * Startzeit und Ort: Wir treffen uns um 18:00 Uhr im Bürgerhaus in den Düsseldorfer Arcaden. Das Bürgerhaus teilt sich den Eingang mit dem Schwimmbad und befindet sich an der Seite der Tiefgarageneinfahrt der Düsseldorfer Arcaden. Über dem Eingang steht ein großes "Schwimm' in Bilk" Logo. Hinter der Tür direkt links zu den zwei Aufzügen, dann in den 2. Stock hochfahren. Der Eingang zum Raum 1 liegt direkt links, wenn man aus dem Aufzug kommt. Google Street View: http://bit.ly/11sCfiw EINLEITUNG Das Python Meeting Düsseldorf ist eine regelmäßige Veranstaltung in Düsseldorf, die sich an Python Begeisterte aus der Region wendet: * http://pyddf.de/ Einen guten Überblick über die Vorträge bietet unser YouTube-Kanal, auf dem wir die Vorträge nach den Meetings veröffentlichen: * http://www.youtube.com/pyddf/ Veranstaltet wird das Meeting von der eGenix.com GmbH, Langenfeld, in Zusammenarbeit mit Clark Consulting & Research, Düsseldorf: * http://www.egenix.com/ * http://www.clark-consulting.eu/ PROGRAMM Das Python Meeting Düsseldorf nutzt eine Mischung aus (Lightning) Talks und offener Diskussion. Vorträge können vorher angemeldet werden, oder auch spontan während des Treffens eingebracht werden. Ein Beamer mit XGA Auflösung steht zur Verfügung. (Lightning) Talk Anmeldung bitte formlos per EMail an [email protected] KOSTENBETEILIGUNG Das Python Meeting Düsseldorf wird von Python Nutzern für Python Nutzer veranstaltet. Um die Kosten zumindest teilweise zu refinanzieren, bitten wir die Teilnehmer um einen Beitrag in Höhe von EUR 10,00 inkl. 19% Mwst, Schüler und Studenten zahlen EUR 5,00 inkl. 19% Mwst. Wir möchten alle Teilnehmer bitten, den Betrag in bar mitzubringen. ANMELDUNG Da wir nur für ca. 20 Personen Sitzplätze haben, möchten wir bitten, sich per EMail anzumelden. Damit wird keine Verpflichtung eingegangen. Es erleichtert uns allerdings die Planung. Meeting Anmeldung bitte formlos per EMail an [email protected] WEITERE INFORMATIONEN Weitere Informationen finden Sie auf der Webseite des Meetings: http://pyddf.de/ Mit freundlichen Grüßen, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 11 2018) >>> Python Projects, Coaching and Consulting ... http://www.egenix.com/ >>> Python Database Interfaces ... http://products.egenix.com/ >>> Plone/Zope Database Interfaces ... http://zope.egenix.com/ ::: We implement business ideas - efficiently in both time and costs ::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ http://www.malemburg.com/ -- https://mail.python.org/mailman/listinfo/python-list
Re: Pandas printing in jupyter
On Thursday, January 11, 2018 at 2:49:27 PM UTC+5:30, Thomas Jollans wrote: > On 2018-01-11 09:59, Rustom Mody wrote: > > On Thursday, January 11, 2018 at 2:13:46 PM UTC+5:30, Paul Moore wrote: > >> The HTML representation is supplied by the object's _repr_html_ > >> method. See https://ipython.org/ipython-doc/3/config/integrating.html > >> for some details. > >> > > import pandas as pd > > df = pd.DataFrame() > > df._repr_html_() > >> '\n
Re: Simple graphic library for beginners
On 11/01/2018 05:16, Michael Torrie wrote: On 01/10/2018 01:13 PM, bartc wrote: Yes the link didn't have the simple examples I hoped for. How's this: - import pygame import time pygame.init() screen = pygame.display.set_mode((1024, 768) ) red = (255,0,0) green = (0,255,0) screen.fill( (255,255,255) ) pygame.draw.lines(screen, red, False, ((0,0),(100,100))) pygame.draw.lines(screen, green, False, ((0,100),(100,0))) pygame.display.update() time.sleep(5) pygame.quit() -- That looks reasonable. Although I can't run it because 'pygame' is not available. I think installing this library is likely to be a bigger obstacle than programming any graphics! (If I try and download it as a ready-built library for Windows, it has a range of .msi files, none of which is a match for my Python. The newest is for win32 Py3.2; I need win64 Py3.6. While building from source involves running MSVC 2008 urghh) PyGame has other primitives like circles, ellipses, etc. Much like the old BASIC graphics primitives. 'Turtle' will do it (assuming there's a way of drawing things without having to watch an actual turtle symbol crawling around the screen). Yes I think it can. One simple library of my own (not for Python) would use one function call to create a window, and another to draw an element (say, a box) within that window. (Plus a third to keep it on the screen otherwise it will disappear when the program terminates.) Are you thinking of sprites? No. I've put an example of my library, roughly corresponding to what I believe your example does, below my sig (as it is not Python). This is fairly low level and expects to have another layer applied, but it is not too bad to use directly. (This library actually is entirely implemented in the byte-code language, and talks directly to Win32 API. That would be the equivalent of Pygame being written in 100% Python, which would make it trivial to install. But some elements would need to be different according to platform.) -- Bartc - import gxlib proc start= w := gxcreatewindow(dim:(1024,768)) gxclear(w,getrgb(yellow))# window is already white gxcolour(w, getrgb(red)) gxline(w, 0,0, 100,100) gxcolour(w, getrgb(green)) gxline(w, 0,0, 100,0) eventloop() end -- https://mail.python.org/mailman/listinfo/python-list
Re: Tips or strategies to understanding how CPython works under the hood
Thanks all for the links and suggestions, they are greatly appreciated. I might be programming for a long time (relative to my age) but I haven't touched much on compilers or interpreters. Inspired a but by Python's interpreter I wrote a little bytecode interpreter in C (maybe should have upgrade to C++ but not yet), I enter custom bytes into a program array, currently can jump, add/subtract, print values on stack and halt the interpreter. I'm happy with what I've done so far. A compiler is out of my reach for the moment so I'm going to research that after learning a good bit of Python's internals. On Wed 10 Jan 2018, 12:13 bartc, wrote: > On 09/01/2018 20:12, Alain Ketterlin wrote: > > ElChino writes: > > > >> Chris Angelico wrote: > >> > >>> CPython is a stack-based interpreter, which means it loads values onto > >>> an (invisible) internal stack, processes values at the top of the > >>> stack, and removes them when it's done. > >> > >> Is this similar to how Lua operates too? > > > > No. Lua uses a register-based (virtual) machine. See > > > > https://www.lua.org/doc/jucs05.pdf > > "Registers are kept in the run-time stack ... an array". > > So it sounds like a stack is still used, but instructions directly > access specific slots on the stack, within a particular register window. > > It means there need be fewer instructions to implement some code, but > each has more operands. > > Also interesting is that the comparison operators include only EQ, LT > and LE. There is no NE, so no issues such as those discussed recently. > > > > > I think Lua was the first language in widespread use to move to a > > register-based machine. > > I believe stack-based byte-code, which is very easy to generate, can be > transformed to some 'register'-based version, if performance is the > motivation. > > (But I'm not convinced that register-based is necessarily faster. Lua is > quite fast, especially LuaJIT, but the language is also smaller and > simpler.) > > -- > bartc > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
PIP message: Fatal error in launcher: Unable to create process using '"'
I am getting the message: Fatal error in launcher: Unable to create process using '"' for all pip commands. I tried uninstalling and installing different versions of python, but the pip is still not work, getting the same error message. Has anyone encountered this? Any ideas? Thanks. -- https://mail.python.org/mailman/listinfo/python-list
PIP message: Fatal error in launcher: Unable to create process using '"'
I am getting the message: Fatal error in launcher: Unable to create process using '"' for all pip commands. I tried uninstalling and installing different versions of python, but the pip is still not work, getting the same error message. Has anyone encountered this? Any ideas? Thanks. -- https://mail.python.org/mailman/listinfo/python-list
Re: PIP message: Fatal error in launcher: Unable to create process using '"'
Have you done any research (google, for example) and tried any of the suggested solutions on the web? >From a quick search, I'd suggest: 1. Can you confirm if "python -m pip " has the same error? 2. What is the exact path of the pip executable you're running, and if you go into the Python prompt and do "import pip; print(pip.__file__)" what is the result? It sounds like you have some sort of incorrectly set up environment with your pip executable being somehow inconsistent with your Python environment. Please confirm the *precise* versions of Python and pip you're (currently) using which give the error. Also, please confirm that you get the same errors if you're in a different (empty) directory - sometimes what's in the current directory can mess things up. Paul On 11 January 2018 at 14:39, Harriett Xing wrote: > I am getting the message: > > Fatal error in launcher: Unable to create process using '"' > > for all pip commands. > > I tried uninstalling and installing different versions of python, but the pip > is still not work, getting the same error message. > > Has anyone encountered this? Any ideas? Thanks. > -- > https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 12:38 AM, bartc wrote: > On 11/01/2018 05:16, Michael Torrie wrote: >> >> On 01/10/2018 01:13 PM, bartc wrote: > > >> Yes the link didn't have the simple examples I hoped for. How's this: >> - >> import pygame >> import time >> >> pygame.init() >> screen = pygame.display.set_mode((1024, 768) ) >> red = (255,0,0) >> green = (0,255,0) >> >> screen.fill( (255,255,255) ) >> pygame.draw.lines(screen, red, False, ((0,0),(100,100))) >> pygame.draw.lines(screen, green, False, ((0,100),(100,0))) >> pygame.display.update() >> >> time.sleep(5) >> pygame.quit() >> -- > > > That looks reasonable. > > Although I can't run it because 'pygame' is not available. I think > installing this library is likely to be a bigger obstacle than programming > any graphics! > > (If I try and download it as a ready-built library for Windows, it has a > range of .msi files, none of which is a match for my Python. The newest is > for win32 Py3.2; I need win64 Py3.6. While building from source involves > running MSVC 2008 urghh) https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame Go. Fetch. Stop fudding. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 01/11/2018 06:38 AM, bartc wrote: > Although I can't run it because 'pygame' is not available. I think > installing this library is likely to be a bigger obstacle than > programming any graphics! > > (If I try and download it as a ready-built library for Windows, it has a > range of .msi files, none of which is a match for my Python. The newest > is for win32 Py3.2; I need win64 Py3.6. While building from source > involves running MSVC 2008 urghh) PyGame has a lot of extra stuff for programming games. Under the hood it uses SDL for all the primitives. So maybe that would be preferred to using pygame anyway. SDL is well supported on Windows, but I don't know about the Python SDL bindings. -- https://mail.python.org/mailman/listinfo/python-list
Re: PIP message: Fatal error in launcher: Unable to create process using '"'
Glad it's working for you. You don't say where your pip.exe command is located, but I suspect what's happening is that you're picking up a pip.exe from an old and since uninstalled copy of Python. But at least you can use pip now which is the main thing :-) Paul On 11 January 2018 at 15:46, Harriett Xing wrote: > Thanks for the info. > > "python -m pip " works. > > Python Path: > C:\Users\harriett.xing-adm\AppData\Local\Programs\Python\Python36 > > C:\Users\harriett.xing-adm\Documents\Learning\python>python > Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit > (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. import pip; print(pip.__file__); > C:\Users\harriett.xing-adm\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\__init__.py > > > C:\Users\harriett.xing-adm>python --version > Python 3.6.1 > > pip is getting the error regardless of which directory I run it. > > Thank you for your help. > > > > On Thu, Jan 11, 2018 at 10:01 AM, Paul Moore wrote: >> >> Have you done any research (google, for example) and tried any of the >> suggested solutions on the web? >> >> From a quick search, I'd suggest: >> >> 1. Can you confirm if "python -m pip " >> has the same error? >> 2. What is the exact path of the pip executable you're running, and if >> you go into the Python prompt and do "import pip; print(pip.__file__)" >> what is the result? >> >> It sounds like you have some sort of incorrectly set up environment >> with your pip executable being somehow inconsistent with your Python >> environment. >> >> Please confirm the *precise* versions of Python and pip you're >> (currently) using which give the error. Also, please confirm that you >> get the same errors if you're in a different (empty) directory - >> sometimes what's in the current directory can mess things up. >> >> Paul >> >> >> On 11 January 2018 at 14:39, Harriett Xing >> wrote: >> > I am getting the message: >> > >> > Fatal error in launcher: Unable to create process using '"' >> > >> > for all pip commands. >> > >> > I tried uninstalling and installing different versions of python, but >> > the pip is still not work, getting the same error message. >> > >> > Has anyone encountered this? Any ideas? Thanks. >> > -- >> > https://mail.python.org/mailman/listinfo/python-list > > -- https://mail.python.org/mailman/listinfo/python-list
Re: PIP message: Fatal error in launcher: Unable to create process using '"'
Thanks for the info. "python -m pip " works. Python Path: C:\Users\harriett.xing-adm\AppData\Local\Programs\Python\Python36 C:\Users\harriett.xing-adm\Documents\Learning\python>python Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import pip; >>> print(pip.__file__); C:\Users\harriett.xing-adm\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\__init__.py >>> C:\Users\harriett.xing-adm>python --version Python 3.6.1 pip is getting the error regardless of which directory I run it. Thank you for your help. On Thu, Jan 11, 2018 at 10:01 AM, Paul Moore wrote: > Have you done any research (google, for example) and tried any of the > suggested solutions on the web? > > From a quick search, I'd suggest: > > 1. Can you confirm if "python -m pip " > has the same error? > 2. What is the exact path of the pip executable you're running, and if > you go into the Python prompt and do "import pip; print(pip.__file__)" > what is the result? > > It sounds like you have some sort of incorrectly set up environment > with your pip executable being somehow inconsistent with your Python > environment. > > Please confirm the *precise* versions of Python and pip you're > (currently) using which give the error. Also, please confirm that you > get the same errors if you're in a different (empty) directory - > sometimes what's in the current directory can mess things up. > > Paul > > > On 11 January 2018 at 14:39, Harriett Xing > wrote: > > I am getting the message: > > > > Fatal error in launcher: Unable to create process using '"' > > > > for all pip commands. > > > > I tried uninstalling and installing different versions of python, but > the pip is still not work, getting the same error message. > > > > Has anyone encountered this? Any ideas? Thanks. > > -- > > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: PIP message: Fatal error in launcher: Unable to create process using '"'
Thanks for the info. I found two copies of pip.exe. One of them was left from a previous installation. Removed the extra copy. Now pip is working. Thank you very much for your help. On Thu, Jan 11, 2018 at 10:46 AM, Harriett Xing wrote: > Thanks for the info. > > "python -m pip " works. > > Python Path: C:\Users\harriett.xing-adm\AppData\Local\Programs\ > Python\Python36 > > C:\Users\harriett.xing-adm\Documents\Learning\python>python > Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit > (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import pip; > >>> print(pip.__file__); > C:\Users\harriett.xing-adm\AppData\Local\Programs\Python\ > Python36\lib\site-packages\pip\__init__.py > >>> > > > C:\Users\harriett.xing-adm>python --version > Python 3.6.1 > > pip is getting the error regardless of which directory I run it. > > Thank you for your help. > > > > On Thu, Jan 11, 2018 at 10:01 AM, Paul Moore wrote: > >> Have you done any research (google, for example) and tried any of the >> suggested solutions on the web? >> >> From a quick search, I'd suggest: >> >> 1. Can you confirm if "python -m pip " >> has the same error? >> 2. What is the exact path of the pip executable you're running, and if >> you go into the Python prompt and do "import pip; print(pip.__file__)" >> what is the result? >> >> It sounds like you have some sort of incorrectly set up environment >> with your pip executable being somehow inconsistent with your Python >> environment. >> >> Please confirm the *precise* versions of Python and pip you're >> (currently) using which give the error. Also, please confirm that you >> get the same errors if you're in a different (empty) directory - >> sometimes what's in the current directory can mess things up. >> >> Paul >> >> >> On 11 January 2018 at 14:39, Harriett Xing >> wrote: >> > I am getting the message: >> > >> > Fatal error in launcher: Unable to create process using '"' >> > >> > for all pip commands. >> > >> > I tried uninstalling and installing different versions of python, but >> the pip is still not work, getting the same error message. >> > >> > Has anyone encountered this? Any ideas? Thanks. >> > -- >> > https://mail.python.org/mailman/listinfo/python-list >> > > -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 1/11/18 10:23 AM, Chris Angelico wrote: On Fri, Jan 12, 2018 at 12:38 AM, bartc wrote: On 11/01/2018 05:16, Michael Torrie wrote: On 01/10/2018 01:13 PM, bartc wrote: Yes the link didn't have the simple examples I hoped for. How's this: - import pygame import time pygame.init() screen = pygame.display.set_mode((1024, 768) ) red = (255,0,0) green = (0,255,0) screen.fill( (255,255,255) ) pygame.draw.lines(screen, red, False, ((0,0),(100,100))) pygame.draw.lines(screen, green, False, ((0,100),(100,0))) pygame.display.update() time.sleep(5) pygame.quit() -- That looks reasonable. Although I can't run it because 'pygame' is not available. I think installing this library is likely to be a bigger obstacle than programming any graphics! (If I try and download it as a ready-built library for Windows, it has a range of .msi files, none of which is a match for my Python. The newest is for win32 Py3.2; I need win64 Py3.6. While building from source involves running MSVC 2008 urghh) https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame Go. Fetch. Stop fudding. I notice that pygame also has a nice set of wheels on PyPI: https://pypi.python.org/pypi/Pygame/1.9.3, including for win64 Python 3.6, so "pip install pygame" should work. Some people seem so determined to dislike a thing, they cannot be convinced there are solutions to their problems. --Ned. -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 15:23, Chris Angelico wrote: On Fri, Jan 12, 2018 at 12:38 AM, bartc wrote: Although I can't run it because 'pygame' is not available. I think installing this library is likely to be a bigger obstacle than programming any graphics! (If I try and download it as a ready-built library for Windows, it has a range of .msi files, none of which is a match for my Python. The newest is for win32 Py3.2; I need win64 Py3.6. While building from source involves running MSVC 2008 urghh) https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame Go. Fetch. Stop fudding. And you know this link, how? Because googling for 'download pygame', it doesn't appear on the first page (or in any of the next half dozen). But clicking on it, the most promising link seems to have 'cp36' and 'amd64'; I assume the 36 means 3.6. OK, but what the hell do I do with a .whl file? Google tells me I install it something like this: pip install file.whl. Except my Python 3.6 doesn't have pip. There is a however a copy in my Python 3.4. But that gives me the message: "pygame-1.9.3-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform." Maybe I need the 3.4? Download that (which is a bit of pig getting it from my browser's download directory, to anywhere else on my file system). But same error. Maybe it's the AMD64 bit, as my processor is Intel. (But is is really that critical??) I try the win32 version - same error. Perhaps I'm overthinking it, maybe this will work: pip install pygame and it will do whatever it needs to do to locate and download whatever version it knows is needed. Well, that seemed to do something, and it didn't need me to download any .whl files. But then I noticed a bunch of errors culminating with: "Command python setup.py egg_info failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip_build_user\pygame" So, yeah, it IS a palaver. Although even that wouldn't be a problem if it worked. And, yeah, I will continue to say that installing libraries in Python is such a PITA that I usually don't bother. Things should Just Work. Or be simple enough that you can easily find out why they don't. -- bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 5:33 AM, bartc wrote: > On 11/01/2018 15:23, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 12:38 AM, bartc wrote: > > >>> Although I can't run it because 'pygame' is not available. I think >>> installing this library is likely to be a bigger obstacle than >>> programming >>> any graphics! >>> >>> (If I try and download it as a ready-built library for Windows, it has a >>> range of .msi files, none of which is a match for my Python. The newest >>> is >>> for win32 Py3.2; I need win64 Py3.6. While building from source involves >>> running MSVC 2008 urghh) >> >> >> https://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame >> >> Go. Fetch. Stop fudding. > > > And you know this link, how? Because googling for 'download pygame', it > doesn't appear on the first page (or in any of the next half dozen). I Googled 'pygame windows', 'pygame windows binary', and a few others like that, and it appeared on the first page every time - usually within the top four - and other hits often included Stack Overflow questions that link to it, as well. A bit of basic research will also tell you that this is a link worth saving. > But clicking on it, the most promising link seems to have 'cp36' and > 'amd64'; I assume the 36 means 3.6. > > OK, but what the hell do I do with a .whl file? Google tells me I install it > something like this: pip install file.whl. > > Except my Python 3.6 doesn't have pip. There is a however a copy in my > Python 3.4. But that gives me the message: Why doesn't it? Recent Pythons should include pip by default. > "pygame-1.9.3-cp36-cp36m-win_amd64.whl is not a supported wheel on this > platform." > > Maybe I need the 3.4? Download that (which is a bit of pig getting it from > my browser's download directory, to anywhere else on my file system). But > same error. > > Maybe it's the AMD64 bit, as my processor is Intel. (But is is really that > critical??) I try the win32 version - same error. > > Perhaps I'm overthinking it, maybe this will work: > > pip install pygame > > and it will do whatever it needs to do to locate and download whatever > version it knows is needed. Yes, as Ned told you. Actually, this should be so blatantly obvious that I fell into the trap of assuming you'd already tried it. Mea culpa. > Well, that seemed to do something, and it didn't need me to download any > .whl files. But then I noticed a bunch of errors culminating with: > > "Command python setup.py egg_info failed with error code 1 in > C:\Users\user\AppData\Local\Temp\pip_build_user\pygame" If you've broken your pip in some way, we won't be able to help you debug it with just this. Figure out why your Python 3.6 doesn't have a working pip, because that IS the normal and obvious thing to do. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11 January 2018 at 18:33, bartc wrote: >> Go. Fetch. Stop fudding. > > And you know this link, how? Because googling for 'download pygame', it > doesn't appear on the first page (or in any of the next half dozen). Using your search phrase, the first results I get are: 1. Downloads - Pygame Page says "Wheel packages are also available on PyPI, and may be installed by running pip install wheel" right at the top, and that works perfectly. 2. GettingStarted - pygame wiki The "Windows installation" section says quite clearly, "py -m pip install pygame --user". I don't know why you'd need to go further, both of those are official pygame documentation, so it's reasonable to accept them as definitive. Later hits include some out of date instructions that explain how you'd have had to install pygame a few years ago, but why are you even looking that far down the search results? Even Christoph Gohlke's wheel distribution (which is what Chris was pointing you at) hasn't been needed for about 12 months. Certainly finding and installing that needs a bit of work, but it isn't needed any more. Life was harder a year ago. So what? Be grateful for all the work done by people who made it better. Please stop perpetuating the myth that it's hard to install libraries on Windows. It was in the past, sure. And there's a lot of out of date information on the web. No-one who works on Python or its packaging ecosystem can magically remove outdated information from the web. But we *can* expect people to be careful not to trust out of date information[1]. And by "out of date", think "over a year old". Pygame wheels were available on PyPI about a year ago, and the official docs at packaging.python.org and docs.python.org have been saying "do python -m pip install XXX" for at least as long. Nowadays, python -m pip install XXX just works, for 99% of things anyone wants. In particular it works for pygame. Continuing to complain about a situation that has been resolved for a year or more is fairly dismissive of the huge amount of work that a lot of people have put in, free of charge, to improve Python's packaging ecosystem over the last few years. Paul [1] If you were buying a new graphics card for your PC, would you rely on reviews from 2 years ago? How about a new phone? And software changes a lot faster than hardware... -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 18:42, Chris Angelico wrote:
On Fri, Jan 12, 2018 at 5:33 AM, bartc wrote:
Well, that seemed to do something, and it didn't need me to download any
.whl files. But then I noticed a bunch of errors culminating with:
"Command python setup.py egg_info failed with error code 1 in
C:\Users\user\AppData\Local\Temp\pip_build_user\pygame"
If you've broken your pip in some way, we won't be able to help you
debug it with just this. Figure out why your Python 3.6 doesn't have a
working pip, because that IS the normal and obvious thing to do.
I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled
it, this time with the 'set environment variables' option (to allow
'pip' to be typed from anywhere).
It still didn't work. I hid all the other Pythons. Same thing.
The following is the transcript. What is this "Setup" file of which it
speaks?
-
c:\python37>pip install pygame
Collecting pygame
Using cached pygame-1.9.3.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "", line 1, in
File
"C:\Users\user\AppData\Local\Temp\pip-build-_pte0jsi\pygame\setup.py",
line 165, in
le>
extensions = read_setup_file('Setup')
File "c:\python37\lib\distutils\extension.py", line 171, in
read_setup_file
line = expand_makefile_vars(line, vars)
File "c:\python37\lib\distutils\sysconfig.py", line 407, in
expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: can only concatenate str (not "NoneType") to str
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\user\AppData\Local\Temp\pip-
build-_pte0jsi\pygame\
c:\python37>
-
--
bartc
--
https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11 January 2018 at 19:51, bartc wrote: > I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, > this time with the 'set environment variables' option (to allow 'pip' to be > typed from anywhere). Stop trolling. Python 3.7 final hasn't been released yet. OF COURSE you will hit problems. Paul -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 6:51 AM, bartc wrote: > On 11/01/2018 18:42, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 5:33 AM, bartc wrote: > > >>> Well, that seemed to do something, and it didn't need me to download any >>> .whl files. But then I noticed a bunch of errors culminating with: >>> >>> "Command python setup.py egg_info failed with error code 1 in >>> C:\Users\user\AppData\Local\Temp\pip_build_user\pygame" >> >> >> If you've broken your pip in some way, we won't be able to help you >> debug it with just this. Figure out why your Python 3.6 doesn't have a >> working pip, because that IS the normal and obvious thing to do. > > > I downloaded Python 3.7. It didn't work. Where from? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 19:41, Paul Moore wrote: On 11 January 2018 at 18:33, bartc wrote: python -m pip install XXX just works, for 99% of things anyone wants. In particular it works for pygame. Continuing to complain about a situation that has been resolved for a year or more I tried that on my brand-new, just installed Python 3.7. It didn't work as detailed in my other post. Please don't assume that because it works for you, that it MUST work for everyone, and that they must be doing something wrong if it doesn't. Apparently it's missing a file called 'Setup'. Is it my fault if it can't find it? Or if it insists on continuing to install something even when some vital component is missing. -- bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 7:02 AM, bartc wrote: > On 11/01/2018 19:41, Paul Moore wrote: >> >> On 11 January 2018 at 18:33, bartc wrote: > > >> python -m pip install XXX >> >> just works, for 99% of things anyone wants. In particular it works for >> pygame. >> >> Continuing to complain about a situation that has been resolved for a >> year or more > > > I tried that on my brand-new, just installed Python 3.7. It didn't work as > detailed in my other post. > > Please don't assume that because it works for you, that it MUST work for > everyone, and that they must be doing something wrong if it doesn't. > > Apparently it's missing a file called 'Setup'. Is it my fault if it can't > find it? Or if it insists on continuing to install something even when some > vital component is missing. > Most people would use the latest STABLE RELEASE of a language, if they expect it to be stable. Unreleased versions, alphas, and so on, may be very useful, but should not be expected to work perfectly with all third-party modules. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 20:12, Chris Angelico wrote: On Fri, Jan 12, 2018 at 7:02 AM, bartc wrote: On 11/01/2018 19:41, Paul Moore wrote: On 11 January 2018 at 18:33, bartc wrote: python -m pip install XXX just works, for 99% of things anyone wants. In particular it works for pygame. Continuing to complain about a situation that has been resolved for a year or more I tried that on my brand-new, just installed Python 3.7. It didn't work as detailed in my other post. Please don't assume that because it works for you, that it MUST work for everyone, and that they must be doing something wrong if it doesn't. Apparently it's missing a file called 'Setup'. Is it my fault if it can't find it? Or if it insists on continuing to install something even when some vital component is missing. Most people would use the latest STABLE RELEASE of a language, if they expect it to be stable. Unreleased versions, alphas, and so on, may be very useful, but should not be expected to work perfectly with all third-party modules. >> I downloaded Python 3.7. It didn't work. > > Where from? I found it at www.python.org. (in /downloads/windows). Although it said 'latest' release was 3.6.4, it didn't say anything about 3.7 being alpha or beta release. I chose 3.7 as I didn't want to uninstall 3.6 or risk any cross-contamination from it if it had issues. But I've since installed 3.6.4, replacing my 3.6.1, and that finally works, in installing pygame. As I said however, it was a bigger obstacle than actually programming any graphics, and has taken up nearly half the thread. It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' does really so leading edge?), and finally worked on a brand-new 3.6. (But still no trace of that mysterious "Setup" file.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On ons, jan 10, 2018 at 01:40:28 +0100, Jan Erik Moström wrote: > I'm looking for a really easy to use graphic library. The target users are > teachers who have never programmed before and is taking a first (and > possible last) programming course. > I do a two day workshop for design and illustration students once a year and use Processing (https://processing.org) for it. It's a programming tool primarly for visual artists. The original version uses a subset of Java but there is also a python mode (https://py.processing.org). I've found it quite appropriate for an educational setting. regards, Oivvio -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 1/11/2018 8:51 PM, bartc wrote: I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, this time with the 'set environment variables' option (to allow 'pip' to be typed from anywhere). You can't expect that people provide binary installers for Python versions that are alpha. Why not try a released version? You can see on https://pypi.python.org/pypi/Pygame that there are wheels for e.g. Python 3.6, 3.5, 3.4, 2.7. Other versions will be built from sources and this is certainl more complicated... (I have not tried it myself. There might be dependencies to other binaries like a SDL binary installation.) Regards, Dietmar -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 7:34 AM, bartc wrote: > On 11/01/2018 20:12, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 7:02 AM, bartc wrote: >>> >>> On 11/01/2018 19:41, Paul Moore wrote: On 11 January 2018 at 18:33, bartc wrote: >>> >>> >>> python -m pip install XXX just works, for 99% of things anyone wants. In particular it works for pygame. Continuing to complain about a situation that has been resolved for a year or more >>> >>> >>> >>> I tried that on my brand-new, just installed Python 3.7. It didn't work >>> as >>> detailed in my other post. >>> >>> Please don't assume that because it works for you, that it MUST work for >>> everyone, and that they must be doing something wrong if it doesn't. >>> >>> Apparently it's missing a file called 'Setup'. Is it my fault if it can't >>> find it? Or if it insists on continuing to install something even when >>> some >>> vital component is missing. >>> >> >> Most people would use the latest STABLE RELEASE of a language, if they >> expect it to be stable. Unreleased versions, alphas, and so on, may be >> very useful, but should not be expected to work perfectly with all >> third-party modules. > > > >>> I downloaded Python 3.7. It didn't work. >> >> Where from? > > I found it at www.python.org. (in /downloads/windows). Although it said > 'latest' release was 3.6.4, it didn't say anything about 3.7 being alpha or > beta release. So: 1) You ignore the homepage download link 2) You ignore the /downloads/ info 3) You ignore the fact that the version number is 3.7.0a4 4) You didn't actually go to https://www.python.org/downloads/release/python-370a4/ where you would have seen that it's a preview. > It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' does > really so leading edge?), and finally worked on a brand-new 3.6. In case you haven't figured it out by now, pygame has different builds to work with different versions. So what you're saying is: "Wow, the pygame people are lazy idiots who haven't made things easy for me to use an unreleased version of Python. What a train-wreck Python is, when third-party packages aren't ready months in advance of a new release." ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Thursday, January 11, 2018 at 8:34:30 PM UTC, bartc wrote: > On 11/01/2018 20:12, Chris Angelico wrote: > > On Fri, Jan 12, 2018 at 7:02 AM, bartc wrote: > >> On 11/01/2018 19:41, Paul Moore wrote: > >>> > >>> On 11 January 2018 at 18:33, bartc wrote: > >> > >> > >>> python -m pip install XXX > >>> > >>> just works, for 99% of things anyone wants. In particular it works for > >>> pygame. > >>> > >>> Continuing to complain about a situation that has been resolved for a > >>> year or more > >> > >> > >> I tried that on my brand-new, just installed Python 3.7. It didn't work as > >> detailed in my other post. > >> > >> Please don't assume that because it works for you, that it MUST work for > >> everyone, and that they must be doing something wrong if it doesn't. > >> > >> Apparently it's missing a file called 'Setup'. Is it my fault if it can't > >> find it? Or if it insists on continuing to install something even when some > >> vital component is missing. > >> > > > > Most people would use the latest STABLE RELEASE of a language, if they > > expect it to be stable. Unreleased versions, alphas, and so on, may be > > very useful, but should not be expected to work perfectly with all > > third-party modules. > > > >> I downloaded Python 3.7. It didn't work. > > > > Where from? > > I found it at www.python.org. (in /downloads/windows). Although it said > 'latest' release was 3.6.4, it didn't say anything about 3.7 being alpha > or beta release. > >From [1] the title is "[RELEASE] Python 3.7.0a4 is now available for testing". The full text is:- Python 3.7.0a4 is the last of four planned alpha releases of Python 3.7, the next feature release of Python. During the alpha phase, Python 3.7 remains under heavy development: additional features will be added and existing features may be modified or deleted. Please keep in mind that this is a preview release and its use is not recommended for production environments. The next preview release, 3.7.0b1, is planned for 2018-01-29. You can find Python 3.7.0a4 and more information here: https://www.python.org/downloads/release/python-370a4/ The link is dated Tue Jan 9 10:48:01 EST 2018, two whole days ago. [1]https://mail.python.org/pipermail/python-list/2018-January/729985.html -- Kindest regards. Mark Lawrence. -- https://mail.python.org/mailman/listinfo/python-list
PSF grant for "Shed Skin" to python 3.x?
Hi folks. Is anyone on the list familiar with the process of getting a Python Software Foundation grant awarded to a worthy project? And with what's generally considered "worthy"? I found https://www.python.org/psf/records/board/resolutions/ , but almost all of the grants seem to be for conferences, and other "peopley" recipients. But ISTR hearing that PSF grants are available for porting code to Python 3. I find Shed Skin, the implicitly-static Python2 -> C++ transpiler pretty interesting. Shedskin is at https://github.com/shedskin/shedskin ISTR that shed skin can be used for entire programs, but probably where it really shines is in taking your CPython critical section and turning it into an extension module that runs at near-C++ speed with minimal tweaking. I realize microbenchmarks aren't good indicators of the performance of a large, complex software system, but still, the fact that shed skin did so well in: http://strombrg.blogspot.com/2015/05/python-compared-to-c-machine.html ...suggests to me that we don't want it to be a casualty of the move from 2.x to 3.x. On that microbenchmark at least, shed skin outperformed pypy, cython (both manifestly typed and implicitly typed) and numba, and was just slightly slower than hand-written C++. Furthermore it appears to be the most practical of the handful of Python -> C++ transpilers available, other than it still being 2.x-only. So my question is: With a suitably written grant proposal and reasonable budget, might a PSF grant be available to help the (quite busy) author of shedskin, to get it contending with 3.x syntax, 3.x semantics and 3.x extension module API? Thanks! PS: I know we could just write a grant and see how it goes, but I'm hoping to get a "yes, that's the sort of thing PSF grants are for" before we put the time into writing the grant proposal. -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 20:53, Chris Angelico wrote: On Fri, Jan 12, 2018 at 7:34 AM, bartc wrote: It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' does really so leading edge?), and finally worked on a brand-new 3.6. In case you haven't figured it out by now, pygame has different builds to work with different versions. So what you're saying is: "Wow, the pygame people are lazy idiots who haven't made things easy for me to use an unreleased version of Python. What a train-wreck Python is, when third-party packages aren't ready months in advance of a new release." "pygame for Python version 3.7 and later not ready." or: "Can't find pygame distribution for Python 3.7." If this works by accessing the right version of a .whl file, then it might guess something is amiss if there isn't one available for 3.7. But the error message for 'pip install pygame' on 3.7 was roughly the same as on 3.4. As I understand it, pygame is just another add-on, which doesn't inherently need to use .whl format, and which doesn't inherently need to use 'pip' package installer. I even saw somewhere that you needed to use 'pip install wheel' in order to use .whl. So there are two extraneous package systems to contend with, which themselves need to be the correct versions, before it can even start thinking about installing the product you really want. And pygame itself, as I think was mentioned, is largely a wrapper around SDL. SDL for Windows can come prebuilt as a handful of .dll shared libraries. But a wrapper that presumably isn't written in Python, for the most part, according to the preponderance of .pyd modules. Its implementation is messy, and its distribution seems rather more elaborate (when the magic doesn't work and things go wrong) than is necessary. -- bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 9:21 AM, bartc wrote: > On 11/01/2018 20:53, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 7:34 AM, bartc wrote: > > >>> It failed on my 3.6, it failed on 3.4, it failed on 3.7 (is what 'pip' >>> does >>> really so leading edge?), and finally worked on a brand-new 3.6. >> >> >> In case you haven't figured it out by now, pygame has different builds >> to work with different versions. So what you're saying is: >> >> "Wow, the pygame people are lazy idiots who haven't made things easy >> for me to use an unreleased version of Python. What a train-wreck >> Python is, when third-party packages aren't ready months in advance of >> a new release." > > > "pygame for Python version 3.7 and later not ready." > > or: > > "Can't find pygame distribution for Python 3.7." > > If this works by accessing the right version of a .whl file, then it might > guess something is amiss if there isn't one available for 3.7. > > But the error message for 'pip install pygame' on 3.7 was roughly the same > as on 3.4. > > As I understand it, pygame is just another add-on, which doesn't inherently > need to use .whl format, and which doesn't inherently need to use 'pip' > package installer. I even saw somewhere that you needed to use 'pip install > wheel' in order to use .whl. > > So there are two extraneous package systems to contend with, which > themselves need to be the correct versions, before it can even start > thinking about installing the product you really want. > > And pygame itself, as I think was mentioned, is largely a wrapper around > SDL. SDL for Windows can come prebuilt as a handful of .dll shared > libraries. But a wrapper that presumably isn't written in Python, for the > most part, according to the preponderance of .pyd modules. Its > implementation is messy, and its distribution seems rather more elaborate > (when the magic doesn't work and things go wrong) than is necessary. > More FUD. Especially when you preface something with "I even saw somewhere". No reference, and it's not something from official documentation. You're citing a potentially-outdated third-party document, and ignoring context (like "you need to 'pip install wheel' to take advantage of wheel caching" which is not nearly as bad as you're implying). You said yourself that when you used Python 3.6 (the latest stable release, at time of writing), everything just worked. Why are you still complaining? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Tips or strategies to understanding how CPython works under the hood
> So besides just grabbing a chunk of CPython source code and digesting it, I > was wondering if those of you have read and understood the source code, do > you have any tips or good starting points? Not mentioned yet, but maybe worth considering, might be to dip into the way back machine and start with a much earlier version of Python, maybe 1.5.2 or 2.0. The basic structure of the system is still there, but without much of the complexity which came along with more recent changes. No Unicode, types and classes were still separate, the bytecode interpreter was much simpler, many types were simpler. Once you have the basic foundation, pick something which has changed significantly, and make a deep dive into it. Skip -- https://mail.python.org/mailman/listinfo/python-list
Re: Tips or strategies to understanding how CPython works under the hood
On Fri, Jan 12, 2018 at 9:52 AM, Skip Montanaro wrote: >> So besides just grabbing a chunk of CPython source code and digesting it, I >> was wondering if those of you have read and understood the source code, do >> you have any tips or good starting points? > > Not mentioned yet, but maybe worth considering, might be to dip into > the way back machine and start with a much earlier version of Python, > maybe 1.5.2 or 2.0. The basic structure of the system is still there, > but without much of the complexity which came along with more recent > changes. No Unicode, types and classes were still separate, the > bytecode interpreter was much simpler, many types were simpler. > > Once you have the basic foundation, pick something which has changed > significantly, and make a deep dive into it. Hmm. While I see the value in that, I think there's more value in testing what's actually familiar. Work with the current version, and tinker with it while you explore it. Unicode text, particularly, is worth hanging onto. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 22:32, Chris Angelico wrote: On Fri, Jan 12, 2018 at 9:21 AM, bartc wrote: As I understand it, pygame is just another add-on, which doesn't inherently need to use .whl format, and which doesn't inherently need to use 'pip' package installer. I even saw somewhere that you needed to use 'pip install wheel' in order to use .whl. So there are two extraneous package systems to contend with, which themselves need to be the correct versions, before it can even start thinking about installing the product you really want. More FUD. Especially when you preface something with "I even saw somewhere". No reference, and it's not something from official documentation. Why, you don't believe me? It was here: http://www.pygame.org/download.shtml, the last comment under 1.9.3. You're citing a potentially-outdated third-party document, and ignoring context (like "you need to 'pip install wheel' to take advantage of wheel caching" which is not nearly as bad as you're implying). What have pip and wheels got to do with pygame? Nothing. You said yourself that when you used Python 3.6 (the latest stable release, at time of writing), everything just worked. Why are you still complaining? I like exploring complexity, and the gratuitous use of it. The subject is a Simple graphic library, for a language which is widely regarded (erroneously IMO) as also being simple. -- bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 10:11 AM, bartc wrote: > On 11/01/2018 22:32, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 9:21 AM, bartc wrote: > > >>> As I understand it, pygame is just another add-on, which doesn't >>> inherently >>> need to use .whl format, and which doesn't inherently need to use 'pip' >>> package installer. I even saw somewhere that you needed to use 'pip >>> install >>> wheel' in order to use .whl. >>> >>> So there are two extraneous package systems to contend with, which >>> themselves need to be the correct versions, before it can even start >>> thinking about installing the product you really want. > > >> More FUD. Especially when you preface something with "I even saw >> somewhere". No reference, and it's not something from official >> documentation. > > > Why, you don't believe me? It was here: > http://www.pygame.org/download.shtml, the last comment under 1.9.3. You didn't say that in your first email, so no, I don't believe it until I get a citation. "I even saw somewhere" is pure FUD, whether there's something to back it or not. How is anyone supposed to know whether it's true or not? What you're reading is a comment that, instead of downloading this way, you can simply use pip to get pygame. Which is what you should be doing. > You're citing a potentially-outdated third-party >> >> document, and ignoring context (like "you need to 'pip install wheel' >> to take advantage of wheel caching" which is not nearly as bad as >> you're implying). > > > What have pip and wheels got to do with pygame? Nothing. They're the easiest and best way to install stuff. >> You said yourself that when you used Python 3.6 (the latest stable >> release, at time of writing), everything just worked. Why are you >> still complaining? > > > I like exploring complexity, and the gratuitous use of it. > > The subject is a Simple graphic library, for a language which is widely > regarded (erroneously IMO) as also being simple. I'm almost ready to plonk you, but I think there is still SOME value in your posts. But please, stop denigrating what you don't understand. Take an attitude that there is logic and value in things even when you don't understand them yet. Do you realize how insulting you are being to the people who have put INSANE amounts of work into improving Python packaging and making it easy to install things? ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 2018-01-11 23:11, bartc wrote: On 11/01/2018 22:32, Chris Angelico wrote: On Fri, Jan 12, 2018 at 9:21 AM, bartc wrote: As I understand it, pygame is just another add-on, which doesn't inherently need to use .whl format, and which doesn't inherently need to use 'pip' package installer. I even saw somewhere that you needed to use 'pip install wheel' in order to use .whl. So there are two extraneous package systems to contend with, which themselves need to be the correct versions, before it can even start thinking about installing the product you really want. More FUD. Especially when you preface something with "I even saw somewhere". No reference, and it's not something from official documentation. Why, you don't believe me? It was here: http://www.pygame.org/download.shtml, the last comment under 1.9.3. I think the "wheel" might just be a placeholder for the name of the wheel itself. Anyway, it's available on PyPI as a wheel, so you can use pip. To install on Python 3.6 from PyPI, it's: py -3.6 -m pip pygame from the command line. You're citing a potentially-outdated third-party document, and ignoring context (like "you need to 'pip install wheel' to take advantage of wheel caching" which is not nearly as bad as you're implying). What have pip and wheels got to do with pygame? Nothing. They are a way to install it. You said yourself that when you used Python 3.6 (the latest stable release, at time of writing), everything just worked. Why are you still complaining? I like exploring complexity, and the gratuitous use of it. The subject is a Simple graphic library, for a language which is widely regarded (erroneously IMO) as also being simple. -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
bartc wrote: I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, this time with the 'set environment variables' option (to allow 'pip' to be typed from anywhere). I suspect some of your problems might have been caused by 'pip' not using the Python you thought it was using. If you have multiple versions of Python floating around, it's hard to be sure exactly which version a bare 'pip' command is going to use. I recommend making it explicit by doing this instead: \python.exe -m pip install ... -- Greg -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
Ned Batchelder wrote: so "pip install pygame" should work. Some people seem so determined to dislike a thing, they cannot be convinced there are solutions to their problems. But it clearly didn't work for bartc at first, and the error messages he got didn't make it at all clear why. You can't blame him for that. My theory is that his 'pip' command was picking up some version of Python other than 3.4 or 3.6, and when he re-installed 3.6, it changed his path so that it now referred to the 3.6 version of pip. Seems to me it would help if pip were to announce which version of Python it's installing things into. And instead of just saying "not compatible with this version of Python", say "not compatible with Python X.Y.Z". That would make these kinds of problems much easier to diagnose. -- Greg -- https://mail.python.org/mailman/listinfo/python-list
Re: Tips or strategies to understanding how CPython works under the hood
Robert O'Shea wrote: I wrote a little bytecode interpreter in C (maybe should have upgrade to C++ but not yet) Don't feel bad about that -- IMO, C is perfectly fine for tnis kind of thing, and "upgrading" to C++ would gain you nothing while introducing extra headaches. -- Greg -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, 12 Jan 2018 05:42:03 +1100, Chris Angelico wrote: > On Fri, Jan 12, 2018 at 5:33 AM, bartc wrote: [...] >> Except my Python 3.6 doesn't have pip. There is a however a copy in my >> Python 3.4. But that gives me the message: > > Why doesn't it? Recent Pythons should include pip by default. Not quite. Recent Pythons include "ensure pip" by default, which is a private version of pip which is intended to do nothing but install the latest version of pip. > If you've broken your pip in some way, we won't be able to help you > debug it with just this. Figure out why your Python 3.6 doesn't have a > working pip, because that IS the normal and obvious thing to do. Just because you have installed Python doesn't mean that pip will be automatically installed and `pip ...` work from the shell. There's also the problem that while you can easily install multiple versions of Python without them clashing, the same doesn't apply to "pip". How do you know which version of Python `pip install foo` will use? How do I choose the version pip will install into? [not rhetorical questions] Don't say "use venv", because using a virtual environment shouldn't be a prerequisite for using pip. How do I deal with permissions errors? [semi-rhetorical question -- I know *an* answer, but I don't know if it is the *right* answer] I keep hearing people say that pip is the greatest thing since sliced bread, but my own personal experience with it is that installing pip is only half the battle. If it works for you, great -- but some of us have had so many problems getting pip to work that we've gone back to just installing from source. (Admittedly installing from source is probably harder for Windows users than Linux users.) -- Steve -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 11:57 AM, Steven D'Aprano wrote: > On Fri, 12 Jan 2018 05:42:03 +1100, Chris Angelico wrote: > >> On Fri, Jan 12, 2018 at 5:33 AM, bartc wrote: > [...] >>> Except my Python 3.6 doesn't have pip. There is a however a copy in my >>> Python 3.4. But that gives me the message: >> >> Why doesn't it? Recent Pythons should include pip by default. > > Not quite. > > Recent Pythons include "ensure pip" by default, which is a private > version of pip which is intended to do nothing but install the latest > version of pip. True, but a fresh installation on Windows is supposed to let you just leave the box ticked and it runs ensurepip so you have pip. >> If you've broken your pip in some way, we won't be able to help you >> debug it with just this. Figure out why your Python 3.6 doesn't have a >> working pip, because that IS the normal and obvious thing to do. > > Just because you have installed Python doesn't mean that pip will be > automatically installed and `pip ...` work from the shell. > > There's also the problem that while you can easily install multiple > versions of Python without them clashing, the same doesn't apply to "pip". > > How do you know which version of Python `pip install foo` will use? How > do I choose the version pip will install into? [not rhetorical questions] > Don't say "use venv", because using a virtual environment shouldn't be a > prerequisite for using pip. The recommendation was already given to use "python3 -m pip". That gets around those problems. > How do I deal with permissions errors? [semi-rhetorical question -- I > know *an* answer, but I don't know if it is the *right* answer] That's a fair point, but a perms error is reported properly by pip. How do you deal with it? First you recognize that there's a problem. Nothing in this thread suggested that there were perms problems to deal with. > I keep hearing people say that pip is the greatest thing since sliced > bread, but my own personal experience with it is that installing pip is > only half the battle. > > If it works for you, great -- but some of us have had so many problems > getting pip to work that we've gone back to just installing from source. > > (Admittedly installing from source is probably harder for Windows users > than Linux users.) Correct. On Windows, I don't know of ANYONE who installs packages from source who is not already a Python developer. You don't just revert to source when pip starts having issues. I wouldn't say that pip is perfect - there are certainly a number of issues with it (some of which are NOT issues with similar programs like npm (Node), gem (Ruby), etc - so there's things pip can perhaps learn from them) - but it is far easier than the Windows alternative, which is "track down a binary, make sure it matches your Python, and then install it". (Pure Python packages are much easier, but pygame is an extension and has to be compiled. So do many others.) Compiling software from source is reasonably common among Linux users, so it's unsurprising for us to go "oh, I need those dev libraries". When I wanted to spin up Jekyll to do local testing prior to pushing stuff to GitHub Pages, I followed the directions, then got an error that required me to install the Ruby dev headers, and that didn't faze me. But if someone on Windows had the same problem, it'd likely be a much bigger deal - firstly because you can't just "sudo apt install ruby-dev", and secondly because Windows systems usually don't have a C compiler installed. I'm massively overgeneralizing here, but if you were to poll a thousand Linux users and a thousand Windows users, you'd find a far higher proportion of the former are comfortable building random software from source. But even with that caveat, I still think pip is worth using *on Linux*. For your system Python, use your system package manager; for a Python installed from source, use pip. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 11/01/2018 23:23, Chris Angelico wrote: On Fri, Jan 12, 2018 at 10:11 AM, bartc wrote: I'm almost ready to plonk you, but I think there is still SOME value in your posts. But please, stop denigrating what you don't understand. And please try to see things from the pointer of view of a beginner or outsider, where anything to do with Python seems to have a bewildering and conflicting array of solutions. -- bartc -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, Jan 12, 2018 at 12:21 PM, bartc wrote: > On 11/01/2018 23:23, Chris Angelico wrote: >> >> On Fri, Jan 12, 2018 at 10:11 AM, bartc wrote: > > >> I'm almost ready to plonk you, but I think there is still SOME value >> in your posts. But please, stop denigrating what you don't understand. > > > And please try to see things from the pointer of view of a beginner or > outsider, where anything to do with Python seems to have a bewildering and > conflicting array of solutions. > You mean the sort of person who goes to the front page and sees just two options, 2.7 and 3.6, and won't see anything about 3.7 until it's released? Again, a number of people have put in a lot of hours to make that easy. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 1/11/18 8:21 PM, bartc wrote: On 11/01/2018 23:23, Chris Angelico wrote: On Fri, Jan 12, 2018 at 10:11 AM, bartc wrote: I'm almost ready to plonk you, but I think there is still SOME value in your posts. But please, stop denigrating what you don't understand. And please try to see things from the pointer of view of a beginner or outsider, where anything to do with Python seems to have a bewildering and conflicting array of solutions. Bart, we get it. You don't like Python, it doesn't work the way you expect. While I appreciate your optimism at continuing to try it, please just stop. We don't need yet another thread where you try things, and they don't work, and we try to explain it, and you tell us it's too complicated and could be simpler. We've heard it all before, and it doesn't get us anywhere, and it doesn't educate anybody. The Python packaging ecosystem is complex, it's true. You don't need to use it. You'll be happier with other things. Everyone else: please resist the temptation to argue with Bart about these things. It's not doing anyone any good. --Ned. -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 1/11/2018 2:51 PM, bartc wrote: I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, this time with the 'set environment variables' option (to allow 'pip' to be typed from anywhere). The recommended way to run pip and similar python code is -m pip install xyz where invokes a specific python binary on the particular machine. For example, on Windows 10 with amd64 binaries installed. C:\Users\Terry>py -3.6 -m pip install pygame Collecting pygame Downloading pygame-1.9.3-cp36-cp36m-win_amd64.whl (4.2MB) 100% || 4.2MB 267kB/s Installing collected packages: pygame Successfully installed pygame-1.9.3 Notice the name of the .whl file!!! It still didn't work. I hid all the other Pythons. Same thing. The following is the transcript. c:\python37>pip install pygame Collecting pygame Using cached pygame-1.9.3.tar.gz I believe that this is a compressed source archive that requires a C compiler for any C files. Mainly intended for *nix, not Windows. Pip should only try it after failing to find the proper .whl. Since pygame wraps a C library, but expects Windows users to use a specific .whl, I would not expect the .tar.gz to work on Windows even if you had the required Microsoft C++ compiler. The pygame people have not yet put a 3.7 windows .whl file on PyPI. There *is* a 3.7 pygame .whl pygame‑1.9.3‑cp37‑cp37m‑win_amd64.whl with Windows binaries at the site previously recommended in this thread: https://www.lfd.uci.edu/~gohlke/pythonlibs/ It can be downloaded manually and installed with a variant pip command, as explained at the top of the page. (C. Gohlke does us a great service by providing test binaries while a version is still in development.) > What is this "Setup" file of which it speaks? A file with info needed to compile C files and then install everything. Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 1/11/2018 3:34 PM, Dietmar Schwertberger wrote: On 1/11/2018 8:51 PM, bartc wrote: I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, this time with the 'set environment variables' option (to allow 'pip' to be typed from anywhere). You can't expect that people provide binary installers for Python versions that are alpha. In fact, https://www.lfd.uci.edu/~gohlke/pythonlibs/ does have such for 3.7, 'as is', for the adventurous or the proactive, for perhaps half of 100s of packages covered there. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 1/11/2018 6:35 PM, Gregory Ewing wrote: bartc wrote: I downloaded Python 3.7. It didn't work. I uninstalled and reinstalled it, this time with the 'set environment variables' option (to allow 'pip' to be typed from anywhere). I suspect some of your problems might have been caused by 'pip' not using the Python you thought it was using. If you have multiple versions of Python floating around, it's hard to be sure exactly which version a bare 'pip' command is going to use. I recommend making it explicit by doing this instead: \python.exe -m pip install ... On Windows, the easy and recommended way to be 'explicit' is, at worst, 'py -x.y'. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: PSF grant for "Shed Skin" to python 3.x?
On 1/11/2018 4:49 PM, Dan Stromberg wrote: Hi folks. Is anyone on the list familiar with the process of getting a Python Software Foundation grant awarded to a worthy project? And with what's generally considered "worthy"? The best people to answer that are the grants committee. Is there anything on the site about the form of a grant application? I found https://www.python.org/psf/records/board/resolutions/ , but almost all of the grants seem to be for conferences, and other "peopley" recipients. There have been a few software grants, I believe in the 5k-10k range. But ISTR hearing that PSF grants are available for porting code to Python 3. I find Shed Skin, the implicitly-static Python2 -> C++ transpiler pretty interesting. Shedskin is at https://github.com/shedskin/shedskin ISTR that shed skin can be used for entire programs, but probably where it really shines is in taking your CPython critical section and turning it into an extension module that runs at near-C++ speed with minimal tweaking. I realize microbenchmarks aren't good indicators of the performance of a large, complex software system, but still, the fact that shed skin did so well in: http://strombrg.blogspot.com/2015/05/python-compared-to-c-machine.html ...suggests to me that we don't want it to be a casualty of the move from 2.x to 3.x. On that microbenchmark at least, shed skin outperformed pypy, cython (both manifestly typed and implicitly typed) and numba, and was just slightly slower than hand-written C++. Furthermore it appears to be the most practical of the handful of Python -> C++ transpilers available, other than it still being 2.x-only. So my question is: With a suitably written grant proposal and reasonable budget, might a PSF grant be available to help the (quite busy) author of shedskin, to get it contending with 3.x syntax, 3.x semantics and 3.x extension module API? Thanks! PS: I know we could just write a grant and see how it goes, but I'm hoping to get a "yes, that's the sort of thing PSF grants are for" before we put the time into writing the grant proposal. Unless you get better information, I suggest a one page summary, expanding on the above, with an initial estimate of time/money, asking "Can this be considered? If so, what do you want to see?" I doubt they want the sort of 20+page monstrosity required by the US National Science Foundation. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, 12 Jan 2018 12:14:03 +1100, Chris Angelico wrote: > On Fri, Jan 12, 2018 at 11:57 AM, Steven D'Aprano > wrote: [...] >> Recent Pythons include "ensure pip" by default, which is a private >> version of pip which is intended to do nothing but install the latest >> version of pip. > > True, but a fresh installation on Windows is supposed to let you just > leave the box ticked and it runs ensurepip so you have pip. Ah, didn't know that. Thanks. [...] >> How do you know which version of Python `pip install foo` will use? How >> do I choose the version pip will install into? [not rhetorical >> questions] Don't say "use venv", because using a virtual environment >> shouldn't be a prerequisite for using pip. > > The recommendation was already given to use "python3 -m pip". That gets > around those problems. If you google for installation instructions, they're nearly always given in terms of "use pip", not "use python3.4 -m pip". My point isn't that there is *no* solution to this problem, but that its not necessarily an *obvious* solution. [...] >> How do I deal with permissions errors? [semi-rhetorical question -- I >> know *an* answer, but I don't know if it is the *right* answer] > > That's a fair point, but a perms error is reported properly by pip. Is it? Last time I tried, I just got an uninformative error that the package installation failed. Admittedly that was probably a year or two ago, so maybe the error message has been improved. > How > do you deal with it? First you recognize that there's a problem. Nothing > in this thread suggested that there were perms problems to deal with. Indeed. For somebody who claims to be such an experienced developer, Bart is sure dedicated to the ideas that: 1. you ought to be able to install software without knowing anything at all about the operating system, the software being installed, or the installer. 2. If you run into an installation problem, it means the programming language sucks, not that you've done something wrong. 3. And you absolutely *shouldn't* ask for help or give sufficient details of what went wrong to allow others to diagnose the fault. Instead you should just *hint* at the error and make it out to be a systematic problem with the language itself. "Make it easy to install it" -- I'm 100% in agreement with that. "A literal brain-damaged monkey in a coma should be able to install it" -- not so much. -- Steve -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On 10 Jan 2018, at 13:40, Jan Erik Moström wrote: I'm looking for a really easy to use graphic library. The target users are teachers who have never programmed before and is taking a first (and possible last) programming course. Thanks for all the suggestions, I'm going to take a look at them and see what fits my requirements best. Thanks, = jem -- https://mail.python.org/mailman/listinfo/python-list
Re: Simple graphic library for beginners
On Fri, 12 Jan 2018 12:45:04 +1300, Gregory Ewing wrote: > Seems to me it would help if pip were to announce which version of > Python it's installing things into. And instead of just saying "not > compatible with this version of Python", say "not compatible with Python > X.Y.Z". That would make these kinds of problems much easier to diagnose. This. If pip is joined at the hip to a specific version of Python, I think that we ought to be able to specify the version number like we can with Python. Something like: pip ... # use whichever version of pip comes first on the PATH pip3.6 ... # use the pip installed with Python 3.6 pip2.7 ... # use the pip installed with Python 2.7 etc. And don't say "use a venv" :-) -- Steven D'Aprano -- https://mail.python.org/mailman/listinfo/python-list
