At one of the school where I teach, the IT department is responsible for
configuring all the student and teacher computers. They are the only ones who
have the system passwords.
One of my classrooms is a Mac classroom - the teacher's computer and all the
student computers are Macs (my other
I've been working on porting a game that I wrote in a different
language/environment, and I want to make the Python/PyGame code as efficiently
as possible.
I have code in an object, that triggers an event that should occur, say 1
second later. I used pygame.set_timer, created an ID and set
by having some of my objects
have a handle_vents method in them already.
Gumm: Thank you for the links to your code. I've started looking at those,
and I'll see what I can learn/borrow from them.
Thanks,
Irv
> On Feb 10, 2017, at 5:30 PM, Irv Kalb <i...@furrypants.com> wrote:
>
I teach Python programming at two different universities. At one of my
schools, there is enough time for students to do a final project. I give them
a background in event-driven programming, give them an overview in PyGame, and
encourage them to build a small PyGame based project.
I have
erview.html
> Examples : http://thorpy.org/examples.html
> Tutorials : http://thorpy.org/tutorials.html
>
> Cheers,
>
> Yann
>
> De : owner-pygame-us...@seul.org <owner-pygame-us...@seul.org> de la part de
> Irv Kalb <i...@furrypa
Hi,
First time poster. I hope I'm doing this correctly.
I teach Python at colleges in the San Francisco Bay Area. And I have been
using Python and pygame for a number of years. ... And I'm a Mac guy. I have
had a stable Python & pygame environment for a number of years. (Using 32 bit
ld be easy ... but it is extremely frustrating that I've spent a few
days trying to get this environment set up.
Irv
> On Dec 29, 2016, at 2:34 PM, Daniel Foerster <pydsig...@gmail.com> wrote:
>
> I'm thinking you should probably throw a sudo on the front of that (or
> whatever
> On Dec 29, 2016, at 8:42 AM, Thomas Kluyver <tak...@gmail.com> wrote:
>
> On 28 December 2016 at 23:41, Irv Kalb <i...@furrypants.com
> <mailto:i...@furrypants.com>> wrote:
> Also, when looking to find the latest version of pygame, on the pygame
>
d
somewhere on the pygame installation page, so that someone with the same set up
as me would not have to go through the same trial and error process.
Irv
> On Dec 30, 2016, at 1:41 PM, Irv Kalb <i...@furrypants.com> wrote:
>
> To try to get pygame 1.9.2 installed easily (without any pa
I have recently been using PyCharm (Mac Community Edition) to develop a
re-usable game module, with Python 2.7 with pygame 1.9.2 (I think?). I started
using the "inspection" tool (on the right edge of the editor window) that looks
for potential errors while in the editor, and generates
an.com> wrote:
>
> On Tue, May 16, 2017 at 5:28 PM, Irv Kalb <i...@furrypants.com
> <mailto:i...@furrypants.com>> wrote:
> 1) What does the error message associated with the: "python3 -m pip install
> pygame -- user " mean?
> Exactly what it s
Thank you for the very quick update!
This will certainly be helpful to people who are trying to install pygame.
Irv
> On May 17, 2017, at 1:23 PM, Thomas Kluyver <tak...@gmail.com> wrote:
>
> On 17 May 2017 at 20:57, Irv Kalb <i...@furrypants.com
> <mailto:i..
er
> by default on windows.
>
> best,
>
>
> On Wed, May 17, 2017 at 1:28 AM, Irv Kalb <i...@furrypants.com
> <javascript:_e(%7B%7D,'cvml','i...@furrypants.com');>> wrote:
> One of the colleges where I teach has made a decision to move from Python 2
> to P
One of the colleges where I teach has made a decision to move from Python 2 to
Python 3. To help the admin's, I was asked to give detailed instructions on
how to install Python 3 and pygame. The school has mostly Windows machines, so
I thought I would try that out first.
I have to admit that
ect semantically to use the os.path conversion.
>
> Regarding the extra dependency, os is built into every distro, so I wouldn't
> worry about it.
>
> On Nov 25, 2017 12:01, "Irv Kalb" <i...@furrypants.com
> <mailto:i...@furrypants.com>> wrote:
> Here's
I have two questions about pygame.image.load. Here's the first:
I use IDLE when I teach classes. But when I am trying to develop something for
myself, I use PyCharm Community Edition. There are many things I like about
PyCharm and one of them is the analysis of errors that is available in
Here's my second question about pygame.image.load. Actually it's a question
about specifying paths in pygame.
In my classes, I talk about the concept of a path for loading images, sounds,
etc. I suggest that students create an "images" folder and if needed, a
"sounds" folder in their project
I have been working on the development of a number of demonstration games using
pygame. I use these as demonstration pieces in classes that I teach.
I do my development on an older Mac using Mac OS X 10.12.6, with Python 3.6.1
and pygame (not sure how to check what version, but fairly recent).
gged into my Mac. I still see the delay on the Mac,
Thanks for asking.
Irv
>
> On Sun, Nov 19, 2017 at 11:29 PM, Irv Kalb <i...@furrypants.com
> <mailto:i...@furrypants.com>> wrote:
>
>> On Nov 18, 2017, at 11:28 PM, Ian Mallett <i...@geometrian.com
>> <
> On Nov 18, 2017, at 11:28 PM, Ian Mallett wrote:
>
> Hi,
>
> FWIW I am unable to reproduce on Win 7 Pro, Py 3.5.1, PyGame 1.9.2a0 (to
> print the latter, `print(pygame.ver)`).
>
> The event system, like everything else, is really just a thin layer over
> SDL's—so for
I am building a game where I am keeping track of many objects in a list (let's
just call it "myList". In every "frame" of my game I need to see if any
objects need to be removed from myList.
I know that this code:
for item in myList:
if needsToBeDeleted(item):
myList.remove(item)
;
> I think what you're looking for is this:
>
> my_list = [x for x in my_list if not need_to_delete(x)]
>
> On Sun, May 20, 2018, 16:28 Irv Kalb <i...@furrypants.com
> <mailto:i...@furrypants.com>> wrote:
> I am building a game where I am keeping track of many obj
nks to Ian for providing algorithmic timing results. Very
informative.
Irv
> On May 20, 2018, at 4:55 PM, Irv Kalb <i...@furrypants.com> wrote:
>
> Thanks very much.
>
> Is there a way to do that without the list comprehension? I'm building this
> as part of a class
Hi,
I'm not sure if you got your question answered already, but here is my
suggestion.
The basic problem with your code is with this line:
clock.tick(1)
That tells pygame that after doing whatever code runs in your loop, it should
wait until a total of 1 second elapses before moving on.
I teach Python programming at different colleges. In my courses I use IDLE
because of the simplicity of use for new programming students.
However, when I'm doing any significant development, I use PyCharm (I'm a big
fan of using a debugger, and I cannot understand or use the debugger in IDLE.)
harm, so it is almost never closed
>
> Using that information, you could maybe create a context menu helper (i'm not
> familar enough with os x to advise how to do that) that launches pycharm with
> the correct path appended to the pycharm launcher.
>
> Hope that helps.
>
> On
a previously created PyCharm project, that
project opens in PyCharm! No scripting needed.
Irv
> On Feb 1, 2018, at 4:54 PM, Irv Kalb <i...@furrypants.com> wrote:
>
> I teach Python programming at different colleges. In my courses I use IDLE
> because of the simplicity of use f
I teach college classes in Python. I currently teach Intro to Python at two
different colleges in Silicon Valley (California).
For about the last two years, I have been working on the development of a new
course (and book). The goal is to teach Object-Oriented Programming using
Python and
Hi Daniel,
Thanks for your comments.
The key user interface classes are in "pygwidgets". In the "pyghelpers"
package, the Timers, the Scene Manager, the Scene base class, and the dialog
box functions can be useful for building games.
Yes, I agree that the File I/O functions are not as
Hi,
I'm hoping the this was not a homework assignment (I am a teacher). But,
because you showed your code, I'll help you out.
Most of your code was fine, but some things were in the wrong place.
The basic idea is that there should be a main loop, and in that loop, you check
for events (key
circle moving
> while the key is pressed. I’ve tried to change some if into while but that
> only gets the program stuck.
>
> The idea should be something like while event.type == pygame.KEYDOWN then
> update the position before drawing the screen. But I don’t see how, yet.
>
> Th
Thanks for the comments. Yes, there are many more variables than just the
score. I just wanted to show one simple example to make the problem
understandable.
I hadn't thought of the extra "Session" object, it sounds like an interesting
approach. However, I'm looking for a clear solution
Hi,
I am teaching an Python object-oriented programming class based on my own
materials. I am using Pygame to explain many OOP concepts. So far its going
very well.
I have built many small games as examples, but I keep running into a design
dilemma. I will often have a class, where I have
:58 AM, e1000 wrote:
>
> hello,
>
> having been a long term Pylint-maintainer, I'd advocate a more flexible
> approach:
>
> On 25/05/2019 20:29, Irv Kalb wrote:
>> The obvious solution is to have the __init__ method call the reset method:
>> class Game:
>
ound like a list police officer, but your question isn't
> really specific to pygame, it's about OOP design and small-scale design
> decisions. IMO, you should be posting it on a site like
> https://cseducators.stackexchange.com/ instead.
>
> On 26.05.19 07:00, Irv Kalb wrote:
&g
HI,
I recently brought up a similar thing on this list a couple of weeks ago. I am
using Python 3.7 with Pygame on my Mac with no problems, but I had heard of
problems with 3.8. Here is a response from Thomas Kluyver to my question:
---
Hi Irv,
If I recall correctly, the issue
Thanks to everyone for the information.
Sounds like the best plan for now, is to get students to use the same setup as
me.
Irv
> On Mar 23, 2020, at 9:52 PM, Irv Kalb wrote:
>
> I teach Python classes (now live online!)
>
> I'm getting to the point in my course where I us
I teach Python classes (now live online!)
I'm getting to the point in my course where I use Pygame, and I want to
encourage my students to download and use it for projects.
I have not upgraded my personal setup for a while. I am using Python 3.7.3
with Pygame 1.9.6 on a Mac, and everything is
> On Sep 17, 2020, at 5:16 AM, Daniel Foerster wrote:
>
> Jan:
>
> Your player moves just once because you are listening for KEYDOWN events to
> move. KEYDOWN is only triggered when you first press a key. You can get the
> behavior you want in two ways.
>
> Option 1: use
I'm updating a class that loads and displays an image - an Image class. The
class also has many additional calls to rotate, scale, show, hide, etc. I'm
using pygame 1.9.6 with Python 3.7.3
I know that I should be converting the original image that is loaded into a
better format for
I am teaching a Python class, where I use pygame to demonstrate OOP concepts.
I need to have my students get the proper environment to run Python with pygame.
I use a Mac, and I have Python 3.7.3, and pygame 1.9.6 installed. Everything
works fine for me. But I have students who either have
install the current version
> > of Python: 3.9, will they be able to use pip to install a working version
> > of pygame 1.9? (Last time I checked, this did not work correctly?
>
> python 3.8 has been tested more time; also 3.9 is not compatible with
> windows7, which maybe
Thanks very much. It's even simpler than I thought.
Irv
> On Jul 11, 2020, at 4:25 PM, Sam Bull wrote:
>
> On Sat, 2020-07-11 at 14:19 -0700, Irv Kalb wrote:
>> is this implemented with a property of a rect object, so it's actually
>> calling
>> a metho
I am doing some writing about Python, and I want to make sure that what I am
about to write is correct.
As an example, in the following, I am creating a pygame rect, then printing the
left and right attributes.
>>> myRect = pygame.Rect(10, 10, 30, 30)
>>> print(myRect.left, myRect.right)
10 40
I have tracked down a huge slowdown on loading fonts with pygame.font.SysFont
Mac OSX 11.2.3
Python 3.9.1
Pygame 2.0.1
If I load a font like the system font using None with a call to
pygame.font.font, it happens almost immediately.
But if I load a font by name using pygame.font.SysFont, it's
[I apologize if this is a duplicate, but I haven't seen this message show up on
the list.]
I have tracked down a huge slowdown on loading fonts with pygame.font.SysFont
Mac OSX 11.2.3
Python 3.9.1
Pygame 2.0.1
If I load a font like the system font using None with a call to
pygame.font.font,
I am developing a game but I'm running into some cases where the game slows
down too much. A few details ...
The game lives in a world whose size is much larger than what the user can see
in the window. (For now, the world is 3000 x 3000, but the window is 640 x 640
- I could decide to
Hi,
Thanks to everyone for the suggestions. Many different things to try out.
I'll probably start by eliminating all my checks and see how that goes first.
Irv
> On Mar 1, 2022, at 3:02 PM, Irv Kalb wrote:
>
> I am developing a game but I'm running into some cases where the g
After about four years of work, my new book "Object-Oriented Python" is finally
out! It's now available at major booksellers including Amazon and through the
publisher, No Starch Press.
The purpose of the book is to explain the techniques involved in
Object-Oriented Programming (OOP) but in
49 matches
Mail list logo