Alan Gauld | 1 Dec 01:40 2003
Picon

Re: inp. outp. & variable - dictionary difference ...

> 1.) First I found out, after trying few times, closing Python,
and
> opening it again, that sometimes it open file (for
reading/writting),
> and sometimes just don't,

I'm guessing but how do you start Python? Could it be that you
are
sometimes starting it from the folder that the filesw are stored
in
and sometimres from some place else? Python will look in
"the current directory" for the files if you don't provide the
full path.

> I have also tryed what Danny suggested, some other method to
open file, :
>
> >>> inp = open("D:/Program
Files/Python/Lib/idlelib/Saves/ggg.txt") ...
> and the file was opened normally !!
>
> ... but in the very next line (of course after typing
inp.close() ), with
> inp = open("somefile.txt","r") method:

Note you used the full path first time but a relatoive path
second time.
Suggests you were not in

D:/Program Files/Python/Lib/idlelib/Saves
(Continue reading)

Leung Cris | 1 Dec 03:25 2003
Picon

mouse_buttons()

How do I use that function? It's from Livewires . It returns three values, the middle , right, and left
button. Depending on whether it is clicked, it will return a 0 or 1. But how do I get it so that when I click on
the screen, it will stop? I've triedthis:

while 1:
  mouse_buttons()
  if mouse_buttons() == 1
    break

but... it doens't work

_________________________________________________________________
使用全球用戶最多的電子郵件服務 MSN Hotmail: http://www.hotmail.com 

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Danny Yoo | 1 Dec 19:20 2003
Picon

Re: python mailing list


On Sat, 29 Nov 2003, Az wrote:

> python mailing list

Hi Az,

Yes, you've reached the right number.  *grin*


Do you have any questions about learning Python?  This mailing list is
dedicated to help folks learn how to program Python.  If you have any
questions, please feel free to bring them up.

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Danny Yoo | 1 Dec 19:34 2003
Picon

Re: mouse_buttons()


On Sun, 30 Nov 2003, Leung Cris wrote:

> How do I use that function? It's from Livewires . It returns three
> values, the middle , right, and left button. Depending on whether it is
> clicked, it will return a 0 or 1. But how do I get it so that when I
> click on the screen, it will stop? I've triedthis:
>
> while 1:
>   mouse_buttons()
>   if mouse_buttons() == 1
>     break
>
>
> but... it doens't work

Hi Leung,

What does mouse_buttons() give back to us?  Is it a number, or a list,
or...?

I see that you're trying to guess this by seeing if it's an integer.  And
this is something that, with enough flailing, can be guessed with time.
But we can accelerate the process.  *grin*


Take a closer look at:

    http://www.livewires.org.uk/python/pdf/G-graphics.pdf

(Continue reading)

Danny Yoo | 1 Dec 22:16 2003
Picon

Re: program doesnt work


On Thu, 27 Nov 2003, Udz wrote:

> well, after i fixed my little mistake (thanx G.Rodriguez, I made a
> stupid mistake.), i ran py2exe, and it appeared to work right, it built
> the dir that it was supposed to, and compiled the .dll and .exe file.
> the only problem is, the program doesnt work. The window just kinda pops
> up, then disappears without doing anything.

Hi Udz,

Just checking up on this: what happens if you add the line:

###
raw_input("Program finished: press Enter to continue...")
###

at the very end of your program?  I suspect that Windows is closing your
program down automatically.  t's a common issue for console-based programs
on Windows, that your program may actually be running fine, but may simply
be finishing too quickly for you to see it.

Many programs try to work around this window-closing feature by forcing a
prompt so that the user can see things.

Good luck to you!

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor
(Continue reading)

Danny Yoo | 1 Dec 22:21 2003
Picon

Accessing the mailing list archive


> P.S., I save all the answers I get, and you couldn't imagine (or you
> probably do, but I just said so, cause it sounds nice), how helpfull is
> having you answers saved somewhere, and when something is not so clear,
> just open those files, and see what was doing wrong ...

