paths in the PYTHONPATH variable.
>
> I honestly would prefer to use Emacs, but I have not found any tool that
> provides code-completion with python. Until I have been using Eclipse (with
> Emacs running minimized :)
>
> -g
>
> -Original Message-
> From:
This thread made me wonder:
Is anyone out there using Eclipse and PyDev? (I started using Eclipse
when I was toying around in Jython, and know others that are using it
for C/C++, but I am curious if others have tried out PyDev and what
they think).
~Denise
Thanks, everyone!
On 8/16/05, Michael Lange <[EMAIL PROTECTED]> wrote:
> On Mon, 15 Aug 2005 22:51:20 -0400
> Kent Johnson <[EMAIL PROTECTED]> wrote:
>
> > I think Luke's suggestion will work if you use f.read() (to read the whole
> > file as a single string) instead of f.readlines() and f.write
Hello guys!
Is there a way to convert a file from plaintext(Ascii) to unicode? I
have found all my notes about moving between hex., int's, chr's,
ord's, etc, but all of these things were only riddle exercises to me
and I have a hard time keeping them straight. I'm pretty sure I knew
the answer t
Peter,
This does make the issue of palettes a lot clearer, thank you.
I'll have to see if it is something I can apply to my present task.
Thanks for your help, everyone!
~Denise
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailma
> Your palette is a LookUp Table (LUT) - it is also named like this in
> your prog ('lut') - which is a 768-long list (or as in this case, a list
> of 256 lists, every inner list has 3 elements - so again you have 768
> elements). So 3x256 or 1x768 is just an implementation detail. Let's see
> the
Hello, everyone!
I am trying to figure out what a palette actually is, how it works,
and what PIL's "putpalette()" does with a given data set (it has to be
a string, I believe). PIL's documentation says very close to nothing
at all, and googling it has given me several other examples of doing
wha
Hello everyone, and I apologize in advance if anyone gets this message twice.
I am trying to figure out how to use py2exe. I've created a game and
sent it to friends before, and had to have them install python,
pygame, and livewires in order to play it, which, as you can imagine,
is a royal pain.
I don't know if this will be useful to everyone, but I found the
O'Reilly book wasn't so helpful to those starting with Python and
moving to Jython (i.e., rather than starting with Java and not knowing
Python). I have yet to find Jython materials that are very good for
beginners - most everything
his in the totally wrong way?
Any pointers/suggestions/things to try would be appreciated!
Thanks,
Denise
-- Forwarded message --
From: Adam Bark <[EMAIL PROTECTED]>
Date: Jul 5, 2005 3:58 PM
Subject: Re: [Tutor] A more Pythonic way to do this
To: "D. Hartley" &l
Thank you for the code, everyone.
I actually have a piece of information (something like
"this+is+a+cookie") that I am trying to *send* (not receive), and I'm
not sure how to do it. I looked at the Cookie examples a little bit,
but am having trouble applying what I see there to my present
situati
Anyone have a good (*simple*) tutorial on making/sending cookies via
python? (i.e., not receiving/messing with them).
Thanks :)
~Denise
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Just catching up on a few replies:
Alan - yes, Adam pointed out my silly error, and it solved what I
thought was a much bigger problem. Very funny how these things go
sometimes.
And to anyone who's interested:
If you'd like a copy, just shoot me an email and I can zip it up and
send it to you.
1,2 12
> 1 0
> you've put a braket after +30 which ends the Enemy call. The numbering is +1
> for opening braket -1 for closing so 0 is the end of the Enemy call if you
> understand this.
>
>
> On 6/30/05, D. Hartley <[EMAIL PROTECTED
Hey guys!
I have a 'quest,' and at first glance this email looks long, but the
problem is probably not as complex as the length implies. Please bear
with me, if I could get some advice on this particular problem, it
would go along way toward helping me be a better Python programmer.
Some of you
first attempt - myjar has no attribute 'value'
second attempt -
re:
myjar = cookielib.CookieJar()
for cookie in myjar:
print cookie.value
In this case the above code should print a single 'B'.
This does work. However, it only ever returns me one value. For
instance, the first three are
Hi everyone! Just a quick question about cookie jars:
when I create a myjar = cookielib.CookieJar(), and go to a website to
get the particular cookie, I get something like this in return:
or, if I do print myjar, this: ]> .
Now, if I wanted to pull out just the value from the cookie (i.e., "B
>From Christian:
> Try subclassing urllib.FancyURLopener and overriding the
> prompt_user_passwd() method. That should get you what you need :-)
Well, I used urllib.FancyURLopener, and can open and look at the url, like this:
import urllib
opener2 = urllib.FancyURLopener({})
f = opener2.open("
Hello, everyone!
I am trying to go to a website, collect any and all cookies I receive
by going to that website, and then look at the cookies/print them.
So I did the following, from the cookie examples in the documentation:
import cookielib, urllib2
myjar = cookielib.CookieJar()
opener = urllib
Hello, everyone!
I hope this isnt the wrong place to post this, but the internet has
not been very helpful to me on this point.
I am looking for several (open-source, obviously) clones of Bejeweled
(the pop cap game) or something like it. There is one listed at
pygame (and that same one is refer
Sorry, Terry, forgot to reply to the whole list. Here it is:
-- Forwarded message --
From: D. Hartley <[EMAIL PROTECTED]>
Date: Jun 7, 2005 2:49 PM
Subject: Re: [Tutor] More image manipulation
To: Terry Carroll <[EMAIL PROTECTED]>
Terry,
OK. I tried them out and
Hello, everyone!
If someone has a few seconds, I am getting some weird errors and
Python won't tell me why. What I am trying to do is take a middle
chunk out of a line of an image, place that at the beginning of the
line, and slide the rest over to the end, like so:
111bb
to:
111aa
What does it mean if my image mode is "P"? In the documentation, it
says "typical values are '1', 'L', 'RGB', 'CMYK.'" (it's a gif, if
that's important)
Thanks! :)
~Denise
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/t
Nevermind! Off by one. Man, that feels dumb!
Thanks for your patience, everyone, and for all your hints!
~Denise
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
In working out the "two different iterations at once" part, I decided
to do the following:
function that creates a "tolist" (a list of coordinate-pair-tuples,
incremented in the correct way to go around in the direction I want)
and then a for loop to iterate one by one over the wire.png (the "fro
ng')
> im1=Image.new(im.mode,(100,100))
> .
> im1.putpixel((x,yl),im.getpixel((p,0)))
>
>
> Trying not to spoil all the fun
>
>
> On 5/31/05, D. Hartley <[EMAIL PROTECTED]> wrote:
> >
> > Hello, everyone!
> >
> > I know
Hello, everyone!
I know you didn't expect to hear from me anymore about these pesky
challenges, since I started the off-tutor list about it, but I'm
afraid I'm stuck and cannot get a hint.
If I want to rearrange a long string of pixels in a different order,
using "putpixel" with a certain size ne
nise
On 5/24/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Quoting "D. Hartley" <[EMAIL PROTECTED]>:
>
> > anyone have a pointer to a *SIMPLE* intro to xml as used in python? I
> > looked in the library and there are about 11 xml-relate
And just in case anyone *isnt* working on the riddles:
anyone have a pointer to a *SIMPLE* intro to xml as used in python? I
looked in the library and there are about 11 xml-related modules.
Perhaps something 'remote'. ;)
___
Tutor maillist
Hello all!
I was just thinking: if there are people on here who are still doing
the python riddles (or are interested in talking about them), I could
start an off-tutor thread so that we could chat about them without
clogging up the tutor mailing list for others?
If you are interested, drop me an
I have a question: what is the "opposite" of hex()? (i.e., like ord
and chr). If I have
'0x73', how can I get back to 115 or s?
Thanks!
~Denise
> You need the ord() function and maybe hex() also:
> >>> ord('s')
> 115
> >>> hex(ord('s'))
> '0x73'
>
> Kent
>
>
Hello everyone!
I know the thread has died down to nothing, but I was wondering, is
anyone still working on the python challenges? I managed to get to #12
(!!) and feel like I'm learning a lot, especially about PIL.
I'm stuck on this one now, tho, and it seems like everyone in the
forum got the b
This was a hint from a python challenge, but I can't find anything
about it online: Anyone know?
Thanks :)
~Denise
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Max - yep, and the hint was "BUSY" (... BZ...)...
Unfortunately that hint doesnt lead me anywhere (except to bz2, which
involves compression, and didnt seem very likely).
I went through and removed all the \x## 's that represented
'unprintable'/carraigereturn/etc characters, but that wasnt it, ha
Does anyone have a hint as to what things like this: \xaf\x82\r\x00\x00\x01\
refer to? I have googled it and searched python for modules/library
sections related to the google pages I found, but as they were pretty
all over the place I can't find something helpful.
Any hints would be appreciated
To avoid spoilers:
Riddle 7, I've got an 87-item long data structure. Any hints on what
to do with it?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> A shade of gray is made by having r == g == b.
... so this has nothing to do with masks and transparency?
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I tried to look at the image band by band, but got three
grey-scale-looking images (for r, g, and b), and one white one.
I have a feeling my clue lies in the latter, but am having a hard time
finding examples of how to manipulate that part (trying hard to avoid
a spoiler here!) in the documentatio
nstances and fifteen hundred other words I'm not used
to worrying about much ;)
Thanks again for all your help everyone, I finally solved the riddle
(!!!) and am onto the next one! And here I thought I'd be stuck ;)
~Denise
On 5/9/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
an i access/see this information about a given member of the
archive?
On 5/9/05, D. Hartley <[EMAIL PROTECTED]> wrote:
> This is a problem I'm having with instances of classes and their
> objects. John suggested:
>
> > Look at the constructor :-)
> >
> > >
This is a problem I'm having with instances of classes and their
objects. John suggested:
> Look at the constructor :-)
>
> >>> import zipfile
> >>> z = zipfile.ZipFile('myzip.zip')
> >>> z.printdir()
I admitted that my grasp of classes (and "constructors") is a bit
fuzzy. I did get this particu
How do I open a zipfile? I see commands for closing it, but i only see
"class zipfile" - no command like urlopen() (!!!)
Thanks!
-- Forwarded message --
From: Roel Schroeven <[EMAIL PROTECTED]>
Date: May 9, 2005 1:31 PM
Subject: Re: [Tutor] Fwd: Fwd: Python riddles
To: tutor@pytho
Hello, everyone!
Well after hours of struggle, I finally managed to get the peak riddle
solved. Very frustrating, but I think I learned a lot.
However on the channel one - I cant get any ideas. It may just be best
for me to bow out at this point. One of my biggest problems has been
that not onl
Ok, I hate to ask another question about this riddle. But I have
looked and looked and looked.
Where can I find more information on 'banner'? Everywhere I look it
starts telling me about banner ads and so on, and that is not what I
want!
Any howto's/tutorials/simple explanations would be apprecia
arently i need to use the module AFTER i get the file onto my hard
disk? sorry to be so dense, i just dont get it.
On 5/6/05, Max Noel <[EMAIL PROTECTED]> wrote:
>
> On May 6, 2005, at 22:20, D. Hartley wrote:
>
> > Yes, I realized my original guess was wrong. I think I
here, I think.
All I know is this is about an hour of solid frustration and I'm going
to have to get one of those stress-ball things!
On 5/6/05, Max Noel <[EMAIL PROTECTED]> wrote:
>
> On May 6, 2005, at 21:40, D. Hartley wrote:
>
> > I figured out what module you'
Did you ever send an email, and then as soon as you sent it, realize
that you are in fact a colossal idiot and you already know the answer?
Yes, I saw my typo. Heh. Nevermind...! *sweeps that email under the
rug, hopefully unread*
~Denise
___
Tutor ma
I figured out what module you're supposed to use for 5, and the thing
that kills me is it's a module I've actually *used* too! But I don't
know what to . man this is hard to say without using a spoiler. I
dont know what particular thing to apply it to (and i tried to read it
from the source cod
Hey guys,
I wrote the following function, and if I do it line-by-line in the
interpreter, each line works exactly as it should. However, when I
run the function by its name, nothing happens. It doesnt print the
print statement, it doesnt give me an error, it just goes to the next
>>> line. This
It took a little bit of playing to limit it so that it got ONLY 3 cap
letters on either side, but I just got the riddle and just about
jumped out of my chair when it worked.
Progress is possible! ha ha!
On 5/5/05, Max Noel <[EMAIL PROTECTED]> wrote:
>
> On May 6, 2005, at 01:33
first time through I missed
something very small (and very helpful, in this case): [A-Z].
Thanks for the pointers :)
~Denise
On 5/5/05, Max Noel <[EMAIL PROTECTED]> wrote:
>
> On May 6, 2005, at 01:10, D. Hartley wrote:
>
> > Anyone have a gentle hint, or pointer to another
I seem to have lost the original link, but thanks to whoever posted
the url for the python challenges. I've been working through them and
they've made for a fun afternoon :) I even came up with a really
elegant solution for #2 that I was really proud of - being new to
python, very often I find pro
normal calculator. Thanks!
~Sheepish Denise
-- Forwarded message --
From: Bob Gailer <[EMAIL PROTECTED]>
Date: May 5, 2005 11:57 AM
Subject: Re: [Tutor] Fwd: Python riddles
To: "D. Hartley" <[EMAIL PROTECTED]>
At 11:39 AM 5/5/2005, you wrote:
Ok, now, I
Ok, now, I'm sure this sounds like a very dumb question. But I
clicked on riddle 1, and I don't know how this thing works - "about"
didnt give a lot of extra info. Am I trying to duplicate something on
my screen that looks like the picture on the monitor? If someone would
give me the (probably ob
I don't know if this is what you're looking for, but in my game I set
Running = 1, and then had:
if event.key == K_q:
running = 0
... which exits the game as soon as you hit q (i.e., no hitting
enter). I can send the full code if it would be more helpful, if thi
Jacob (et al):
Unfortunately at this point I'm rendering the text, not printing it
(using text = font.render). So I need to know if there is a hard
character or something I can type, since 50*" " (space) isnt lining
them up right.
Thanks!
~Denise
On 4/27/05, Jacob S. <[EMAIL PROTECTED]> wrote:
I am trying to create a box on the graphics window which asks a user
for their name. My research led me to the "InputBox" function, which
is said to "get user input, allowing backspace etc shown in a box in
the middle of the screen" (but ignores the shift key?). I found
several pages that refer t
P.S. I should also add that the "print" commands embedded within the
add_score function ARE displaying at the appropriate time (i.e.,
before I have to hit y/n). Of course they're in the text/console
window, but it does tell me that it's executing that add_score
function at the right point in time
Max (et al.):
I tried to do it that way ("score, name, posY" etc) and it told me
"too many values to unpack". But I did get it to work the following
way:
# Display some text
x, y = 230, 270
for score, name in mylist:
slip = 30 - len(name)
slip_amt = slip*
So with pygames, if I want to display text on the graphics window, I
can set the font and size and so on, and set what I want my text to
be. But if I wanted python to grab that text from a list, say, how
would I do that? I can do it in the print command, as follows:
for sc
lem is somewhere else but it'll take time (I don't
have to do a report but I do have to finish a web-based system over Linux)
In the mean time only have to say that your game rocks!!
I'll send you mine next week
Regards
Alberto
http://graphics.hotmail.com/emvamp.gif";
width=12&g
John,
Thank you for the suggestion to try the game from the command line.
Unfortunately, when I scored high enough to make the high score list
and entered in my name (in the dos/command window, now), and clicked
back to the game screen, the game screen just closed/crashed, and the
command line re
nothing about the game :D
Regards
Alberto
>From: "D. Hartley" <[EMAIL PROTECTED]>
>Reply-To: "D. Hartley" <[EMAIL PROTECTED]>
>To: Python tutor
>Subject: [Tutor] crash - switching between text window
>andgraphics/gamewindow (high score)
>Date: Wed,
hange the games so we can know differents points of
view????????
I'll wait your reply
Regards
Alberto
>From: "D. Hartley" <[EMAIL PROTECTED]>
>Reply-To: "D. Hartley" <[EMAIL PROTECTED]>
>To: Python tutor
>Subject: [Tutor] crash - switching between
Ok. I got in the working code to have a high score list, and it even
saves/loads one now (!!). The only problem is, clicking back from the
text window to the game window (only after you entered in your name to
go onto the high score list), closes the program. you dont get to say
y/n to another gam
Another quick question. I tried to send a file to my friend to test
it out, and it gave her the following sound-related error:
Cannot load sound: data\explode2.wav
Traceback (most recent call last):
File "D:\Python24\play w paused screen residue.py", line 495, in -toplevel-
playing = main(
d'oh! here's the file I was supposed to attach:
-- Forwarded message ------
From: D. Hartley <[EMAIL PROTECTED]>
Date: Apr 18, 2005 3:14 PM
Subject: high score list error and displaying text in the game/graphics window
To: Python tutor
Hi everyone!
Thanks for all
Hi everyone!
Thanks for all your help/ideas for the high score list. I managed to
get one working! Well, almost ;)
It runs in the text (python) window, behind the graphics window. when
you dont make the high score list, it displays a "sorry" message, and
you can keep playing (i.e., hit y/n for a
Yes, I am using pygame. Thanks!
-- Forwarded message --
From: Liam Clarke <[EMAIL PROTECTED]>
Date: Apr 16, 2005 6:14 PM
Subject: Re: [Tutor] "paused" graphic leaves a 'residue' when returning to game?
To: "D. Hartley" <[EMAIL PROTECTED]&g
Thanks, Tony, your example is much clearer (to me!) than that on the
python page. A couple quick questions about it:
So the .dump command is, in effect, saving the file, correct? which
takes the object you're saving (in my case it would be
high_scorelist), and ("filename",". what is the "w" ?
Hello everyone! (Yes, another thread from me). I had a question that
started in another thread, but it has turned into a huge, gaping chasm
of confusion for me on its own, so I thought I would start another
thread with a more specific subject line.
I am working on creating a high score list for
again!
~Denise
-- Forwarded message --
From: Max Noel <[EMAIL PROTECTED]>
Date: Apr 15, 2005 4:12 PM
Subject: Re: [Tutor] high score lists
To: "D. Hartley" <[EMAIL PROTECTED]>
Cc: Python tutor
On Apr 15, 2005, at 21:30, D. Hartley wrote:
> Unless
Thanks, I'll look at the cookbook! I didnt know it was available online.
I did look at your example about using the longest number, but I
couldnt really understand all of the code, and ended up deciding to
arrange it so that the two columns were left-aligned: it looked like
it would align them dow
Hello, everyone!
Thank you for your very helpful comments. A few follow up questions,
and then I'll show you where I've come so far:
1. Max - I think you're right about keeping it (score, name). It *is*
much simpler to work with it that way, and would be easier to change
the display and just ha
my apologize to Alberto - instead of replying to the whole list, I
accidentally replied only to him! Here are my replies, for anyone else
who might be reading/interested:
This is what I have so far:
high_scorelist = [(1000,"Denise"), (945,"Denise"), (883,"Denise"),
(823,"Grant")
Another quick question:
I can pause and unpause the little game I created, and I have a
graphic to display over top of the game screen when it is paused,
which tells the user which key to press to unpause, right? It's set
up the same way as my "game over" graphic. But in any case, when I
unpause
Anyone have some good beginning ideas/references to creating a high
score list and storing scores in a simple python game? (if there's
something in the pygames module, or a simpler python way). I'm
mod'ing a space invaders-type game and would like to add a high score
list :)
Thanks!
~Denise
77 matches
Mail list logo