[Tutor] Moving my C++ code to Python?

2010-10-15 Thread Paul
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

Re: [Tutor] Moving my C++ code to Python?

2010-10-15 Thread Paul
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

Re: [Tutor] Moving my C++ code to Python?

2010-10-17 Thread Paul
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

Re: [Tutor] From Newbie

2008-06-22 Thread paul
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

[Tutor] Classes

2008-07-11 Thread paul
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,

[Tutor] about real-time audio synthesis and algorithmic composition

2015-07-04 Thread Paul
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 ___

[Tutor] Searching in a file

2010-01-13 Thread Paul Melvin
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

[Tutor] Searching in a file

2010-01-15 Thread Paul Melvin
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

[Tutor] Still searching in html files

2010-01-21 Thread Paul Melvin
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

[Tutor] Python 3.0

2010-02-20 Thread Paul Whittaker
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 _

[Tutor] Having a return when subprocess.Popen finishes

2010-07-08 Thread Paul VanGundy
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

Re: [Tutor] Picking up citations

2009-02-10 Thread Paul McGuire
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. --

Re: [Tutor] extracting phrases and their memberships from syntax

2009-02-13 Thread Paul McGuire
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

Re: [Tutor] extracting phrases and their memberships from syntax

2009-02-14 Thread Paul McGuire
-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

Re: [Tutor] Looking for ConfigObj Documentation

2009-02-20 Thread Paul McGuire
Has anyone already mentioned the article in Python Magazine, May, 2008? -- Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] regex help

2009-02-23 Thread Paul McGuire
") + 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',

Re: [Tutor] Extract strings from a text file

2009-02-27 Thread Paul McGuire
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

Re: [Tutor] modular program

2009-03-01 Thread Paul McGuire
osted within UtilityMill, the source code is publicly viewable.) -- Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] combining Python 2.x and Python 3

2009-03-18 Thread Paul McGuire
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

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Paul McGuire
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

Re: [Tutor] Here's something to talk about

2009-04-15 Thread Paul McGuire
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

Re: [Tutor] Looping

2009-04-20 Thread Paul McGuire
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

Re: [Tutor] Tokenizing Help

2009-04-23 Thread Paul McGuire
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

Re: [Tutor] Iterating over a long list with regular expressions and changing each item?

