Hi all,
I'm writing a wiki at the moment, and I want to store unified diffs to
allow easy reverting between versions of a document. It appears that
difflib.restore() can only generate original text from diffs returned
from ndiff() or compare() which store the full text of both versions.
As
At 01:37 PM 9/30/2006, Shantanoo Mahajan wrote:
Maybe following is helpful:
a=[3,2,1]
b=a[:]
b.sort()
c=sorted(a)
print a,b,c
[3, 2, 1] [1, 2, 3] [1, 2, 3]
Shantanoo
Sorry to be dense, but I don't see what showing what happens to a
copy of list a adds to the explanation:
a =
Dick Moores wrote:
At 01:37 PM 9/30/2006, Shantanoo Mahajan wrote:
Maybe following is helpful:
a=[3,2,1]
b=a[:]
b.sort()
c=sorted(a)
print a,b,c
[3, 2, 1] [1, 2, 3] [1, 2, 3]
Shantanoo
Sorry to be dense, but I don't see what showing what happens to a
copy
hello i wrote a litle program ware you pick a number and the computer
guesses it and i recently decided to make it so it dosint reguess
numbers but now i get a error message
here is the program
def number(number):
from random import randrange
guess=randrange(number*2)
print guess
Liam Clarke wrote:
Hi all,
I'm writing a wiki at the moment, and I want to store unified diffs to
allow easy reverting between versions of a document. It appears that
difflib.restore() can only generate original text from diffs returned
from ndiff() or compare() which store the full text
mike viceano wrote:
hello i wrote a litle program ware you pick a number and the computer
guesses it and i recently decided to make it so it dosint reguess
numbers but now i get a error message
here is the program
def number(number):
from random import randrange
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi guys,
Awhile back, I believe I saw a cookbook recipe for splitting and
reassembling text/binary files.
Does anyone know where this or something similar can be found?
I am working on a file transfer mechanism via MQSeries and breaking
large files
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Never mind.. :)
found it at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/224800
However, if someone has something better, I would be very interested.
Andrew Robert wrote:
Hi guys,
Awhile back, I believe I saw a cookbook recipe for
Andrew Robert wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi guys,
Awhile back, I believe I saw a cookbook recipe for splitting and
reassembling text/binary files.
Does anyone know where this or something similar can be found?
Searching the cookbook for 'split file' finds
OK, first of all, I just started learning python a few hours ago so deal with me here.
I'm picking up quite fast on Python since I took a C++ class a year ago
when i was 13. However, before I go deep into learning it, I want to
know if Python will work for the purpouses I need.
I am
Kefka Palazzo wrote:
OK, first of all, I just started learning python a few hours ago so
deal with me here.
I'm picking up quite fast on Python since I took a C++ class a year
ago when i was 13. However, before I go deep into learning it, I want
to know if Python will work for the
I am trying to learn a programming language good for programming entire
games (core functions too)
check out the PyGame engine:
http://pygame.org
download the games written on top of PyGame that appear to match the
functionality you're looking for. if you learn Python at the same
time,
wesley chun wrote:
I am trying to learn a programming language good for programming entire
games (core functions too)
check out the PyGame engine:
http://pygame.org
download the games written on top of PyGame that appear to match the
functionality you're looking for. if you learn Python
Hi all,
I thought that it would be a great idea to learn Python while porting
the BASIC code from this book. So I printed all the pages, have them
bound by a big binder clip, and read through the first bit.
In Chapter 2 there is a type of Choose Your Own Adventure type
section. Since I didn't
I'm going through the tutorial Learning to Program at
http://www.freenetpages.co.uk/hp/alan.gauld/. I reached the section
talking about sys.exit(). I typed it in as indicated, but I received
errors rather than it actually exiting the Python Shell windows
generated when starting IDLE. Here is
On 02/10/06, Will Shattuck [EMAIL PROTECTED] wrote:
I'm going through the tutorial Learning to Program at
http://www.freenetpages.co.uk/hp/alan.gauld/. I reached the section
talking about sys.exit(). I typed it in as indicated, but I received
errors rather than it actually exiting the Python
On 10/1/06, John Fouhy [EMAIL PROTECTED] wrote:
On 02/10/06, Will Shattuck [EMAIL PROTECTED] wrote:
I'm going through the tutorial Learning to Program at
http://www.freenetpages.co.uk/hp/alan.gauld/. I reached the section
talking about sys.exit(). I typed it in as indicated, but I
At 04:38 PM 10/1/2006, Will Shattuck wrote:
Hi all,
I thought that it would be a great idea to learn Python while porting
the BASIC code from this book. So I printed all the pages, have them
bound by a big binder clip, and read through the first bit.
In Chapter 2 there is a type of Choose Your
Dick Moores wrote:
Works fine, but instead of
coin1 = random.randint(1, 10)
coin2 = random.randint(1, 10)
you could simplify by using
coin1 = random.randrange(2)
coin2 = random.randrange(2)
or maybe random sample:
In [22]: random.sample(('heads', 'tails'), 1)[0]
Out[22]: 'tails'
Kent
Changing Mobile and Landline Number no more a problem !
Whenever we change our telephone numbers (both Mobile and Landline) and Service Providers (all providers such as BSNL, Reliance, Tata Indicom, Airtel/Hutch, Aircel, etc.), we miss out a number of valuable contacts and as a result we even
Hi!
Im a very biginner in programming and I started with python, witch I
found much easier tahn i thought.
I want to build an intranet page in my organization that shows some data
from our financial aplication's database.
For the starting point I would like it to show invoices lists per
Sorry, a slip of the mouse let that through.
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On 02/10/06, Kent Johnson [EMAIL PROTECTED] wrote:
or maybe random sample:
In [22]: random.sample(('heads', 'tails'), 1)[0]
Out[22]: 'tails'
I think random.choice would be a better option here:
random.choice(['heads', 'tails'])
'tails'
[random.choice(['heads', 'tails']) for i in range(10)]
-code block-
number = 3
running = True
while running:
guess = int(raw_input(Please enter a number : )) #lets user guess a number
if guess == number:
print Yay, you got the right number, good for you. But you
don't get any prizes. Do I look like a walking ATM to you?
running
I am a senior at the School Without Walls in Rochester, NY. As such, I
get to do a senior project. I decided to work on computer programming,
since that is sometihng that I certianly think can hold my interest
throughout the school year.
(despite my compute rinteresat, I've never done anything
--- Kefka Palazzo [EMAIL PROTECTED] wrote:
I am trying to learn a programming language good for
programming entire
games (core functions too) similar to both the Final
Fantasy and Metroid
series. From the book I'm learning from (Python
Programming for the Absolute
Beginner, by Michael
On 10/1/06, John Fouhy [EMAIL PROTECTED] wrote:
On 02/10/06, Kent Johnson [EMAIL PROTECTED] wrote:
or maybe random sample:
In [22]: random.sample(('heads', 'tails'), 1)[0]
Out[22]: 'tails'
I think random.choice would be a better option here:
random.choice(['heads', 'tails'])
'tails'
Paulino wrote:
Hi Paulino,
Tough question that. What is your existing web server? That'd be a good
starting point. Zope/Plone are great, but they have a steep learning
curve that doesn't seem essential to what you're doing. Django is
simpler, but once again, doesn't immediately fit to what
One of my community advisers suggested I start with Python. (he also
suggested this mailing list)
take a look at how to think like a computer scientist by downey,
elkner, etc. it was originally written for C++ and Java but Jeff
Elkner, a high school programming AP instructor, ported it to
C:\python -m timeit -sx=0 while x100: x+=1
1000 loops, best of 3: 0.123 usec per loop
C:\python -m timeit -sfor x in range(100): x+=1
Traceback (most recent call last):
File E:\Python25\lib\runpy.py, line 95, in run_module
filename, loader, alter_sys)
File
Alan Gilfoy wrote:
-code block-
number = 3
running = True
while running:
guess = int(raw_input(Please enter a number : )) #lets user guess a
number
if guess == number:
print Yay, you got the right number, good for you. But you
don't get any prizes. Do I look like a
On 02/10/06, Luke Paireepinart [EMAIL PROTECTED] wrote:
I had no idea you could have an 'else' tied to a 'while' loop.
Interesting
It allows you to distinguish between exiting the loop via a break and
exiting the loop normally.
eg:
for i in range(10):
... break
... else:
... print
At 09:49 PM 10/1/2006, Luke Paireepinart wrote:
I had no idea you could have an
'else' tied to a 'while' loop.
Interesting
I looked this up in Python in a Nutshell. From p. 69:
The else Clause on Loop Statements
while and for statements may optionally have a
trailing else clause. The
33 matches
Mail list logo