Hi Tadey,

By the way, there's also an archive of the whole mailing list:

    http://mail.python.org/pipermail/tutor/

so if you ever want to browse some old threads, you can always turn to
that link.  Everything is saved to the archive, which is pretty useful.

There's also a rudimentary list searcher here:

    http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/python-Tutor

and sooner or later, someone is bound to write a nicer search interface to
the archive.

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Danny Yoo | 1 Dec 22:47 2003
Picon

Re: special character ( ñ )


On Sat, 29 Nov 2003, Michael Lange wrote:

> On Fri, 28 Nov 2003 13:56:17 -0500 (EST)
> clickron <at> webtv.net (Ron A) wrote:
>
> > I have python 2.2.2.  Is there an easy way to type  (n with tilde) or
> > other special characters?.
> >
> I am afraid that I'm not an encoding expert, but I guess you have the same problems
> as I have with german special characters.
> In this case it depends on *where* you want to print it:
> In IDLE(python 2.2.3):
>
> >>> print ''
> UnicodeError: ASCII encoding error: ordinal not in range(128)

Hello!

It sounds like you're trying to use ISO-8859-1 encoding to display
accented characters on your system.

If your terminal supports it, then you can use:

    ftp://unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT

to find out the right hexadecimal constants.  For example, the tilde 'n'
maps to the entry:

"""
(Continue reading)

Tim Johnson | 1 Dec 22:00 2003

class method: dynamic overload

Hi All:
    Is it possible in python to replace (overload)
an existing class method with a new one of the same
name but with different functionality?

I would welcome pointers to docs and keywords.
- this is just R & D, not mission critical.

TIA
tim

--

-- 
Tim Johnson <tim <at> johnsons-web.com>
      http://www.alaska-internet-solutions.com

_______________________________________________
Tutor maillist  -  Tutor <at> python.org
http://mail.python.org/mailman/listinfo/tutor

Leung Cris | 1 Dec 23:05 2003
Picon

FW: Re: mouse_buttons()


>From: Danny Yoo <dyoo <at> hkn.eecs.berkeley.edu>
>To: Leung Cris <krazie_mu_boi <at> hotmail.com>
>CC: tutor <at> python.org
>Subject: Re: [Tutor] mouse_buttons()
>Date: Mon, 1 Dec 2003 10:34:20 -0800 (PST)
>
>
>
>On Sun, 30 Nov 2003, Leung Cris wrote:
>
> > How do I use that function? It's from Livewires . It returns three
> > values, the middle , right, and left button. Depending on whether it is
> > clicked, it will return a 0 or 1. But how do I get it so that when I
> > click on the screen, it will stop? I've triedthis:
> >
> > while 1:
> >   mouse_buttons()
> >   if mouse_buttons() == 1
> >     break
> >
> >
> > but... it doens't work
>
>
>Hi Leung,
>
>
>What does mouse_buttons() give back to us?  Is it a number, or a list,
>or...?
(Continue reading)

Danny Yoo | 1 Dec 23:20 2003
Picon

Re: FW: Re: mouse_buttons()


> >Take a closer look at:
> >
> >     http://www.livewires.org.uk/python/pdf/G-graphics.pdf
> >
> >
> >According to the documentation, mouse_buttons() is a function that returns
> >a dictionary.  So you'll need to treat the return value of mouse_buttons()
> >as a dictionary with keys 'left', 'middle', and 'right'.
> >
> >
> >
> >If you have more questions, please feel free to ask.  Good luck to you!
> >
>
>
> I'm not really familliar with "dictionary", can someone tell me how to
> access one?

Hi Leung,

Livewires has a good explanation of dictionaries:

    http://www.livewires.org.uk/python/pdf/D-dicts.pdf

By the way, when you get the chance, take a quick glance through the other
reference sheets:

    http://www.livewires.org.uk/python/pdfsheets.html

(Continue reading)


Gmane