the units sold based on
period.
dictionary[(year,period)] = [ jan, feb, mar, apr, may, jun, july, aug, sep,
oct, nov ,dec]
I would prefer to have the months just be an array index 0 through 11 and when
it reads the file it increments the number contained there.
TIA,
--
Paul Kraus
=-=-=-=-=-=-=-=-=
On Wednesday 28 December 2005 10:18 am, Paul Kraus wrote:
> I am trying to build a data structure that would be a dictionary of a
> dictionary of a list.
>
> In Perl I would build the structure like so $dictionary{key1}{key2}[0] = X
> I would iterate like so ...
> foreach my
How do I code this in python. Assuming fields is a list of 3 things.
(myfielda, myfieldb, myfieldc) = fields
When i try that I get
ValueError: need more than 1 value to unpack.
If i print fields it is in need printed as
['somestring','somestring','somestri
Never mind. i figured this out. the top line of a file i was reading in and
splitting only had 1 char so "fields" on that line was not a list. I fixed
this.
On Wednesday 28 December 2005 3:12 pm, Paul Kraus wrote:
> How do I code this in python. Assuming fields is a lis
[key1][0]
How would I increment it or assign it if it didn't exist. I assumed like this.
dict[key1][0] = dictionary.get(key1[0],0) + X
--
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fa
> That is the approach Paul took originally (see the other fork of this
> thread). He is accumulating a sparse 3d matrix where the keys are year,
> field6 and month. (He hasn't said what field6 represents.) The problem
> is that he wants to print out counts corresponding to all the existing
> year
On Tuesday 17 January 2006 12:11 pm, andy senoaji wrote:
> I am starting to pull my hair here. There were some postings in the past,
> similar to my problem, but the response was not clear enough. Sorry if you
> thingk I am reposting this.
>
> I am trying to run (on an XP box) a simple open file us
arated getting input from converting it to
> integer so we can see if the user's entry is convertible.:
>
> available_points = MAX_POINTS - sum(points)
> print "You have " + available_points + " available."
> for x in range(len(attributes)):
> cvalue =
t are all the different
things can I do with a button besides just setting the command and the text
and such. These are just examples.
I can't find an easy way to do this.
I know there has to be i have tried the pydoc gui but I found nothing when i
searched list. *shrug*
--
ld I 'call the method keys'. from the example above.
--
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
I am developing applications that need to run without work on both windows and
linux and was wondering what gui toolkits everyone uses and why.
I have been looking at wxpython and tkinter.
Thanks in advance,
--
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
TIA,
--
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
This is my first gui application. It just takes a percentage and then based on
some options calculates a new price.
---
#!/usr/bin/python
from Tkinter import *
class Application( Frame ):
""" Price Calc GUI """
def __init__( self, master):
Frame.__
Anyone know where I can find information about how to embedd mysql into a
python application. I need my hand held. I have worked with mysql a lot. I
understand how to use python to manipulate a mysql database. What I want to
know is how to embedded a database into my application.
--
Paul
m486 -DSCO5' ./python -E ./setup.py build;; \
esac
/bin/sh: 9056 Memory fault - core dumped
make: *** [sharedmods] Error 139
--
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=
$line =~ m/^(.{10})(.{10})(.{13}) )
--
Paul Kraus
=-=-=-=-=-=-=-=-=-=-=
PEL Supply Company
Network Administrator
216.267.5775 Voice
216.267.6176 Fax
www.pelsupply.com
=-=-=-=-=-=-=-=-=-=-=
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Python regex is a bit more verbose than Perl but you can do the same thing:
>
> In [2]: import re
>
> In [11]: m=re.match("(.{10})(.{10})(.{13})", line)
>
> In [13]: m.group(1, 2, 3)
> Out[13]: ('1234567890', '1234567890', '123456789012 ')
That work great. Regex tend to be "expensive" is there a
17 matches
Mail list logo