In playing around with Pyton 3 dictionaries I've come up with 2 questions
1) How are duplicate keys handled? For example:
Qb_Dict = {"Montana": ["Joe", "Montana", "415-123-4567",
"joe.mont...@gmail.com","Candlestick Park"],
"Tarkington": ["Fran", "651-321-7657", "frank.tarking...@gmail.com",
"Met
On 11/23/2011 8:04 AM, Cranky Frankie wrote:
In playing around with Pyton 3 dictionaries I've come up with 2 questions
1) How are duplicate keys handled? For example:
Qb_Dict = {"Montana": ["Joe", "Montana", "415-123-4567",
"joe.mont...@gmail.com","Candlestick Park"],
"Tarkington": ["Fran", "65
On 2011/11/23 03:04 PM, Cranky Frankie wrote:
In playing around with Pyton 3 dictionaries I've come up with 2 questions
1) How are duplicate keys handled? For example:
Qb_Dict = {"Montana": ["Joe", "Montana", "415-123-4567",
"joe.mont...@gmail.com","Candlestick Park"],
"Tarkington": ["Fran", "6
On Wed, Nov 23, 2011 at 7:04 AM, Cranky Frankie wrote:
> In playing around with Pyton 3 dictionaries I've come up with 2 questions
>
> 1) How are duplicate keys handled? For example:
>
> Qb_Dict = {"Montana": ["Joe", "Montana", "415-123-4567",
> "joe.mont...@gmail.com","Candlestick Park"],
> "Tark
Cranky Frankie wrote:
> In playing around with Pyton 3 dictionaries I've come up with 2 questions
>
> 1) How are duplicate keys handled? For example:
>
> Qb_Dict = {"Montana": ["Joe", "Montana", "415-123-4567",
> "joe.mont...@gmail.com","Candlestick Park"],
> "Tarkington": ["Fran", "651-321-7657
I'm reading in a pickled file. The program works but I'm having
trouble sensing end of file. Here's the program:
#
# pickle_in.py
# program to read in a pickled file
#
# Frank L. Palmeri
#
import pickle # import the pickle module
pickle_file = open("d:/Work/pickl
Hi.
I have written a simple GUI program. It works just like it is intended to
do, but there
is a problem, I feel like I could make it shorter. I thought of using
classes instead of
doing it the way I have done.
Here is my code:
from tkinter import*
button1_color="green"
button1_value=False
Cranky Frankie wrote:
> I'm reading in a pickled file. The program works but I'm having
> trouble sensing end of file. Here's the program:
>
> #
> # pickle_in.py
> # program to read in a pickled file
> #
> # Frank L. Palmeri
> #
>
> import pickle # import the pi
I'm more of a beginner, so it would be nice for it to work with Livewires.
It doesn't need to be that complex (no need for air pressure, elasticity,
or energy.) I just need enough that I will stay on the ground and that when
I swing sprites around on a rope, they swing in a circle, not a square. A
Mic wrote:
> Hi.
> I have written a simple GUI program. It works just like it is intended to
> do, but there
> is a problem, I feel like I could make it shorter. I thought of using
> classes instead of
> doing it the way I have done.
>
> Here is my code:
>
> from tkinter import*
>
> button1_col
On Wed, Nov 23, 2011 at 10:35 AM, Mic wrote:
> Hi.
> I have written a simple GUI program. It works just like it is intended to
> do, but there
> is a problem, I feel like I could make it shorter. I thought of using
> classes instead of
> doing it the way I have done.
>
> Here is my code:
>
> from
From: Peter Otten <__pete...@web.de> wrote:
snip
<>
Thanks Peter, that was it. I was treating pickle like standard file
i/o when it's not that at all.
The reason why I'm "pickling" is I'm trying to include information on
Python data structures in the presentaton I'm preparing.
Here are the two p
Hello All,
I have the following code and I am quite satisfied with its design BUT I
have the feeling I can do better.
Basically the, main() execute the program (I did not put the parsing of
arguments function). I am opening
an Excel document and writing content in a CSV one w/ different format.
On Wed, Nov 23, 2011 at 12:03 PM, Cranky Frankie
wrote:
> [...]
> The reason why I'm "pickling" is I'm trying to include information on
> Python data structures in the presentaton I'm preparing. [...]
>
In your context why not just use modules?
# data.py
Qb_dict = {"Montana": ["Joe", "Montana"
On 11/22/2011 11:25 AM Cranky Frankie said...
quarterbacks = [] # Create an empty object list
In the interest of preferred techniques, your loop will be more pythonic
when you write this part...
len_Qb_list = len(Qb_list) # Get the lenght of the list of
I chose to ignore the "using classes" part. If you like you can turn the
button_clicked() function into a method of a subclass of Button. You can
also move the Button configuration done in create_widgets() into the
__init__() method of that subclass.
import tkinter as tk
from functools import pa
Cranky Frankie wrote:
I'm reading in a pickled file. The program works but I'm having
trouble sensing end of file. Here's the program:
[...]
Traceback (most recent call last):
File "D:\MyDocs\Python\pickle_in.py", line 21, in
read_file = pickle.load(pickle_file)# read the next re
Cranky Frankie wrote:
From: Peter Otten <__pete...@web.de> wrote:
snip
<>
Thanks Peter, that was it. I was treating pickle like standard file
i/o when it's not that at all.
I don't understand what you mean by this.
Pickle does standard file I/O in the same way that opening a JPEG in an
image
18 matches
Mail list logo