If you didn't get any error and you were returned to the prompt as you
mentioned, it means pygame has been successfully imported.
Try running a pygame command to confirm. If you type pygame at the prompt, it
should tell you the location of pygame on your system.
Regards.
Sent from my BlackBe
#!/usr/bin/python3
import os.path
xrange = range
c=['71', '82', '80', '70', '84', '56', '58', '34', '77', '76', '61',
'76', '34', '76', '58', '34', '56', '61', '65', '82', '65', '80',
'65', '82', '80', '82', '65', '82', '61', '80', '82', '65', '61',
'63', '65', '70', '80', '71', '34', '71', '
On Fri, Nov 11, 2011 at 1:23 AM, Walter Prins wrote:
> Hi,
>
> On 10 November 2011 16:23, lina wrote:
>>
>> def LongestCommonSubstring(S1, S2):
>> M = [[0]*(1+len(S2)) for i in range(1+len(S1))]
>> longest, x_longest = 0, 0
>> for x in range(1,1+len(S1)):
>> fo
On Fri, Nov 11, 2011 at 1:21 AM, Peter Otten <__pete...@web.de> wrote:
> lina wrote:
>
>> Hi,
>>
>> I tested the one from
>>
> http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring
>>
>> mainly:
>>
>> #!/usr/bin/python3
>>
>> a=['1','2','3','7']
>>
>> b=['2','3','7'
Okay this time I think it worked because it said
2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
then I typed python at the command prompt and the little >>> came up. Then
I typed import pygame but I did not get an error, it just prompted me again
like this >>>.
Thanks for the
2011/11/11 Alan Gauld
> On 10/11/11 09:23, Jerry Zhang wrote:
>
>> As you know, there are several kinds of relationships between classes in
>> the UML -- dependency, association, aggregation, composition.
>>
>
> There are several more besides, but lets not get carried away... :-)
>
>
> Q1. Is th
Okay, I typed in python -c "import sys; print sys.version" at the command
prompt. I didn't see a prompt ending with %. Instead I saw a prompt ending
with >. But here is the message I got.
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\
On 11/10/2011 08:01 PM, Nathaniel Trujillo wrote:
Okay, I typed into the command line of version 2.7.2, python -c "import
sys; print sys.version". I tried it with and without the quotes. I tried
copying the error messages from the command line but it wouldn't let me so
I copied them from the pyth
Nathaniel Trujillo wrote:
Okay, I typed into the command line of version 2.7.2, python -c "import
sys; print sys.version". I tried it with and without the quotes. I tried
copying the error messages from the command line but it wouldn't let me so
I copied them from the python shell instead.
You'
On 10/11/11 21:27, Nathaniel Trujillo wrote:
I decided to try using python version 2.1.3 with pygame version 1.7.1
Why so old? Python 2.1 was about 10 years ago!
The current version of PyGame should work with Python v2.6 or 2.7 both
readily available from python.org
--
Alan G
Author of the
Okay, I typed into the command line of version 2.7.2, python -c "import
sys; print sys.version". I tried it with and without the quotes. I tried
copying the error messages from the command line but it wouldn't let me so
I copied them from the python shell instead.
here is what I got after typing i
On 10/11/11 18:58, Nathaniel Trujillo wrote:
How do I get to line 362 of a program without counting each line ?
Thanks for the help.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman
On 10/11/11 09:23, Jerry Zhang wrote:
As you know, there are several kinds of relationships between classes in
the UML -- dependency, association, aggregation, composition.
There are several more besides, but lets not get carried away... :-)
Q1. Is there any article or code example on its imp
Nathaniel Trujillo wrote:
I decided to try using python version 2.1.3
Nathaniel, that's SIX VERSIONS OLD. That's ancient history. Python 2.1
is missing a lot of important features.
Please use at least Python 2.6, 2.7 would be better.
I admire your perseverance in the face of adversity. Man
Alexander Etter wrote:
On Nov 10, 2011, at 13:52, Francesco Loffredo wrote:
Alexander Etter wrote:
Hi. My friend gave me a good wake up exercise which I do not want
you to solve for me: find all strings which can be converted to
alpha with at most two operations, where alpha is some string
co
From: tutor-bounces+ramit.prasad=jpmorgan@python.org
[mailto:tutor-bounces+ramit.prasad=jpmorgan@python.org] On Behalf Of
learner404
Sent: Thursday, November 10, 2011 10:44 AM
To: Rich Lovely
Cc: Tutor Python
Subject: Re: [Tutor] [OSX] "Executable" .py or pyc script (stuck at Applescript)
>1) Using string formatting:
> >>> print("x{0}x{1}x".format(" " * 38, " " * 9))
You can specify alignment and padding with string formatting too. It just
requires you to know the formatting mini-language.
>>> 'x{0:>40}x{1:^30}x{2:<40}'.format( 'right', 'center' , 'left' )
'x
On Nov 10, 2011, at 13:52, Francesco Loffredo wrote:
> Alexander Etter wrote:
>>
>> Hi. My friend gave me a good wake up exercise which I do not want you to
>> solve for me: find all strings which can be converted to alpha with at most
>> two operations, where alpha is some string constant, a
On 2011-11-10 21:54, Cranky Frankie wrote:
What is the easiest way in Python 3.x to write output positionally?
For example I have one literal I want in column 1, the next one in
column 40, the third one in column 50. I've tried usings tabs and I'm
not getting what I want. Is it something to do wi
I decided to try using python version 2.1.3 with pygame version 1.7.1 (I
hope they're compatable) and the livewires version that was available at
livewires.org.uk, I think it's version 2.1 . After getting the following
error message I tried researching the problem myself at bing.com and then
google
On 11/10/2011 03:54 PM, Cranky Frankie wrote:
What is the easiest way in Python 3.x to write output positionally?
For example I have one literal I want in column 1, the next one in
column 40, the third one in column 50. I've tried usings tabs and I'm
not getting what I want. Is it something to do
What is the easiest way in Python 3.x to write output positionally?
For example I have one literal I want in column 1, the next one in
column 40, the third one in column 50. I've tried usings tabs and I'm
not getting what I want. Is it something to do with C style printf
formatting? An example woul
Alt+G, or Edit>Go To Line.
On Thu, Nov 10, 2011 at 1:58 PM, Nathaniel Trujillo
wrote:
> How do I get to line 362 of a program without counting each line ? Thanks
> for the help.
> ___
> Tutor maillist - Tutor@python.org
> To unsubscribe or change sub
I accidentally replied just to the OP, so I'm forwarding my comments
to the list for the record.
-- Forwarded message --
From: Rance Hall
Date: Thu, Nov 10, 2011 at 1:36 PM
Subject: Re: [Tutor] sifting through a long program
To: Nathaniel Trujillo
On Thu, Nov 10, 2011 at 12:58
if you are using vim type 262G
This is a list for python tutoring. People use a variety of text editors.
You should google 'how do I go to a specific line in
On Thu, Nov 10, 2011 at 1:58 PM, Nathaniel Trujillo
wrote:
> How do I get to line 362 of a program without counting each line ? Thanks
How do I get to line 362 of a program without counting each line ? Thanks
for the help.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Thu, Nov 10, 2011 at 12:01 PM, Wayne Werner wrote:
>
> On Thu, Nov 10, 2011 at 11:55 AM, Nathaniel Trujillo <
> hothottr...@gmail.com> wrote:
>
>> Could you tell me where I can get a free download of livewires for python
>> version 3.1.1 ? And one that does not have a trial period please. I loo
Alexander Etter wrote:
Hi. My friend gave me a good wake up exercise which I do not want you to solve
for me: find all strings which can be converted to alpha with at most two
operations, where alpha is some string constant, and a substring of at least
length three of alpha must be in the ans
> On 11/10/11, Original Poster Alexander Etter wrote:
>>
>> Hi. My friend gave me a good wake up exercise which I do not want you to
>> solve for me: find all strings which can be converted to alpha with at
most
>> two operations, where alpha is some string constant, and a substring of
at
>> least
I actually am not familiar with python enough to know what code to use.
Thanks for the help.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On Thu, Nov 10, 2011 at 11:55 AM, Nathaniel Trujillo
wrote:
> Could you tell me where I can get a free download of livewires for python
> version 3.1.1 ? And one that does not have a trial period please. I looked
> and looked but all I found was the one for version 2.x. I thought I had the
> one f
Could you tell me where I can get a free download of livewires for python
version 3.1.1 ? And one that does not have a trial period please. I looked
and looked but all I found was the one for version 2.x. I thought I had the
one for version 3.1.1 but I guess I was wrong. I don't know if I am
direct
Nathaniel Trujillo wrote:
> First I typed help() into the python 3.1.1 interpreter and then I typed
> modules to see if there was a beginners module and it wasn't there but
> when I went into the
> C:\Python31\Lib\site-packages\livewires folder I saw the file beginners.py
> right there in front of
Hi,
On 10 November 2011 16:23, lina wrote:
> def LongestCommonSubstring(S1, S2):
>M = [[0]*(1+len(S2)) for i in range(1+len(S1))]
>longest, x_longest = 0, 0
>for x in range(1,1+len(S1)):
>for y in range(1,1+len(S2)):
>M[x][y] = M[x-
lina wrote:
> Hi,
>
> I tested the one from
>
http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring
>
> mainly:
>
> #!/usr/bin/python3
>
> a=['1','2','3','7']
>
> b=['2','3','7']
>
> def LongestCommonSubstring(S1, S2):
> M = [[0]*(1+len(S2)) for i in
First I typed help() into the python 3.1.1 interpreter and then I typed
modules to see if there was a beginners module and it wasn't there but when
I went into the
C:\Python31\Lib\site-packages\livewires folder I saw the file beginners.py
right there in front of my face. So here is the program I am
On Thu, Nov 10, 2011 at 4:33 PM, Rich Lovely wrote:
>
> It looks like your script is being found fine, meaning the problem lies
> elsewhere - unless your actual app is called "avcOsxLinux.py, and you
> missed renaming it in the error message. Try adding a print statement as
> the very first line
If you're on linux or OSX, there's /usr/share/dict/words, which has a few
thousand words. Although no plurals, which caught me out once. If you're on
windows, it's not a hard file to find.
On 10 Nov 2011, at 16:14, Alex Hall wrote:
> What about just grabbing a bit text file, such as from Proj
Hi,
I tested the one from
http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring
mainly:
#!/usr/bin/python3
a=['1','2','3','7']
b=['2','3','7']
def LongestCommonSubstring(S1, S2):
M = [[0]*(1+len(S2)) for i in range(1+len(S1))]
longest, x_longes
What about just grabbing a bit text file, such as from Project
Gutenberg (sorry for the possibly incorrect spelling)? Or copying the
text from a large webpage and pasting it into a text file?
On 11/10/11, Alexander Etter wrote:
>
>
> Hi. My friend gave me a good wake up exercise which I do not wa
Hi. My friend gave me a good wake up exercise which I do not want you to solve
for me: find all strings which can be converted to alpha with at most two
operations, where alpha is some string constant, and a substring of at least
length three of alpha must be in the answers.
So, my question i
On 10 Nov 2011, at 15:20, learner404 wrote:
>
>
> On Thu, Nov 10, 2011 at 2:14 PM, Steven D'Aprano wrote:
> learner404 wrote:
> Hello list!
>
> - myapp.py is in a "myfolder" folder that the "users" will be able to
> download and put anywhere on their Mac.
> [...]
>
> In both cases OSX compla
On Thu, Nov 10, 2011 at 2:14 PM, Steven D'Aprano wrote:
> learner404 wrote:
>
>> Hello list!
>>
>> - myapp.py is in a "myfolder" folder that the "users" will be able to
>> download and put anywhere on their Mac.
>>
> [...]
>
> In both cases OSX complains it can't find the file.
>>
>
> Do you mean
My mistakes, the first generated-data has some problems:
the newly uploaded
tar.gz one is:
https://docs.google.com/open?id=0B93SVRfpVVg3Mjk0YjYzYTMtNzgzZS00NDk4LWI1M2QtNGE5OGZlMjYyNmM5
zip one is
https://docs.google.com/open?id=0B93SVRfpVVg3MDYwZWMzYzItYmI4ZC00MmIxLTg0NmMtMzM5MzZkZTAxZjJl
The b
On Thu, Nov 10, 2011 at 10:02 PM, Walter Prins wrote:
> Hi Lina,
>
> On 10 November 2011 13:05, lina wrote:
>>
>> from 10 groups of data (namely from 1-84) find some pathway, or network.
>>
>> such as
>> Group 1 (file 1): 1 3 8 5 7 4
>> Group 2 (file 2): 2 8 5 7 4 3 4 8 5 7 4
>>
>> so we can see
On Thu, Nov 10, 2011 at 10:02 PM, Walter Prins wrote:
> Hi Lina,
>
> On 10 November 2011 13:05, lina wrote:
>>
>> from 10 groups of data (namely from 1-84) find some pathway, or network.
>>
>> such as
>> Group 1 (file 1): 1 3 8 5 7 4
>> Group 2 (file 2): 2 8 5 7 4 3 4 8 5 7 4
>>
>> so we can see
Thanks for your reply.
2011/11/10 Steven D'Aprano
> Jerry Zhang wrote:
>
>> As you know, there are several kinds of relationships between classes in
>> the UML -- dependency, association, aggregation, composition.
>>
>
> "As you know"... no, I'm afraid I don't know. Believe it or not, it is
> po
On Thu, Nov 10, 2011 at 10:02 PM, Wayne Werner wrote:
>
> On Thu, Nov 10, 2011 at 7:05 AM, lina wrote:
>>
>> Hi,
>>
>> Thanks all again for your help in previous post.
>>
>> Here I meet something I am not experienced, about:
>>
>> from 10 groups of data (namely from 1-84) find some pathway, or n
Hi Lina,
On 10 November 2011 13:05, lina wrote:
> from 10 groups of data (namely from 1-84) find some pathway, or network.
>
> such as
> Group 1 (file 1): 1 3 8 5 7 4
> Group 2 (file 2): 2 8 5 7 4 3 4 8 5 7 4
>
> so we can see that the 8 -> 5 -> 7 -> 4 is a pathway.
>
I'm sorry but I'm not re
On Thu, Nov 10, 2011 at 7:05 AM, lina wrote:
> Hi,
>
> Thanks all again for your help in previous post.
>
> Here I meet something I am not experienced, about:
>
> from 10 groups of data (namely from 1-84) find some pathway, or network.
>
> such as
> Group 1 (file 1): 1 3 8 5 7 4
> Group 2 (file
On Thu, Nov 10, 2011 at 8:48 PM, Steven D'Aprano wrote:
> lina wrote:
>>
>> Hi,
>>
>> How to remove the coming duplication,
>>
>> Here I wrote one (not working):
>>
>>
> a=['2', '5', '7', '5', '5']
>
> [...]
>>
>> I wish to get a is [2,5,7,5]
>>
>> just remove the coming duplication, not uniqu
Jerry Zhang wrote:
As you know, there are several kinds of relationships between classes in
the UML -- dependency, association, aggregation, composition.
"As you know"... no, I'm afraid I don't know. Believe it or not, it is
possible to be an experienced, good programmer and still know nothing
Hi,
Thanks all again for your help in previous post.
Here I meet something I am not experienced, about:
from 10 groups of data (namely from 1-84) find some pathway, or network.
such as
Group 1 (file 1): 1 3 8 5 7 4
Group 2 (file 2): 2 8 5 7 4 3 4 8 5 7 4
so we can see that the 8 -> 5 -> 7 ->
learner404 wrote:
Hello list!
- myapp.py is in a "myfolder" folder that the "users" will be able to
download and put anywhere on their Mac.
[...]
In both cases OSX complains it can't find the file.
Do you mean that AppleScript can't find the file, or that Python can't
find the file?
Pleas
lina wrote:
Hi,
How to remove the coming duplication,
Here I wrote one (not working):
a=['2', '5', '7', '5', '5']
[...]
I wish to get a is [2,5,7,5]
just remove the coming duplication, not unique the list.
a = [2, 5, 7, 5, 5]
b = a[0:1] # slice of the first item only
for x in a[1:]: #
On 2011-11-10 09:26, lina wrote:
atoms=[]
def fetchonefiledata(infilename):
for line in open(infilename,"r"):
parts=line.strip().split()
atoms=parts[2]
print(atoms[0])
First you define "atoms" as an empty list, but in the line
atoms
Hello list!
- myapp.py is in a "myfolder" folder that the "users" will be able to
download and put anywhere on their Mac.
- users don't have any Python knowledge and I have no idea if there's a
python launcher on their mac
=> trying to make an applescript file in the folder right next to myapp.p
2sovs4c, 83a6uf6jpq.
http://2ufgrfdi6r.blog.com/w64/
52fdsyt04v hwfqg zzxy9lf1dx, d3xxy67x4 acih3ta8. 7hnkugc99tv waacqm1ao.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
Op 10-11-11 06:03, Nathaniel Trujillo schreef:
I am using python version 2.7.2. I put the version of livewires for
python 2.x in the right folder this time and after running the
following program I got a different error message. Here they are.
program
# New Graphics Window
# Demonstrates creati
As you know, there are several kinds of relationships between classes in
the UML -- dependency, association, aggregation, composition.
Q1. Is there any article or code example on its implementation in python?
Q2. More specific, in composition model, the container object may be
responsible for the h
Asokan Pichai wrote:
> On Thu, Nov 10, 2011 at 2:07 PM, Peter Otten <__pete...@web.de> wrote:
>
>> Christian Witts wrote:
>>
>> > def remove_coming_duplication(a_list):
>> > return [element for idx, element in enumerate(a_list) if element
>> > !=
>> > a_list[idx-1]]
>>
>> Beware of nega
On Thu, Nov 10, 2011 at 2:07 PM, Peter Otten <__pete...@web.de> wrote:
> Christian Witts wrote:
>
> > def remove_coming_duplication(a_list):
> > return [element for idx, element in enumerate(a_list) if element !=
> > a_list[idx-1]]
>
> Beware of negative indices:
>
> >>> remove_coming_duplica
Christian Witts wrote:
> def remove_coming_duplication(a_list):
> return [element for idx, element in enumerate(a_list) if element !=
> a_list[idx-1]]
Beware of negative indices:
>>> remove_coming_duplication([1, 2, 1])
[2, 1] # should be [1, 2, 1]
Thanks for all, I found the problems I faced is more tricky than the
simple list I gave.
Here the list is: a row of numbers, not one number,
such as print a_list[1] is:
1
1
9
7
7
9
9
9
print(a_list) is:
617
617
790
571
571
790
790
790
I attached the codes written based on the suggestions al
I was so miffed at not reading the OP's
mail carefully that I wrote a one liner.
Ok. Here it goes:
def no_adjacent_dup(lst):
return [ x for x, y in zip(lst, lst[1:]) if x != y] + [lst[-1]]
:-) Enjoyed working that one out; but whether it is a good solution
Asokan Pichai
65 matches
Mail list logo