t;>> well
>>>
>>> python_stuff.process(largestuff, otherparams1) # It's important that this
>>> data can be read (and I hope written) by python code
>>> python_stuff.process(largestuff, otherparams2)
>>>
>>> c_stuff.write(largestuff
n by "someone else look at yet?"
Thanks, Paul
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
between the two?
[1]
http://blog.chrischou.org/2010/02/28/simple-benchmark-between-cython-and-boost-python/
Thank you,
Paul
And a link I found today.
[2]
http://koichitamura.blogspot.com/2008/06/various-ways-to-integrate-python-and-c.html
On Sun, Oct 17, 2010 at 1:56 PM, Sithembewena Lloyd Dube
hi Danny,As far as i am aware you must declare your variable first, something like a=0The same would go for shope that helpspaulOn Sun Jun 22 10:45 , Danny Laya sent:Hi ! I have learned wiki tutor for non-programmer and I found some hill that stopping me. In Non-Programmer's Tutorial for Python/C
hi,I have two questions please:1. What is the difference between a classmethod and a staticmethod, and when would i use either?2. I want to create an object, presumably a class, to handle attributes of an open gl object.For example, if i wanted to create a 2d square i need 4 points, each with an x,
thon's style, and want to learn Programming from Python. If I
can learn it through synthesis sound, I will be very happy. :-) In addition, I
think if I can synthesis sound via Python Code, I will have more chance to
cooperate with other programer. :-)
Thanks!
Paul Yeh
___
did use enumerate and was wondering if I could use the line number, or
maybe I could use an re iterator.
Any advice would be much appreciated.
Thanks
paul
__ Information from ESET Smart Security, version of virus signature
database 4767 (20100113) __
The mess
after the NEW? (maybe putting this info into
a list)
Thanks again
paul
__ Information from ESET Smart Security, version of virus signature
database 4773 (20100114) __
The message was checked by ESET Smart Security.
http://www.ese
ave any tips on this? Can I just use things like
raw_input and lists?
Thanks
paul
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Using the following script, the (Windows 7) PC echoes the key presses but
doesn't quit (ever!)
import msvcrt
print('Press SPACE to stop...')
while True:
k = msvcrt.getch() # Strangely, this echoes to the IDLE window
if k == ' ': # Not recognized
break
_
my cmd.
Any help would be greatly appreciated. I'm open to improvements,
different ways of doing it and corrections. :) If more info is needed
let me know. Thanks.
/paul
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
er.py). Mailing
list companies spend beaucoup $$$ trying to parse addresses in order to
filter duplicates, to group by zip code, street, neighborhood, etc., and
this citation format looks similarly scary.
Congratulations on getting to a 95% solution using PLY.
--
rker + OneOrMore(Group(syntax_tree)) |
marker + Word(wordchars) |
syntax_tree )
Note that we use '<<' operator to "inject" the definition of a
syntax_element - we can't use '=' or we would get a different expression
than the one we used to define syntax_tree.
Now parse the string, and voila! Same as before.
Here is the entire script:
from pyparsing import nestedExpr, Suppress, oneOf, Forward, OneOrMore, Word,
printables, Group
syntax_element = Forward()
LPAR,RPAR = map(Suppress,"()")
syntax_tree = LPAR + syntax_element + RPAR
marker = oneOf("VBD ADJP VBN JJ DT PP NN UCP NP-PRD "
"NP NNS NNP CC NP-SBJ-1 CD VP -NONE- "
"IN NP-SBJ S")
punc = oneOf(", . ! ?")
wordchars = printables.replace("(","").replace(")","")
syntax_element << (
punc + punc |
marker + OneOrMore(Group(syntax_tree)) |
marker + Word(wordchars) |
syntax_tree )
results = syntax_tree.parseString(st_data)
from pprint import pprint
pprint(results.asList())
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
-Original Message-
From: Emad Nawfal (عماد نوفل) [mailto:emadnaw...@gmail.com]
Sent: Saturday, February 14, 2009 8:59 AM
To: Paul McGuire
Cc: tutor@python.org
Subject: Re: [Tutor] extracting phrases and their memberships from syntax
Thank you so much Paul, Kent, and Hoftkamp.
I was
Has anyone already mentioned the article in Python Magazine, May, 2008?
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
") + lower + H + GT
tests = """\
a b c h
a b c
a b c""".splitlines()
for t in tests:
print t
print sum((list(p.body)
for p in patt.searchString(t) if p.body), [])
print
Prints:
a b c h
['d', 'e', 'f',
in varying order, case variability, and (of course) varying whitespace - the
OP didn't explicitly say this XML data, but the sample does look suspicious.
If you only easy_install'ed pyparsing or used the binary windows installer,
please go back to SourceForge and download the source .ZIP or tarball
package - these have the full examples and htmldoc directories that the
auto-installers omit.
Good luck in your continued studies!
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
osted
within UtilityMill, the source code is publicly viewable.)
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
uld impact not only the Python 3.0 users, but would also degrade
performance for Python 2.x users using this code base. I can certainly use
this trick in those parts of pyparsing that are not performance-critical
(when building the parser to begin with for instance, as opposed
class names and/or .Net method names.
In general, I find your approach too intrusive into the objects you would
like to export or load. I would prefer to see a Loader and/or Exporter
class that takes my own application object, configured with table name and
field names, and then creates the proper
ributes - yet!
pass
def makeExportable(obj, exporter):
obj.exporter = exporter
a = ApplicationClass()
makeExportable(a, SQLExporter)
Now I have added exportability to an instance, without changing the class at
all. This might even be a class from a 3rd party li
de to Py3, and is fully Py2
compatible (even if you don't first bind xrange to range as in suggestion 1
- it simply copies the original list). It also makes it very explicit that
you REALLY WANT THE RANGE AS A LIST, and not just as something for counting
up to n.
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
AU - AU - AU - AU - AU - AU - AU - AU - AU - AU
['AB'] : AU - AU - AU - AU - AU - AU - AU - AU - AU - AU -
['AU'] : AU - AU - AU - AU - AU - AU - AU - AU - AU - AU
['ZZ'] : Somewhat nonsensical case
If you find th
at's going on. You could even write this as:
T = lambda s : "\t".join(s.split())
'case_def_gen' : T('case_def gen null'),
'nsuff_fem_pl' : T('nsuff null null'),
'abbrev' : T(
ch (brute-force is actually my
favorite first approach), generating all possible deals and then filtering
duplicates using a set of "already been seen" deals. A smarter algorithm
would generate only the unique deals. If someone were paying me to be that
smart, maybe I'd work on it.
I'm guessing this is an attempt to optimize a deck for playing a card game
like Magic or Pokemon, etc. Your plan is, given a set of 'n' cards in your
collection (presumbaly n>60, or there would be no problem to solve), to
compute all possible decks of 60 cards. Then you have some function to
evaluate this deck, or perhaps simulate playing it against another deck.
You will then exhaustively run this simulation function against each deck to
find which deck from your collection of 100's of cards is the "best".
By the time your program has finished running, I suspect the sun will be a
cold, dark cinder. But have fun with it.
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
quickly - the first conference had a session track on
configuration management, and every mention of "version control" was
transcribed as "virgin control" - a dubious prospect in any event.
-- Paul
___
Tutor maillist - T
tput:
Write {
file /Volumes/raid0/Z353_002_comp_v27.%04d.cin
file_type cin
name Write1
xpos 13762
ypos -364
}
Write {
file /Volumes/raid0/Z353_002_comp_v27.%04d.cin
colorspace linear
raw true
file_type exr
name Write1
selected true
xpos -487
ypos -155
}
Find out more about pyparsing at http://pyparsing.wikispaces.com.
Cheers,
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
123 paper clips
... 10Gb of intervening non-matching text...
456 paper planes
scanString will return the match for '123 paper' right away, before
processing the intervening 10Gb of non-matching text.
Best of luck in your pyparsing efforts!
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> Hi Paul. Thanks. I would like to get better at pyparsing. Can you
> recommend a good resource for learning. I am finding that what info I
> have found on the subject (on the web) isn't really explaining it from
> the ground up as much as I would like.
Hrmmm, not sure what to re
#x27;=', 121.20],
['CA', '=', 54.32], ['HA', '=', 4.21], ['C', '=', 0.0]]
54.32
121.21
85 ALA H = 8.60 N = CA = HA = 4.65 C =
[85, 'ALA', ['H', '=', 8.5996], ['N', '=', 0.0], ['CA', '=',
0.0], ['HA', '=', 4.6504], ['C', '=', 0.0]]
- C: 0.0
- CA: 0.0
- H: 8.6
- HA: 4.65
- N: 0.0
- kvdata: [['H', '=', 8.5996], ['N', '=', 0.0], ['CA', '=',
0.0], ['HA', '=', 4.6504], ['C', '=', 0.0]]
0.0
0.0
Learn more about pyparsing at http://pyparsing.wikispaces.com.
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
> -Original Message-
> From: amr...@iisermohali.ac.in [mailto:amr...@iisermohali.ac.in]
> Sent: Wednesday, July 29, 2009 12:13 AM
> To: Paul McGuire
> Cc: tutor@python.org
> Subject: Re: [Tutor] how to get blank value
>
> Thanks for help Sir but with these comm
pax both
displaying the message and demanding the user type in a command. Do I
need to fork a process? I have never done this, and the documentation is
confusing to me.
Thanks
Paul
def make_verify_list(self, archive, write_obj):
if self.__main.verbose:
sys.stdout.write('M
Hi Kevin
Is all your data in one big text file? Or do you have to type it in by
hand and want some type of script to do the calcluations?
I have to run right now. I'll be back in a few hours and can give you
some more help then, if no one else has offered.
Paul
On Tue, Jan 11, 2005 at
_obj, and pass
this object to each method.
These two steps seem to take things a bit far. On the other
hand, one could look at the set of modules and immediately
know how to use them.
Thanks
Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
and modules, it seems that the one module shouldn't run more than 500
lines. I * could* consolidate many of my classes in one file, but that
would make very long files.
Thanks
Paul
> - if one class has a helper class or function that isn't used anywhere
> else, put the helper into the s
.
Anything like the above concerning python would be
useful.
Any other suggestions would help also, the audience
will have computers, so a demonstration of small workshop would also be good -
the presentation/session is for 4 hours on the 10th February.
Paul
Thank you for all your feedback on this -
powerpoint presentations and all!!
Not only is the language amazing but the community
is fantastic!!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
then parse it.
I would like to make the code independent of lynx, if possible.
Thanks
Paul
--
****
*Paul Tremblay *
[EMAIL PROTECTED]*
___
Tutor maillist - Tutor@python.org
http://mail.pytho
On Tue, Mar 08, 2005 at 11:50:12AM -0500, Kent Johnson wrote:
>
> Paul Tremblay wrote:
>
> You can use urllib2 to do this. It is a little work to set it up to use
> Basic authentication. Here is an example (slightly modified from the
> urllib2 example page):
>
> impo
On Tue, Mar 08, 2005 at 01:42:40PM -0500, Kent Johnson wrote:
> Date: Tue, 08 Mar 2005 13:42:40 -0500
> From: Kent Johnson <[EMAIL PROTECTED]>
> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
> Cc: python tutor
> Subject: Re: [Tutor] getting a webpage via python
>
On Wed, Mar 09, 2005 at 08:29:46AM -0500, Kent Johnson wrote:
>
> Kent Johnson wrote:
> >Paul Tremblay wrote:
> >
> >>So I just make a file called /etc/router_passwords and include
> >>something like
> >>WRT54G username password
> >>
> &
Adobe Draw, with
small difference that I had to start it form my shell. I'm pretty sure
there are ways to start applications without a shell. That isn't too
hard. The hard part is writing a program with a graphical interface.
This is always hard, in any languge.
Paul
--
problem I have with the
python url2lib is the dfficulty of determining the realm. For example,
bot lynx and curl (command line url tools) don't need a realm to work.
This seems to mean that lynx and curl provide more flexibility.
Paul
--
x27;t version
and setup of python rather than my script. Can anyone make sense of
it?
Thanks
Paul
forwarded message
=
I tried to set this up according to the documentation at
http://rtf2xml.sourceforge.net/docs/installation.html#install-rtf2xml-module
But when I try to run
p
On Sat, Apr 16, 2005 at 12:58:33PM -0400, Paul Tremblay wrote:
> I have written a script that is available at:
>
> https://sourceforge.net/projects/rtf2xml/
>
> This script has gotten about 1600 downloads and I have not got many
> bug complaints. However, recently I got the bu
es/deletions. Basic stuff.
Thanks,
Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ng the
0'th element. So I'm going to fix pyparsing so that in the next release,
you'll be able to reference the sub-elements as:
print parsedEntries.country.tag
print parsedEntries.country.ai.war
print parsedEntries.country.ai.ferocity
This *may* break some existing code,
x27;, so RHS only worked
if it was handed a quoted string. Probably good practice to always enclose
in quotes the expression being assigned to a Forward using '<<'.
-- Paul
-Original Message-
From: Liam Clarke [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 23, 2005 9:03
ll take
care of the empty option, and recursively nesting RHS will avoid having to
repeat the other "scalar" entries.
RHS << ( pp.dblQuotedString.setParseAction(pp.removeQuotes) ^
identifier ^
integer ^
pp.Group( LBRACE + pp.ZeroOrMore( assignment
Liam -
I just uploaded an update to pyparsing, version 1.3.2, that should fix the
problem with using nested Dicts. Now you won't need to use [0] to
dereference the "0'th" element, just reference the nested elements as a.b.c,
or a["b"]["c"].
-- Paul
e '^' because your various terms were
fairly vague (you were still using Word(pp.printables), which would accept
just about anything). But now I think there is little ambiguity between a
quoted string, identifier, etc., and simple '|' or MatchFirst's will do.
Thi
same as setResultsName. Here setName is attaching a
name to this pattern, so that when it appears in an exception, the name will
be used instead of an encoded pattern string (such as W:012345...). No need
to do this for Literals, the literal string is used when it appears in an
exception.
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
bar = 20 } } }"""
res = assignment.parseString(test)
print res
print res.j
print res.j.line
print res.j.line.foo
print res.j.line.bar
And get:
[['j', [['line', [['foo', '10'], ['bar', '20']]
[['line', [['foo',
integer expression "masks" the real,
and since it occurs first, it will match first. The two solutions are:
number = (integer ^ real)
Or
number = (real | integer)
That is, use an Or, which will match the longest, or reorder the MatchFirst
to put the most restrictive expression first.
Welcom
rence is my 1.2Gb of RAM. It's an Athlon XP-M
3000+, which runs about 800MHz to save battery power, but can ratchet up to
1.6GHz when processing.
Cheers!
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
if cmd is not None:
cmd.command( player )
And that's it. All of the logic about the moving from room to room is
captured in the N,S,E,W references between Room objects. Moving Bob from
room to room is done by MoveCommands, as they are dynam
0,0.00
-1.008770,
-2.242426,0.00,0.00,0.00,1.00,0.00,0.00
0, 3, 2
0, 2, 1
NOTE: each vert line contains x,y,z,nx,ny,nz,u,v
Location of smf_export.py file on savefile:
http://www.savefile.com/files/1054095
Thanks, Paul ( upretirementman )
___
Tutor maillist - Tutor@python.org
ht
# Test for maps
#if faceUV = 0:
texture_map = "NULL.TIF"
Theyain schrieb:
> I'm not sure if this is really the place to do this, but I will ask anyways.
>
> Hello everyone, names Theyain. I want to learn Python. But I am one of
> those people who needs some one to "Beat me over the head" to actually
> learn something. I can't get myself to actually
eed to wonder: The .csv-file I give to the script for
testing is absolutely OK.
On a side note, would you think I should post this somewhere else? If
so, where?
Any help is appreciated - I'll answer tomorrow (have to go now).
Kindest regards, Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Joshua Simpson schrieb:
> On Dec 19, 2007 10:14 AM, Paul Schewietzek <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>
> Is there any way to handle this exception? As you can see, I already
> tried it with _mysql_exceptions.OperationalError (the
hat there might be a csv-module! I'm
on my way exploring it ;)
-paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
w entry, and then the new
record is appended to the empty list. If the key does exist, then you
retreive the list that's been built so far, and then the new record gets
appended.
-- Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Here is a pyparsing approach to your question. I've added some comments to
walk you through the various steps. By using pyparsing's makeHTMLTags
helper method, it is easy to write short programs to skim selected data tags
from out of an HTML page.
-- Paul
from pyparsing import ma
spod.Spod("andy") and pickles it to test.pickle.
3. Create test2.py to unpickle a Spod. Have test2.py *also* import spod,
and then have the rest of your code that follows "# New session". Modify
the pickle.load statement to save the result to a variable,
m after advice on indexes.
thanks for reading,
Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
e - most of us mortals have had to read it several times. Things
also get a little more complex with __new__ but its all in there
However I have not found a really good explanation of the whole
instance creation thing - perhaps this list could make one?
---
nd there seems to be a divide operation, but i dont quite know what it
> is talking about
> with the deltas.
>
> anyone have a good start point?
>
> thanks
> shawn
> ___
> Tutor maillist - Tutor@python.org
> http://mail.
o functions
> on objects..
>
> If people have more comments in the light of the bigger spec. above, I'd
> still love to hear them...
>
> Matt
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailm
tember", "October", "November", "December"]
> monthStr = months[month-1]
>date2 = monthStr+" " + str(day) + ", " + str(year)
>
>print "The date is", date1, "or", date2
>
> main()
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
rt math
> you can type: diameter * math.pi
>
> if you use from math import *
> you can type: diameter * pi
>
> Cheers,
> pujo
>
>
> On 9/24/05, Nathan Pinno <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi all,
> >
> > I need help with pi and the ma
ke a simple thing, but as I'm new to python, I don't know where
> to start.
>
> Thank you for any help you can give.
>
>
> Jerl
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listi
rs" before they give you a key for
the real world.
Its a bit of a pain, so i just hacked turbo-ebay a while back and made
do. Worked quite well really.
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
T
en_local_file
>stats = os.stat(localfile)
> OSError: [Errno 2] No such file or directory:
> '\\C:\\Python24\\FRE_word_list.htm
> Any idea how to solve it ? The file is on my PC.
>
> I am using Python 2.4 on Win XP.
>
> Thanks in advance.
>
> David
>
>
>
> ___
> How much free photo storage do you get? Store your holiday
> snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ks in advance for your help.
> --
> Regards,
> Hameed U. Khan
> Registered Linux User #: 354374
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Bri
AIL PROTECTED]> wrote:
> On 10/5/05, paul brian <[EMAIL PROTECTED]> wrote:
> > This is a pretty big question, and it would be easier to answer if you
> > can give us more details about what you want to do.
> >
> > It seems you want to inspect outgoing mails (possibly r
7;d check.
>
> Matt
>
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
cs.python.org/lib/boolean.html
>
> Thanks
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
in advance,
> negroup
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
My apologies - I keep failing to reply-all.
-- Forwarded message --
From: paul brian <[EMAIL PROTECTED]>
Date: Oct 14, 2005 10:04 AM
Subject: Re: [Tutor] if-else statements
To: Andre Engels <[EMAIL PROTECTED]>
I would also suggest you look at either datetime m
____
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
ld you possibly advise me smth useful?
> --
> Best regards,
>
> Olexiy Kharchyshyn
>
> [EMAIL PROTECTED]
> ___
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
this? If so, try reinstalling and just leave
> > the installation path at the defaults (Python should install under
> > "C:\PYTHON24", I think.)
> >
> > IDLE has unfortunately been a bit problematic in the Python 2.4 release,
> > so if you continue to run int
__
> Tutor maillist - Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>
--
--
Paul Brian
m. 07875 074 534
t. 0208 352 1741
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
out', '.bash_profile', '.bashrc', '.emacs', 'dir1', 'dir2']
the problem is I can't get the script to detect that .bash_profile
and .emacs aren't directories, it always comes back in my list of
directories.
I'll include my
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 th
imple open file using this:
> f = open(r'C:\Test.txt', 'r')Newbie here but shouldn't it be.
Newbie Here
f = open( r'C:\\Test.txt','r')
I think you are escaping the T with \T.
Paul
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
What book are you working through? That is a pretty interesting exercise.
Paul
On Thursday 26 January 2006 12:52 pm, Bob Gailer wrote:
> At 08:44 AM 1/25/2006, Jon Moore wrote:
>
> Hi,
>
> I have written the program below as an exercise from a book I am working my
> way thro
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
=-=-=-=-=-=-=-=-=-=-=
1 - 100 of 201 matches
Mail list logo