Hello all,
I use emacs' org-mode for note taking in my classes. I have a simple
script that starts emacs and creates a new .org file with an id number
and date like so:
001_Jan_12_2012.org
I'd like to include the class name so that it becomes:
001_Jan_12_2012_CLASSNAME.org
So I have a simple Tk w
Greetings Francis,
You have entered the Unicode or multiple character set zone. This
is the deep end of the pool, and even experienced practitioners have
difficulty here. Fortunately, Python eases the burden on you, but
this still requires some care.
: Given a simple text file of departmen
On Thu, Jan 12, 2012 at 1:20 PM, Francis P. Boscoe wrote:
> Given a simple text file of departments, capitals, longitude and latitude
> separated by commas
>
> Ahuachapán,Ahuachapán,-89.8450,13.9190
> Cabañas,Sensuntepeque,-88.6300,13.8800
> Cuscatlán,Cojutepeque,-88.9333,13.7167
>
> I would like
On 01/12/2012 06:56 PM, Nick W wrote:
first problem: easy fix just remember that len() returns the actual
number of items in the list but that list is indexed starting at 0 so
just replace your line of
pick = len(names)
with:
pick = len(names) - 1
and for problem #2:
just use str
On 1/12/2012 5:48 PM, Claude Matherne wrote:
Hello all,
I am a beginner to python and I am trying to make a simple program
that takes in some names as input into a list and then randomly picks
a vaule from that list as a winner.
Here is the code:
import random
choice = None
names = [ ]
while c
first problem: easy fix just remember that len() returns the actual
number of items in the list but that list is indexed starting at 0 so
just replace your line of
pick = len(names)
with:
pick = len(names) - 1
and for problem #2:
just use string formating... like for example instead
>I would like to know to how to read in the file and then access arbitary rows
>in the file, so that I can print a line such as:
> Cabañas,Sensuntepeque,-88.6300,13.8800
>The capital of Cabañas is Sensuntepeque
>while preserving the non-English characters
>now, for example, I get
>Cabañas
Ma
Hello all,
I am a beginner to python and I am trying to make a simple program that
takes in some names as input into a list and then randomly picks a vaule
from that list as a winner.
Here is the code:
import random
choice = None
names = [ ]
while choice != "0":
print(
"""
Given a simple text file of departments, capitals, longitude and latitude
separated by commas
Ahuachapán,Ahuachapán,-89.8450,13.9190
Cabañas,Sensuntepeque,-88.6300,13.8800
Cuscatlán,Cojutepeque,-88.9333,13.7167
I would like to know to how to read in the file and then access arbitary
rows in the
On 12 January 2012 16:57, amt <0101...@gmail.com> wrote:
> I'll give it another try:
> So the code should look like this:
>
> bag = "{0}\n{1}\n{2}".format(line1,line2,line3)
> target.write(bag)
>
Yes.
>> Final comment, you can get rid of the variable "bag" by directly
>> printing the result of th
Hello ANKUR,
Just add a timer variable to the plane class. Every time it is
updated, subtract time from the timer. When it hits 0, the bullet can
be fired. Else, it cannot. When the bullet is fired, reset the timer
to a delay value. It's that simple :)
Cheers,
Nathanael Lastname.
--
My Blo
In the last code provided I messed up the Bullet Class Code. Apologies for
that. Below is my code :
import pygame
from pygame.locals import *
import random
import time
pygame.init()
screen=pygame.display.set_mode((640,480),0,24)
pygame.display.set_caption("Hit The Stone")
background=pygame.Surfac
import pygame
from pygame.locals import *
import random
pygame.init()
screen=pygame.display.set_mode((640,480),0,24)
pygame.display.set_caption("Hit The Stone")
background=pygame.Surface(screen.get_size())
background=background.convert()
screen.blit(background,(0,0))
class Plane(pygame.sprite.Spr
I'll give it another try:
On Thu, Jan 12, 2012 at 10:26 AM, Walter Prins wrote:
> Hi amt,
>
> On 12 January 2012 15:11, amt <0101...@gmail.com> wrote:
>> After reading from http://docs.python.org/library/stdtypes.html I came
>> up with this:
>>
>> bag = "%s\n%s\n%s\n".format(line1,line2,line3)
>>
On Thu, Jan 12, 2012 at 10:56 PM, Dave Angel wrote:
> On 01/12/2012 09:38 AM, lina wrote:
>>
>> Hi,
>>
>> there is a file
>>
>> $ cat atom-pair_9.out | wc -l
>> 75426
>>
>> there is 75426 lines there,
>>
>> results=[]
>> unique={}
>> for line in open(tobetranslatedfile,"r"):
>>
...Exercise 16, extra credit 3...Code from the book...like the author mentioned
The book and author, do they have a name...? Is this an exercise in refactoring?
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
Hi amt,
On 12 January 2012 15:11, amt <0101...@gmail.com> wrote:
> After reading from http://docs.python.org/library/stdtypes.html I came
> up with this:
>
> bag = "%s\n%s\n%s\n".format(line1,line2,line3)
> target.write(bag)
>
> Is this how it is supposed to look like using str.format?
Not quite.
On Thu, Jan 12, 2012 at 9:40 AM, Walter Prins wrote:
> Hi,
>
> On 12 January 2012 14:24, amt <0101...@gmail.com> wrote:
>>
>> target.write("%s\n%s\n%s\n" %(line1, line2, line3))
>>
>> This is the only method I was able to figure out of solving the exercise.
>>
>> Are there other ways of solving th
On 01/12/2012 09:38 AM, lina wrote:
Hi,
there is a file
$ cat atom-pair_9.out | wc -l
75426
there is 75426 lines there,
results=[]
unique={}
for line in open(tobetranslatedfile,"r"):
tobetranslatedparts=line.strip().split()
results.append(dictionary[tobetransl
On 1/12/2012 9:38 AM, lina wrote:
Hi,
there is a file
$ cat atom-pair_9.out | wc -l
75426
there is 75426 lines there,
results=[]
unique={}
for line in open(tobetranslatedfile,"r"):
tobetranslatedparts=line.strip().split()
results.append(dictionary[tobetranslat
Hi
On 12 January 2012 14:38, lina wrote:
> Hi,
>
> there is a file
>
> $ cat atom-pair_9.out | wc -l
> 75426
>
> there is 75426 lines there,
>
> results=[]
> unique={}
> for line in open(tobetranslatedfile,"r"):
> tobetranslatedparts=line.strip().split()
> results.append(di
Hi,
On 12 January 2012 14:24, amt <0101...@gmail.com> wrote:
>
> target.write("%s\n%s\n%s\n" %(line1, line2, line3))
>
> This is the only method I was able to figure out of solving the exercise.
>
> Are there other ways of solving this exercise using strings, formats
> and escapes like the author
Hi,
there is a file
$ cat atom-pair_9.out | wc -l
75426
there is 75426 lines there,
results=[]
unique={}
for line in open(tobetranslatedfile,"r"):
tobetranslatedparts=line.strip().split()
results.append(dictionary[tobetranslatedparts[2]])
it complains
results.a
Exercise 16, extra credit 3: There's too much repetition in this file.
Use strings, formats, and escapes to print out line1, line2, and line3
with just one target.write() command instead of 6.
Code from the book:
from sys import argv
script, filename = argv
print "We're going to erase %r." % fi
On Thu, Jan 12, 2012 at 1:39 PM, ANKUR AGGARWAL wrote:
> Hey
> I was making a demo shooting game and problem is that I want
> a continuous stream of bullets. As of now on pressing the space key only one
> bullet comes out of the plane (I want this to be continuous stream). On
> pressing space key
Hey
I was making a demo shooting game and problem is that I want
a continuous stream of bullets. As of now on pressing the space key only
one bullet comes out of the plane (I want this to be continuous stream). On
pressing space key again bullet starts from its initial point. My problem
in the code
26 matches
Mail list logo