2009-05-04 Thread Paul McGuire
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(&#x

Re: [Tutor] Generating deck combinations

2009-06-20 Thread Paul McGuire
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

Re: [Tutor] thesaurus - translation, actually

2009-07-10 Thread Paul McGuire
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

Re: [Tutor] find and replace relative to an nearby search string

2009-07-13 Thread Paul McGuire
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

Re: [Tutor] pyparsing complex search

2009-07-16 Thread Paul McGuire
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

Re: [Tutor] pyparsing complex search

2009-07-16 Thread Paul McGuire
> 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

Re: [Tutor] how to get blank value

2009-07-28 Thread Paul McGuire
#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

Re: [Tutor] how to get blank value

2009-07-28 Thread Paul McGuire
> -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

[Tutor] need to hide process

2005-01-10 Thread Paul Tremblay
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

Re: [Tutor] Time script help sought!

2005-01-11 Thread Paul Tremblay
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

[Tutor] style question: when to "hide" variable, modules

2005-01-14 Thread Paul Tremblay
_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

Re: [Tutor] style question: when to "hide" variable, modules

2005-01-18 Thread Paul Tremblay
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

[Tutor] Presentation

2005-01-31 Thread Paul Hartley
.   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

Re: [Tutor] Presentation

2005-02-01 Thread Paul Hartley
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

[Tutor] getting a webpage via python

2005-03-08 Thread Paul Tremblay
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

Re: [Tutor] getting a webpage via python

2005-03-08 Thread Paul Tremblay
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

Re: [Tutor] getting a webpage via python

2005-03-08 Thread Paul Tremblay
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 >

Re: [Tutor] getting a webpage via python

2005-03-09 Thread Paul Tremblay
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 > >> > &

Re: [Tutor] and once i have learned how to program ?

2005-03-11 Thread Paul Tremblay
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 --

Re: [Tutor] CGI authentication

2005-03-14 Thread Paul Tremblay
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 --

[Tutor] distutils problem

2005-04-16 Thread Paul Tremblay
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

Re: [Tutor] distutils problem

2005-04-16 Thread Paul Tremblay
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

[Tutor] Python and Web Pages?

2005-04-23 Thread Paul Tader
es/deletions. Basic stuff. Thanks, Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Parsing problem

2005-07-21 Thread Paul McGuire
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,

Re: [Tutor] Parsing problem

2005-07-23 Thread Paul McGuire
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

Re: [Tutor] Parsing problem

2005-07-25 Thread Paul McGuire
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

Re: [Tutor] Parsing problem

2005-07-25 Thread Paul McGuire
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

Re: [Tutor] Parsing problem

2005-07-25 Thread Paul McGuire
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

Re: [Tutor] Parsing problem

2005-07-25 Thread Paul McGuire
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

Re: [Tutor] Parsing problem

2005-07-25 Thread Paul McGuire
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', &#

Re: [Tutor] Parsing problem

2005-07-25 Thread Paul McGuire
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

Re: [Tutor] Parsing problem

2005-07-26 Thread Paul McGuire
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

[Tutor] More class questions

2007-09-08 Thread Paul McGuire
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

[Tutor] How do I add uvs to each vert line if a texture/bump map is used?

2007-09-14 Thread Paul Coones
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

[Tutor] writing the correct map names

2007-09-14 Thread Paul Coones
# Test for maps #if faceUV = 0: texture_map = "NULL.TIF"

Re: [Tutor] Beat me over the head with it

2007-12-11 Thread Paul Schewietzek
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

[Tutor] Handling MySQLdb exceptions

2007-12-19 Thread Paul Schewietzek
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

Re: [Tutor] Handling MySQLdb exceptions

2007-12-20 Thread Paul Schewietzek
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

Re: [Tutor] Handling MySQLdb exceptions

2007-12-20 Thread Paul Schewietzek
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

Re: [Tutor] Careful Dictionary Building

2007-12-29 Thread Paul McGuire
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

Re: [Tutor] parsing html.

2008-01-16 Thread Paul McGuire
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

Re: [Tutor] Saving Objects

2008-01-17 Thread Paul McGuire
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,

[Tutor] web gallery

2005-08-15 Thread paul . hendrick
m after advice on indexes. thanks for reading, Paul ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using superclass __init__ method

2005-09-22 Thread paul brian
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? ---

Re: [Tutor] time challange

2005-09-22 Thread paul brian
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.

Re: [Tutor] Python DB

2005-09-22 Thread paul brian
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

Re: [Tutor] simplifying with string-formatting operator

2005-09-23 Thread paul brian
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

Re: [Tutor] Help with pi and the math module.

2005-09-26 Thread paul brian
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

Re: [Tutor] HTTP GET Request

2005-09-27 Thread paul brian
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

Re: [Tutor] find data in html file

2005-09-30 Thread paul brian
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

Re: [Tutor] Beautiful soup

2005-10-04 Thread paul brian
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

Re: [Tutor] need help to understand terms for desinging a program

2005-10-05 Thread paul brian
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

Re: [Tutor] need help to understand terms for desinging a program

2005-10-05 Thread paul brian
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

Re: [Tutor] Accessing Variables

2005-10-05 Thread paul brian
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

Re: [Tutor] and-or precedence

2005-10-10 Thread paul brian
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

Re: [Tutor] Walk a dictionary recursively

2005-10-11 Thread paul brian
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

[Tutor] Fwd: if-else statements

2005-10-14 Thread paul brian
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

Re: [Tutor] passing variable to python script

2005-10-14 Thread paul brian
____ > 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

Re: [Tutor] how to create GUI for Python progs

2005-10-14 Thread paul brian
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 > --

Re: [Tutor] IDLE will not appear under Win95 (Python 2.4.2) (fwd)

2005-10-17 Thread paul brian
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

Re: [Tutor] setting

2005-10-19 Thread paul brian
__ > 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

[Tutor] problem detecting files

2005-12-01 Thread Paul Hendrick
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

[Tutor] Multi-Dimensional Dictionary that contains a 12 element list.

2005-12-28 Thread Paul Kraus
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 =-=-=-=-=-=-=-=-=

Re: [Tutor] Multi-Dimensional Dictionary that contains a 12 element list.

2005-12-28 Thread 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

[Tutor] Multiple Assignment from list.

2005-12-28 Thread Paul Kraus
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

Re: [Tutor] Multiple Assignment from list.

2005-12-28 Thread Paul Kraus
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

Re: [Tutor] Multi-Dimensional Dictionary that contains a 12 element list.

2005-12-29 Thread Paul Kraus
[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

Re: [Tutor] Multi-Dimensional Dictionary that contains a 12 element list.

2005-12-30 Thread Paul Kraus
> 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

Re: [Tutor] Open file error

2006-01-17 Thread Paul Kraus
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

Re: [Tutor] Controling my loops and redundant code?!?

2006-01-26 Thread Paul Kraus
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

[Tutor] Documentation

2006-02-05 Thread Paul Kraus
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* --

Re: [Tutor] Documentation

2006-02-05 Thread Paul Kraus
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

[Tutor] GUI Development - Which toolkit

2006-02-06 Thread Paul Kraus
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

[Tutor] IDE - Editors - Python

2006-02-06 Thread Paul Kraus
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

[Tutor] First Gui App - Please scrutinize

2006-02-06 Thread Paul Kraus
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.__

[Tutor] Python - Embedded mysql server

2006-02-07 Thread Paul Kraus
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

[Tutor] Build Python 2.4 SCO OpenServer 5

2006-02-14 Thread Paul Kraus
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   2   3   >