Hi Chris,
Straight to the point, this is how to populate a python dictionary.
customer = {}
This statement makes a new dictionary, which is empty though, called customer.
A python dictionary has a pair of key and value linked with semicolon and
seperated from other pairs by a comma.
print
On 2011-11-23 05:15, Chris Kavanagh wrote:
I was going over one of Derek Banas' tutorials on youtube, and came
across something I hadn't seen before. A variable with a list beside it
(see code below). He sets the variable, customer , equal to a dict. Then
uses the variable with ['firstname'],['la
I was going over one of Derek Banas' tutorials on youtube, and came
across something I hadn't seen before. A variable with a list beside it
(see code below). He sets the variable, customer , equal to a dict. Then
uses the variable with ['firstname'],['lastname'], ect. I've never seen
this in my
On Wed, Nov 23, 2011 at 2:47 AM, Mic wrote:
>
[LOTS OF STUFF SNIPPED]
>>> self.chair1.configure(bg="green")
>>> os.remove ("Hamburg_Dortmund20_00")
>
>> And now you delete that file you created without having
>> done anything with it?
>
> The meaning is that when the button is pressed once, it ch
I think python- ogre has a physics engine? Its 3d though
Sent from my Verizon Wireless BlackBerry
-Original Message-
From: Christopher King
Sender: tutor-bounces+eire1130=gmail@python.org
Date: Tue, 22 Nov 2011 19:22:27
To: python mail list
Subject: [Tutor] Physics Engine
_
Does anyone know a good physics engine that works with livewires, or a
good reference on how to build 2-D physic engines (preferably the former.)
It needs to work well with rope objects.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change sub
>
> You want to persist data changes to a file? Thats easy enough.
Yes, but I want it built in to the objects built in methods like for
example doing
*listquacker[3]="This string needs to be updated immediately**."*
Should write the new data to a file. It should also work for all data
types, not j
On 11/22/2011 08:13 AM, Steven D'Aprano wrote:
Ken G. wrote:
It occurred to me last week while reviewing the files I made in using
Python, it could be somewhat similar to a database.
What would be a different between a Python files and Python
databases? Granted, the access in creating them a
OK, So I'll guess you want a desktop program that eventually sends
commands to an online service?
If so thats a lot easier to do with Tkinter... :-)
Well, it is enough if the program can run on my desktop. However, there are
courses about learning how to make programs like these online, but I
On 22/11/11 19:41, Mic wrote:
A Tkinter program is never going to be an online GUI, it only works on
the desktop. For that you need to use HTML5/Flash/Javascript/Java etc.
And its all a lot more messy.
No, I didn't mean that it have to work online. It is just fine if it
works on the desktop.
Button1 is supposed to represent chair one in the train.
So call it chair_1 or put it in a list called chairs
so that you can access them as chairs[0] or whatever.
But get a name that reflects what its actually used for.
Yes, perhaps that is a good way to go. I didn't think about that.
at
Dave thank you for your patience. It really is appreciated.
In the interest of closing this thread I'm posting the final version
that works, and achieves the goal of showing how to represent data
both in a list and in an object:
#
# Example to show the difference between list data and object data
On 22/11/11 18:50, Mayo Adams wrote:
for item in tuplelist
outputfile.write (item)
doesn't work, and I suppose I scarcely expect it should, but I am at a
loss to find out how to do it.
You need to convert the tuple to a string.
And you need to add a newline at the end.
A simple w
Hi all,
We work with a python package (ESRI geoprocessor) that only releases their
packages tied to specific minor version of Python (e.g. 2.5). We are
predominantly working with 2.6, but have Python 2.5 installed as well.
When we want to call modules that use the geoprocessor package, we are
On 22/11/11 17:09, Cranky Frankie wrote:
Dave I'm sorry but I just don't get this. I have virtually no
experience with classes.
You need to step back and rethink the terminology a bit.
A class is a cookie cutter for creating objects.
Objects are instances of the class.
What seems like it sh
On Tue, Nov 22, 2011 at 7:50 PM, Mayo Adams wrote:
> I have a list of tuples of the form (string,integer) that I would like to
> write to a file with a line break between each. Simply writing to a file
> object thus
>
> for item in tuplelist
> outputfile.write (item)
>
> doesn't work,
On 22/11/11 15:11, Mic wrote:
> Also, do you really need the colors, you don't actually use them for
> anything below except the initial color, but you might as well just hard
Button1 is supposed to represent chair one in the train.
So call it chair_1 or put it in a list called chairs
so th
I have a list of tuples of the form (string,integer) that I would like to
write to a file with a line break between each. Simply writing to a file
object thus
for item in tuplelist
outputfile.write (item)
doesn't work, and I suppose I scarcely expect it should, but I am at a loss
to
On 11/22/2011 12:09 PM, Cranky Frankie wrote:
On Tue, Nov 22, 2011 at 11:26 AM, Dave Angel wrote:
snip
quarterbacks = []
for
quarterbacks.append( )
Now that you really have a list, then you can print a particular one with:
print (quarterbacks[2].last_name)
Dave I'm sorry but
On Tue, Nov 22, 2011 at 11:26 AM, Dave Angel wrote:
snip
> quarterbacks = []
> for
> quarterbacks.append( )
>
>
> Now that you really have a list, then you can print a particular one with:
>
> print (quarterbacks[2].last_name)
Dave I'm sorry but I just don't get this. I have virtua
On 11/22/2011 09:20 AM, Cranky Frankie wrote:
OK, but this is still not working:
class Qb:
def __init__(self, first_name='', last_name='', phone='',
email='', stadium=''):
self.first_name = first_name
self.last_name = last_name
self.phone = phone
self.ema
Please change to a sensible subject when replying to digest messages.
-Yes, sorry about that.
from tkinter import*
button1_color="green"
button1_value=False
button2_color="green"
button2_value=False
buttonX_value still doesn't say mu
On 21-Nov-11 23:49, Charles Becker wrote:
Alan, Steve, future readers,
After some re-reading and hacking I was able to discover the solution. Since I
raised the question here it is :
[['{0}'.format(x+1), x+1] for x in range(size)]
Just to fill out some other refinements for your information
OK, but this is still not working:
class Qb:
def __init__(self, first_name='', last_name='', phone='',
email='', stadium=''):
self.first_name = first_name
self.last_name = last_name
self.phone = phone
self.email = email
self.stadium = stadium
Qb_list
On 11/22/2011 08:17 AM, Cranky Frankie wrote:
I have a basic question about how to load a class. If I have this class:
class QB:
def __init__(self, first_name='', last_name='', phone='',
email='', stadium=''):
self.first_name = first_name
self.last_name = last_name
Ken G. wrote:
It occurred to me last week while reviewing the files I made in using
Python, it could be somewhat similar to a database.
What would be a different between a Python files and Python databases?
Granted, the access in creating them are different, I really don't see
any different
I have a basic question about how to load a class. If I have this class:
class QB:
def __init__(self, first_name='', last_name='', phone='',
email='', stadium=''):
self.first_name = first_name
self.last_name = last_name
self.phone = phone
self.email = email
Okay!
I wrote some code. It is below so that you can avoid scrolling down and
seeing it if you do not want to see any code!
HTH
Asokan
people = list(" ABCDEFGHIJKLMN")
COUNT = len(people)
remove = 3
SPACE = ' '
def survivorCount(a):
return len(a) - a.count(
28 matches
Mail list logo