Joseph Quigley gmail.com> writes:
> Is there a way of telling Python to make a new line after you press Enter
(return)?
Return automatically ends the current input line (and therefore starts a new
one) when you use raw_input.
>> I would suggest that you learn a bit more about Python's facilitie
Hello friends,
I m currently working on sound stuff. I have installed
all stuff related to Snack. My code for playing mp3
song is like this
#!/usr/bin/python2.3
from Tkinter import *
import tkSnack
def main():
root = Tk()
tkSnack.initializeSnack(root)
mysound = tkSnack.So
Following the Tutorial by Michael Dawson and the previous
web help from Liam Clark, I have a basic Othello Game up and running quite
well.
I now want to start the game with a set of instructions that
stays on the screen until the user is ready to proceed. Since you are only
allowed one scr
Terry Carroll wrote:
> I've often found it convenient to run a Python program I'm developing with
> the -i flag. I find it convenient to use as a post-mortem as it hits bugs,
> or to explore data structures.
>
> I've recently started using the construct
>
> if __name__ == "__main__":
>
[EMAIL PROTECTED] wrote:
> Quoting Kent Johnson <[EMAIL PROTECTED]>:
>
>
>>J. Gabriel Schenz wrote:
>>
>>>Now, I am new to Python as well, but it seems like apply might not be
>>>completely superfluous. I was thinking that if one were using a functional
>>>programming style, and had to apply a fu
Quoting Terry Carroll <[EMAIL PROTECTED]>:
> On Tue, 17 May 2005, D. Hartley wrote:
> > This was a hint from a python challenge, but I can't find anything
> > about it online: Anyone know?
> Raymond Hettinger is a frequent contributor to Python. I don't know if
> that is part of it.
If I had to
On Tue, 17 May 2005, Terry Carroll wrote:
> On Tue, 17 May 2005, D. Hartley wrote:
>
> > This was a hint from a python challenge, but I can't find anything
> > about it online: Anyone know?
>
> Raymond Hettinger is a frequent contributor to Python. I don't know if
> that is part of it.
And ac
On Tue, 17 May 2005, D. Hartley wrote:
> This was a hint from a python challenge, but I can't find anything
> about it online: Anyone know?
Raymond Hettinger is a frequent contributor to Python. I don't know if
that is part of it.
___
Tutor maillist
On Wed, 18 May 2005 [EMAIL PROTECTED] wrote:
> If main is a class, you could change to 'm = main()'; that would at
> least give you access to the class attributes.
Interesting approach; I'm refering to where main() is a method, the usual
python idiom.
__
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
Quoting Kent Johnson <[EMAIL PROTECTED]>:
> J. Gabriel Schenz wrote:
> > Now, I am new to Python as well, but it seems like apply might not be
> > completely superfluous. I was thinking that if one were using a functional
> > programming style, and had to apply a function determined at runtime to
Quoting Terry Carroll <[EMAIL PROTECTED]>:
> I've recently started using the construct
>
> if __name__ == "__main__":
> main()
>
> And found I can't do the -i thing effectively any more. What's a good
> equivalent approach?
If main is a class, you could change to 'm = main()'; that would at
Here you go
Each filenaem corresponds to the command
Thanks in advanced
Alberto
From: Danny Yoo <[EMAIL PROTECTED]>
To: Alberto Troiano <[EMAIL PROTECTED]>
CC: tutor@python.org
Subject: Re: [Tutor] Troubles with Python modules
Date: Tue, 17 May 2005 14:56:52 -0700 (PDT)
On Tue, 17 May 2005, Albert
On Tue, 17 May 2005, Smith, Jeff wrote:
> Is there a more Pythonic way to get the Perl equivalent of
> $#var
> other than
> len(var) - 1
Hi Jeff,
Just out of curiosity, where do you use Perl's $#var? Can you show us the
context of its use? If we see context, it might help us fin
On Tue, 17 May 2005, Alberto Troiano wrote:
> Sorry about the question marks (MSN addiction :))
>
> Didn't work and as I suspected it was already installed.
Hi Alberto,
I'm still thinking that the MySQL development packages are either damaged
or mixed up, since the error message says that it c
Hey
I know I posted so many things but it's because I have so much to do
I used to program in VB 6 but I want to learn a programming so I can I
master it.
I want to make a menu (Tkinter) like the one of the image attached to this
email
I can do the menu and submenu but I can't do the third subme
On May 17, 2005, at 22:00, Smith, Jeff wrote:
> Is there a more Pythonic way to get the Perl equivalent of
> $#var
> other than
> len(var) - 1
AFAIK, len(var) - 1 is the only way. Note, however, that the
last element of a list (or of any ordered sequence) can be obtained
with th
On Tue, 17 May 2005, Alberto Troiano wrote:
> I'm sending the errors MySQLdb gives me when I try to install it. It's
> hola.txt file
> I'm doing python setup.py build and inside hola.txt you can see what it says
> I have installed Linux Red Hat with ALL packages
Hi Alberto,
[Side note: please
Is there a more Pythonic way to get the Perl equivalent of
$#var
other than
len(var) - 1
Thanks,
Jeff
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
If you intend to make a text
editor (something which allows the user to browse
through the text and manipulate it at will) using just raw_input and
print, I
think you've set yourself an impossible task. For a console editor you
should
probably look at curses
(http://www.amk.ca/python/howto/curses
Hi,
I'm writing a program that is a program that flips a coin 100 times and
then tells the number of heads and tails.
---
import random
head = 0
tail = 0
coin
Hey Danny
Sorry about the question marks (MSN addiction :))
Didn't work and as I suspected it was already installed.
What else can I do? Is there another built-in module that resemble datetime
module?
I had to use Python 2.2.2 because of MySQLdb but now I can't use datetime.
As you see I'm in
import random
head = 0
tail = 0
while (head + tail) < 100:
coin = random.randrange(2) <-- move this line inside the loop
if coin == 0:
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of . ,
Sent: Tuesday, May 17, 2005 4:12 PM
To: tutor@python.or
First of all, thanks for the corrections
I'm assuming that Python 2.2 doesn't have datetime module then???
Is there any way to install it???
My version of Python 2.3.4 is an alternative installation so I know that
when I type python with my root account its going to Python 2.2.2 (I'm using
Smith, Jeff wrote:
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Andrei
>>Weird. Looks to me like the wrong solution (it would IMO be better to find
>>out
>>who committed the broken code and work from there to find the cause), but
>>whatever works for you.
>
>
> I agree
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Andrei
>It seems problematic to me to NOT enforce standard *settings* (e.g. 4
spaces
>per indentation level, no tabs). Any IDE can be used as long as the
proper
>settings are configured. Inconsistent indentation styles are very
an
I've often found it convenient to run a Python program I'm developing with
the -i flag. I find it convenient to use as a post-mortem as it hits bugs,
or to explore data structures.
I've recently started using the construct
if __name__ == "__main__":
main()
And found I can't do the -i
Smith, Jeff medplus.com> writes:
> merge...that doesn't really matter. It seems problematic to me to try
> to enforce tool standards on people (IDE and editor settings) which may
> or may not take.
It seems problematic to me to NOT enforce standard *settings* (e.g. 4 spaces
per
On Tue, 17 May 2005, Alberto Troiano wrote:
> I'm working on Python 2.2 over Linux REd Hat 9.0 and here is the code I
> have
[code cut]
> First I'd like to know if this code can be shorter or more efficient (if
> you have the time)
Yes. But let's look at the errors first.
> Second the err
On 16 Mai 2005, [EMAIL PROTECTED] wrote:
> Thanks to all who helped me with my questions regarding testing for
> commandline arguments and list assignment. I have finished my first
> Python program (included below). It is slightly more secure than the
> Perl program I rewrote, but also about a t
> Hi Danny
>
> Thanks, it works - I must read the documentation more carefully!
>
> Would you mind if I knok on your door again with futher Python hick-ups?
Hi Danie,
It's probably a better idea to send your questions to Tutor. The reason
is to allow the community to get involved.
Also, I have
My code:
> > for line in fileNames:
> > if line[-10:] == '_thumb.jpg':
> > fileNames.remove(line)
Chris wrote:
> The above will not work if two successive lines contain the target
> text. When you remove the one, its neighbor "slides over" to take the
> place of the one removed and the
On Tuesday, May 17, 2005, at 08:35 America/Chicago,
[EMAIL PROTECTED] wrote:
> I have a string table (don't recall the right word used in Python
> right now) and would like to remove every 'cell' that contains a
> string '_thumb.jpg'. There are 1-> digits before the string if that
> matters. I m
>
>
> Subject:
> Re: [Tutor] Lists of files
> From:
> William O'Higgins <[EMAIL PROTECTED]>
> Date:
> Mon, 16 May 2005 15:50:37 -0400
>
>
[...]
>
> One last thing - is there an equivalent of the "use strict" and "use
> war
> Looks like a job for a list comprehension:
>
> fileNames = [element for element in fileNames if not element.endswith
> ("_thumb.jpg")]
Thanks Max! It seem to work, but now I have to do some reading,
because I have no idea why it works or what it really does. :) But
thanks anyway.
Yours,
On May 17, 2005, at 08:52, Olli Rajala wrote:
> Okay,
> I have a string table (don't recall the right word used in Python
> right now)
It's called a list, or an array.
> and would like to remove every 'cell' that contains a
> string '_thumb.jpg'. There are 1-> digits before the string if t
Hey
I'm working on Python 2.2 over Linux REd Hat 9.0 and here is the code I have
import os
import sys
import MySQLdb
import datetime
import time
class conexion(object):
def __init__(self):
self.db = MySQLdb.connect(host="localhost", user="administrador",
passwd="123456",db="segurida
I'm working on a Python development project which spans multiple people.
We are all working on Windows and using the PyWin IDE. Our code is
revision controlled using Perforce. Already we had one instance where
the logical structure of a file was destroyed because indentation levels
were changed a
(From digest)
> I'm aware of the Boston PIG, a smaller one in Amherst and have been
> told that there is possibly a PIG in Manchester, NH.
The Dartmouth Lake Sunapee Linux User Group
http://dlslug.org/
also supports a python mail list.
http://dlslug.org/mailing_lists.html
The P
Thanks for the reply
I read the link and I think I've got all what I need (at least for now)
Thanks again
Regards
Alberto
>From: [EMAIL PROTECTED]
>To: Tutor Tutor
>Subject: Re: [Tutor] Tkinter questions
>Date: Tue, 17 May 2005 11:03:45 +1200 (NZST)
>
>Quoting Alberto Troiano <[EMAIL PROTECTE
J. Gabriel Schenz wrote:
> Now, I am new to Python as well, but it seems like apply might not be
> completely superfluous. I was thinking that if one were using a functional
> programming style, and had to apply a function determined at runtime to an
> argument, then one could use this apply to do
Thank you, Andrei, that's just what I was hoping for -- I wondered about some of those issues, but was a little unsure how to approach a solution.
Ron
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
>At 02:17 PM 5/12/2005, Bernard Lebel wrote:
>>Just a generic question: why one would use apply()?
>>
>>In Learning Python, on page 357, there is an example of generating an
>>instance using apply():
>>
>>class A:
>> def __init__( self, number ):
>> self.number = number
>>
>>a =
Lee Cullens wrote:
> Python Interest Group Query
>
> I'm aware of the Boston PIG, a smaller one in Amherst and have been
> told that there is possibly a PIG in Manchester, NH.
>
> Basically I'm trying to find out if there are any, or any interest in
> (or even any other Python users at all :~
> Also, I hear that optparse is much better than getopt.
this is a true pleasure to work with optparse. It was included in python2.3 and
was primarly called python-optik
Ced.
--
Cedric BRINER
___
Tutor maillist - Tutor@python.org
http://mail.py
Hi Alan
> Hi Cedric,
>
> Reading through this I can't help but think you are going to
> a lot of trouble to make things very complicated for yourself
> - and for anyone else who has to work on your code. The
> Python module system is very simple and helpful in tracking
> down where the various thi
Okay,
I have a string table (don't recall the right word used in Python
right now) and would like to remove every 'cell' that contains a
string '_thumb.jpg'. There are 1-> digits before the string if that
matters. I made a for-loop that does what I want to:
for line in fileNames:
if line[-10:]
Ron Phillips engineer.co.summit.oh.us> writes:
> The script produces expected results, but if anyone is so inclined, I'd
appreciate review/evaluation/critique of the 'pythonism' of the script.
I haven't read it from A to Z, but it looks OK. Some minor things:
- string formatting, e.g.:
out+= '
On Fri, 13 May 2005, Alberto Troiano wrote:
> To explain for those who doesn't know:
> The first line creates a variable named "fec" with the value cam(a Linux
> function returning year month day hour minute second).jpg
> The second show the value of "fec"
> The third moves hola.txt to the direct
Hi guys (and gals too!)
I'm writing a program where I would need to write the output finally
to the computer I can access with SSH/SFTP/SCP. So, is there any
'pythonish' way to do it, or do I have to use os.system() or something
similar? I can save it temporarily to the computer the program is
run
Joseph Quigley gmail.com> writes:
> I want to make a text editor. I know that there are hundreds out there,
> but practice makes perfect, and I need the practice. My problem is
> that I have no idea how to make one. I've tried a little already by
> defining line functions:def line1():l1 =
Hi James,
I can't answer your question because I don't know anything
about pygame, but your code would look a lot better if you
wrote a function (handleKeyEvent() say?) to avoid repeating
all that code. One of the big advantages of using functions
- aside from saving typing effort - is that they m
52 matches
Mail list logo