Re: [Tutor] affecting all classes if one class is affected by an event - pygame

2007-11-16 Thread Marc Tompkins
Thus spake ted b: I am trying to figure out how to make a class instance respond the same way > as another class instance if the other is affected by some event. I have > been playing around with inheritance, and have tried other stuff, but i am > somewhat of a newbie and I have been having diffic

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
Alan Gauld wrote: "Marc Tompkins" <[EMAIL PROTECTED]> wrote > realized I can implement this myself, using 'read(bigsize)' - > currently I'm using 'read(recordsize)'; I just need to add an extra > loop around my record reads. Please disregard...

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
On Nov 17, 2007 8:14 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Marc Tompkins wrote: > > My question is this: does anybody know of an equivalent to > > "readlines(sizehint)" for non-delimited, binary files? I've Googled > > and Googled until I'

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
bled) > I think my head's going to explode - my negative capacity is overloaded! On Nov 17, 2007 9:03 PM, Marc Tompkins <[EMAIL PROTECTED]> wrote: > On Nov 17, 2007 8:14 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > > > Marc Tompkins wrote: > > >

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-17 Thread Marc Tompkins
c. I'm trying to enhance performance, not kill it. Thanks in advance for your insight - Marc -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Read-ahead for large fixed-width binary files?

2007-11-18 Thread Marc Tompkins
On Nov 18, 2007 5:15 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > Marc Tompkins wrote: > > On Nov 17, 2007 8:20 PM, Kent Johnson <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > use plain slicing to return the individual records instea

[Tutor] Questions about wxEvents

2007-12-06 Thread Marc Tompkins
I have a specific question - how can I generalize a FileBrowseButtonWithHistory - and I realized, as I was trying to word my question, that my real question is a bit more generic. First, the specific question: The FileBrowseButtonWithHistory requires a callback override and some custom code to st

Re: [Tutor] Questions about wxEvents

2007-12-06 Thread Marc Tompkins
allback('fp2', x) > ) > [snip] > def fpCallback(self, controlID, evt): > print evt.__dict__ > print help(evt) > value = evt.GetString() > [snip] > > > > - Jeff Younker - [EMAIL PROTECTED] - > > > On

Re: [Tutor] Dynamically named objects

2007-12-28 Thread Marc Tompkins
Sorry, meant to respond to the list, not just the OP... -- Forwarded message -- From: Marc Tompkins <[EMAIL PROTECTED]> Date: Dec 28, 2007 12:13 AM Subject: Re: [Tutor] Dynamically named objects To: Michael Bernhard Arp Sørensen <[EMAIL PROTECTED]> I don't think

Re: [Tutor] Dynamically named objects

2007-12-28 Thread Marc Tompkins
Here's the same thing with a list instead of a dictionary: #=== class thingy(): example = "Just testing - " def __init__(self, num): self.example = self.example + str(num) thang = [] for x in range(1,4): thang.append(thingy(x)) for item,

Re: [Tutor] python CLI parser

2007-12-28 Thread Marc Tompkins
On Dec 28, 2007 2:11 AM, Simone <[EMAIL PROTECTED]> wrote: > bob gailer ha scritto: > > >> could you have a short review of my CLI package. > > .bz2??? What does that extension mean? (For us Windows folk). Or could > > you attach a simple zip file? > > .bz2 is an archive compressed with the bzip2

Re: [Tutor] Choice of GUI builders

2008-01-03 Thread Marc Tompkins
I'm using wxPython, after very brief forays into Tk and Qt, and I like it a lot. wx generally wraps the native widgets of whatever OS/desktop it runs on, and its idiom felt more comfortable to me than the others. Also, unlike Qt, it's free... I hate to be a cheapskate, but I'm a very small busines

Re: [Tutor] Choice of GUI builders

2008-01-03 Thread Marc Tompkins
On Jan 3, 2008 4:06 AM, Tiago Saboga <[EMAIL PROTECTED]> wrote: > But since 2005, according to wikipedia, the Qt Windows is also > licensed under the GPL. Am I missing something? > >From the Trolltech website: > *Qt Open Source Edition* is provided under the GNU General Public License > version 2

Re: [Tutor] Tutor Digest, Vol 47, Issue 8

2008-01-03 Thread Marc Tompkins
On Jan 3, 2008 1:24 PM, Tony Cappellini <[EMAIL PROTECTED]> wrote: > The point I was trying to make that didn't come across is: > Until one has enough experience to hand code the GUIs, the designers are > helpful and a good place to begin. > > The problem with widgets not appearing where they shou

Re: [Tutor] Tutor Digest, Vol 47, Issue 8

2008-01-03 Thread Marc Tompkins
On Jan 3, 2008 10:31 AM, Tony Cappellini <[EMAIL PROTECTED]> wrote: > Putting widgets into sizers is easy with the designers. Not knowing how > to fix your code when the widgets don't appear as you want them is a > problem. I've never seen any docs written to help overcome this for any > framewor

Re: [Tutor] Tutor Digest, Vol 47, Issue 8

2008-01-03 Thread Marc Tompkins
Let me clarify this: > But if, to achieve the proper level of proficiency with the designer, I > have to invest many hours of study and practice... well, it's going to be a > hard sell. I'd rather be coding. > An hour spent learning something new in Python makes me a better programmer, and proba

Re: [Tutor] Scope and elegance

2008-01-07 Thread Marc Tompkins
On Jan 7, 2008 12:07 PM, James Newton <[EMAIL PROTECTED]> wrote: > Hi Python Practicioners! > ... > I am not so much concerned in getting this to work (I can already do > that); I am more concerned with understanding how to treat this in the > most Pythonesque way. > I'd like to get the party lin

Re: [Tutor] Saving Objects

2008-01-17 Thread Marc Tompkins
On Jan 17, 2008 6:15 AM, Andy Cheesman <[EMAIL PROTECTED]> wrote: > My only arising question is why should i > "derive from object, so that you get a new-style class." > This list discussed this topic a couple of weeks ago. Recklessly simplifying, it boils down to this: By using new-style classe

Re: [Tutor] Dos and os.walk with Python

2008-01-24 Thread Marc Tompkins
On Jan 24, 2008 5:28 PM, Timothy Sikes <[EMAIL PROTECTED]> wrote: > I'm getting the "Digest" version of the mailing list, if there's any > better way to respond to a specific message, I would like to know. thanks :> > I also originally signed up for the digest - it drove me up the wall, so I subs

Re: [Tutor] designing POOP

2008-02-05 Thread Marc Tompkins
On Feb 5, 2008 5:46 AM, bhaaluu <[EMAIL PROTECTED]> wrote: > What I'm interested in is the thought processes and/or > guidelines that Tutors employ when they sit down to design a POOP. Whenever I have a few free minutes and a desire to contemplate the infinite (Hah!), I surf over to the C2 wiki.

Re: [Tutor] designing POOP

2008-02-07 Thread Marc Tompkins
> Sorry, my bad - this was my me, but I forgot to hit "Reply All". My me? I think I meant to type "my message". -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Fwd: designing POOP

2008-02-07 Thread Marc Tompkins
Sorry, my bad - this was my me, but I forgot to hit "Reply All". Here's a situation I often encounter, and I was wondering what the "best practice" is. I've generally initialized my classes' attributes this same way: > class TestClass1(object): > """ please give me a better name""" > def

[Tutor] Fwd: Noob requesting help...

2008-02-16 Thread Marc Tompkins
Sorry, I ALWAYS forget to hit 'Reply All'... On Feb 16, 2008 3:18 PM, John Luke <[EMAIL PROTECTED]> wrote: > I understand *what's* going on, but I don't understand *why* it's > happening. To be more specific, I don't understand why the actual password, > "unicorn", is what it is, even though I se

Re: [Tutor] Noob requesting help...

2008-02-16 Thread Marc Tompkins
John, Luke, Marc... can we get a Matthew to join this thread? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Suggestions to improve this first effort?

2008-02-17 Thread Marc Tompkins
> > The indentation came through fine for me. The Basic code is indented > with spaces, the Python code with tabs. Perhaps your mail reader doesn't > correctly interpret the tabs. > This presents a perfect opportunity to remind our new Pythonistas that tabs can be evil (for precisely this reason),

Re: [Tutor] Noob requesting help...

2008-02-18 Thread Marc Tompkins
Mother Mary comes to me Speaking words of wisdom: Let it be, let it be... On Feb 18, 2008 6:30 AM, Reed O'Brien <[EMAIL PROTECTED]> wrote: > On Feb 16, 2008, at 9:58 PM, bob gailer wrote: > > > Marc Tompkins wrote: > >> John, Luke, Marc... can we get a Matt

Re: [Tutor] web.py vs webwareforpython

2008-02-21 Thread Marc Tompkins
Sorry to jump in the middle here, but I have a somewhat related question... I have a few websites set up for my clients, mostly using Mambo/Joomla (PHP-based). My clients tend to be small brick-and-mortar businesses (doctors, lawyers, etc.) who merely wish to use their website as an extension of

[Tutor] how to extract number of files from directory

2005-10-12 Thread Marc Buehler
hi. i'm new to Python ... i would like to extract the number of JPG files from the current directory and use that number as a parameter in my python script. i tried: a = os.system('ls *JPG | wc -l') when i do: print a i get '0'.

[Tutor] how to alter list content

2005-10-13 Thread Marc Buehler
7;, 'DSC2', 'DSC3'] i.e. the names w/o the file extension. what's the easiest way of doing this? marc --

[Tutor] passing variable to python script

2005-10-13 Thread Marc Buehler
hi. i want to pass an argument (a number) to a python script when running it: > python script.py i want to be able to use within script.py as a parameter. how do i set this up? marc --- The apocalyp

[Tutor] extract plain english words from html

2005-10-14 Thread Marc Buehler
text file. note that all of the html files have the same format, i.e. the text is always surrounded by the same html tags. also, i am sorting through thousands of html files, so whatever i do needs to be fast.

Re: [Tutor] counting number of inputs (EARLIER VERSION SENT ACCIDENTLY)

2006-05-03 Thread Marc Poulin
Michelle: Are you familiar with writing functions? Here I've created a function named getInputs. I've also created a few test cases to verify that (a) my understanding of the problem is correct, and (b) my solution is correct. It's important to think about how your program is supposed to behave

Re: [Tutor] Logical Sorting

2006-07-07 Thread Marc Poulin
I did a Google search for "python numeric sort" and found http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/135435 It seems to do what you want. Marc --- Evan Klitzke <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to sort a list of directories that > co

Re: [Tutor] no loops

2006-07-11 Thread Marc Poulin
--- John Fouhy <[EMAIL PROTECTED]> wrote: > On 12/07/06, Christopher Spears > <[EMAIL PROTECTED]> wrote: > > Now the exercise is: > > As an exercise, rewrite this function so that it > > doesn't contain any loops. > > > > I have been staring at this function and drawing a > > blank. Something te

Re: [Tutor] Need Help

2006-07-11 Thread Marc Poulin
--- Terry Carroll <[EMAIL PROTECTED]> wrote: > On Tue, 11 Jul 2006, Michael P. Reilly wrote: > > > Another aspect of your assignment will be to be > able to use this > > functionality from the "command-line". This > means: without asking questions > > from the user, but input is being passed

Re: [Tutor] When am I ever going to use this?

2006-08-01 Thread Marc Poulin
ges you've visited, all linked together, so you can move backwards and forwards through the list. Here is a great resource for learning about different kinds of data structures: http://www.nist.gov/dads Regards, Marc __ Do You Yahoo!? Tired of

Re: [Tutor] about assert

2006-09-13 Thread Marc Poulin
--- "linda.s" <[EMAIL PROTECTED]> wrote: > Python manual has a very brief introduction of > "assert" statements. It > is very difficult for me to understand it. Every program has some fundamental assumptions that must remain true in order for the program to continue giving correct results. The

Re: [Tutor] about assert

2006-09-13 Thread Marc Poulin
--- [EMAIL PROTECTED] wrote: > >>Python manual has a very brief introduction > >>of "assert" statements. It is very difficult > > First you probably don't need to use asserts > very often, they are useful if you are building > production strength code but for most users > of Python the exce

Re: [Tutor] Looking for an edutainment-type introduction to programming book

2006-09-29 Thread Marc Poulin
Look here: www.ceebot.com Not a book, but it might be what you are looking for. --- Abel Daniel <[EMAIL PROTECTED]> wrote: > > Hi! > > I'm looking for a book to give to my younger brother > as a birthday > present. He is 13 years old, had some experience > with logo (but not > much, so he kno

Re: [Tutor] Help

2006-10-01 Thread Marc Poulin
--- Kefka Palazzo <[EMAIL PROTECTED]> wrote: > I am trying to learn a programming language good for > programming entire > games (core functions too) similar to both the Final > Fantasy and Metroid > series. From the book I'm learning from (Python > Programming for the Absolute > Beginner, by Mich

Re: [Tutor] Workaround for limitation in xrange()?

2006-10-10 Thread Marc Poulin
--- Dick Moores <[EMAIL PROTECTED]> wrote: > > Andrei's > Write your own iterator: > >>> def hugerange(minval, maxval): > ... val = minval > ... while val < maxval: > ... yield val > ... val += 1 > > All 3 are essentially the same, aren't they. Which > makes me feel even

Re: [Tutor] identifying and parsing string in text file

2008-03-08 Thread Marc Tompkins
Sure sounds like XML to me... I'm just snatching a moment from Saturday chores to type this, but there are a bunch of modules available for XML manipulation - elementtree is built-in; I personally prefer Amara - and I'll bet that a few minutes spent with the docs for either module will tell you wh

Re: [Tutor] Word List

2008-03-09 Thread Marc Tompkins
2008/3/9 Emad Nawfal <[EMAIL PROTECTED]>: > Thank you so much Kent. It works. I have now realized the bad things about > self-learning. > There are bad things? Nobody told me... -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org http:

Re: [Tutor] Word List

2008-03-09 Thread Marc Tompkins
On Sun, Mar 9, 2008 at 4:02 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "Marc Tompkins" <[EMAIL PROTECTED]> wrote > >... I have now realized the bad things about > >> self-learning. > > > > There are bad things? Nobody told me... >

[Tutor] Fwd: my first project: a multiplication trainer

2008-03-15 Thread Marc Tompkins
Forgot to Reply All... -- Forwarded message -- From: Marc Tompkins <[EMAIL PROTECTED]> Date: Sat, Mar 15, 2008 at 2:13 AM Subject: Re: [Tutor] my first project: a multiplication trainer To: Guba <[EMAIL PROTECTED]> On Fri, Mar 14, 2008 at 9:43 PM, Guba <[EMAIL PR

Re: [Tutor] newbie needs help with rpg code in python

2008-03-16 Thread Marc Tompkins
On Sun, Mar 16, 2008 at 10:59 AM, jake cooper <[EMAIL PROTECTED]> wrote: > print 'You inflicted', damage_to_enemy, "points of damage to your > enemy" #shows damage dealt > temp_e_hp - damage_to_enemy #!!!attempts to deduct damage_to_enemy > from temp_e_hp!!! > print temp_e_hp** > *

Re: [Tutor] reading parts of a input string into different variables based on units.

2008-03-19 Thread Marc Tompkins
On Wed, Mar 19, 2008 at 3:56 PM, Tim Michelsen <[EMAIL PROTECTED]> wrote: > m = 0 > cm = 0 > mm = 0 > ## first list item > if first.endswith("m",-1): > m = first.strip("m") > elif first.endswith("cm",-2): > cm = first.strip("cm") > elif first.endswith("mm",-2): > mm = first.strip("mm")

Re: [Tutor] CSV file processing...

2008-03-21 Thread Marc Tompkins
On Fri, Mar 21, 2008 at 12:42 PM, Spencer Parker <[EMAIL PROTECTED]> wrote: > This is all that I get when I run it... > > Traceback (most recent call last): > File "./loadcsv.py", line 23, in ? > co.execute(""" > File "/usr/lib64/python2.4/site-packages/MySQLdb/cursors.py", line 148, > in

Re: [Tutor] CSV file processing...

2008-03-21 Thread Marc Tompkins
Sorry... no, it still shouldn't work... maybe like so: co.execute('''INSERT INTO stats VALUES("%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s" % row''') > You have triple quotes around your SQL. That means that "implied" line > breaks become real. It won't look as ni

Re: [Tutor] I am reading the tutorial alright?

2008-03-23 Thread Marc Tompkins
On Sun, Mar 23, 2008 at 4:16 PM, elis aeris <[EMAIL PROTECTED]> wrote: > in c++ i use array[n][n] to store things. > > how do i create an array like that? > Python doesn't have "arrays". It has tuples, lists, and dictionaries. A quick Google will tell you the distinctions between them. It look

Re: [Tutor] I am reading the tutorial alright?

2008-03-23 Thread Marc Tompkins
On Sun, Mar 23, 2008 at 4:24 PM, elis aeris <[EMAIL PROTECTED]> wrote: > Now I want to talk about this: how should I have asked my Q to let > everyone know what I was looking for? > > looking back to my first post, it seems to be a little weak. Can you > suggest something that I could have said? >

Re: [Tutor] returning two values continued

2008-03-23 Thread Marc Tompkins
On Sun, Mar 23, 2008 at 4:41 PM, elis aeris <[EMAIL PROTECTED]> wrote: > def returning (): > a = 1 > b = 2 > return a, b > > > ab = returning() > > > does this work? > I cut and pasted into an interactive Python session: >>> def returning (): ... a = 1 ... b = 2 ... retur

Re: [Tutor] how to write a function

2008-03-24 Thread Marc Tompkins
On Mon, Mar 24, 2008 at 6:28 AM, Bartruff, Pamela J. < [EMAIL PROTECTED]> wrote: > Def convert_time(time): > """split hours from minutes" > Time = raw_input("enter a time, in military: ") > At this point, Time is a string, not a number. (At this point, we also have to _assume_ that the user ente

Re: [Tutor] Diff for Python

2008-04-05 Thread Marc Tompkins
Sorry - forgot to reply to the list the first time... On Sat, Apr 5, 2008 at 3:04 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > On Windows you can use FC - File Compare. > Its not as powerful as diff but it will highlight differences. > On Windows, I've tried a bunch of diff tools - it's probably t

Re: [Tutor] PyMOTW: difflib

2008-04-07 Thread Marc Tompkins
On Mon, Apr 7, 2008 at 4:52 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > "Dick Moores" <[EMAIL PROTECTED]> wrote > > > Could you give a blow-by-blow on the dis.dis()? > > I'll have a go but I've never actually studied Python P-Code, > this is based on my 8080 and 68000 assembler experience! > ... >

Re: [Tutor] queries from the web & random number

2008-04-10 Thread Marc Tompkins
On Thu, Apr 10, 2008 at 9:14 AM, linuxian iandsd <[EMAIL PROTECTED]> wrote: > I have been used to making queries to websites automatically & analizing > the results. a few minutes ago ... i can no longer do that > now a website is protected by a ramdom number that i have to enter before > i can lo

[Tutor] Hoping to benefit from someone's experience...

2008-04-15 Thread Marc Tompkins
nly struck me that someone out there may have done this before. (And yes, I've definitely Googled, but my Google-fu may be weak today.) If anyone has insight into RTF Zen, or has some tips on batch macros in oO, I'd be obliged... Marc -- www.fsrtechnologies.com ___

Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-15 Thread Marc Tompkins
On Tue, Apr 15, 2008 at 7:18 PM, <[EMAIL PROTECTED]> wrote: > Recommendation: Find a very old version of Word (Word 95) to generate > your RTF 'templates'. The older versions of Word generate much simpler > RTF that is forward compatible. > Excellent advice! Unfortunately, my case is a bit diffe

Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-15 Thread Marc Tompkins
On Tue, Apr 15, 2008 at 7:10 PM, John Fouhy <[EMAIL PROTECTED]> wrote: > Is this any help to you: http://pyrtf.sourceforge.net/ > Not so much, because it only produces RTF - it doesn't help me pick apart the stuff I've already got. (It did cross my mind to try to create in pyRTF the same structur

Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-15 Thread Marc Tompkins
On Tue, Apr 15, 2008 at 8:50 PM, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > Sorry, forgot to cc the list. > Actually, you cc'd the list with my previous post instead of your response to it. Here's what you sent me: > I don't know if this is the best way, but given that other guy's > suggesti

Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-16 Thread Marc Tompkins
Again with the forgetting to cc the list... On Tue, Apr 15, 2008 at 11:33 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > Alternatively learn enough VBScript to do it all in Word itself That's exactly what I'm doing now. After mentioning in a previous email that formatting is important, I took

Re: [Tutor] Hoping to benefit from someone's experience...

2008-04-19 Thread Marc Tompkins
Just as a followup - I ended up using a Python script to recurse through the folders of files and, for each file found, extract the doctor/date/medical record number from the filename, then run a Word macro on the file to insert the header slug. If anyone ever needs to do something similar, or ju

[Tutor] Another mention on xkcd...

2008-04-23 Thread Marc Tompkins
I don't know whether there are any other xkcd fans here, but I am, and I was very happy to see Python mentioned again... http://xkcd.com/413/ Sometimes it really does seem that easy. -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org h

Re: [Tutor] Using Queue

2008-04-23 Thread Marc Tompkins
I for one would like to thank Bob for asking the question! So far I hadn't had the guts. -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Open Source Hero my @$$!

2008-04-23 Thread Marc Tompkins
Just thought I'd share something I found quite humorous... a while back, I heard about Microsoft's "Open Source Hero" program, and being a curious type I signed up. Hey, I love me some Open Source, and I wanna be a hero, right? My Hero Pack arrived a few days ago. It contains: a 90-day trial o

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Marc Tompkins
On Tue, Apr 29, 2008 at 9:22 AM, Scott SA <[EMAIL PROTECTED]> wrote: >- More than one space around an assignment (or other) operator to > align it with another. > When I first started in Python, I was lining up all of my variable assignments in blocks; I, too, find it more readable. But

Re: [Tutor] put?

2008-05-01 Thread Marc Tompkins
On Thu, May 1, 2008 at 12:51 AM, Ross Glover <[EMAIL PROTECTED]> wrote: > put, get=os.popen4("dict -d wn " + (word)) > > Something that can be a little confusing at first (and I haven't seen anybody mention it yet, so I thought I'd chime in) is that you can assign multiple variables at the same ti

Re: [Tutor] put?

2008-05-01 Thread Marc Tompkins
On Thu, May 1, 2008 at 4:02 PM, bob gailer <[EMAIL PROTECTED]> wrote: > Marc Tompkins wrote: > > > > In contrast, this line runs a command that returns two values > > > > No No. Python does not have "commands" and can't therefore "run"

Re: [Tutor] Looking for something similar to du...

2008-05-05 Thread Marc Tompkins
On Mon, May 5, 2008 at 5:21 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > Probably but I'm not totally clear what you are looking for. > Can you explain what you mean by the diffrence between the size > used versus the size of the image? Surely the size of the image > is the space it uses? Or are yo

Re: [Tutor] Looking for something similar to du...

2008-05-06 Thread Marc Tompkins
On Mon, May 5, 2008 at 11:55 PM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > As to finding disk usage on Windows I found this > snippet on an MSDN forum: > > -- > If you want the size of the file on disk when compressed or sparse > then you have to use Platform/Invoke to call GetComp

Re: [Tutor] put?

2008-05-06 Thread Marc Tompkins
On Tue, May 6, 2008 at 9:46 AM, Robert Kirkpatrick <[EMAIL PROTECTED]> wrote: > Hey Alan! Is there a dict program for the MacOS flavour of *nix? That's > a > slick little bit of code but it doesn't work on my Mac: > > robertk01$ dict > -bash: dict: command not found > > but it works fine when I

Re: [Tutor] do I need f.close()

2008-06-10 Thread Marc Tompkins
On Tue, Jun 10, 2008 at 10:07 AM, dave selby <[EMAIL PROTECTED]> wrote: > Hi All, > > Up to now I when I need to write some data to a file I have been > purposely using close() > > f = open(conf, 'w') > f.writelines(lines) > f.close() > > Is it as safe to use the following > > open(conf, 'w')

Re: [Tutor] fibonacci.py task ???

2008-06-24 Thread Marc Tompkins
On Tue, Jun 24, 2008 at 6:40 AM, John Patrick Gerdeman < [EMAIL PROTECTED]> wrote: > (You could potentially start the sequence anywhere, e.g at a=5 and b=7, or > over all prime numbers, it > would still be a Fibonacci sequence, though not the one commonly known) > Actually, a series that follows

Re: [Tutor] Removing files based upon time stamps

2008-06-25 Thread Marc Tompkins
On Wed, Jun 25, 2008 at 2:21 PM, chase pettet <[EMAIL PROTECTED]> wrote: > import os, time, sys > current = time.time() > os.chdir("c:\BACKUPS\DEV1") > > for f in os.listdir('.'): > modtime = os.path.getmtime('.') > if modtime < current - 30 * 86400: > os.remove(f) > I'm not in a place w

Re: [Tutor] New to pythong

2008-07-07 Thread Marc Tompkins
On Mon, Jul 7, 2008 at 9:40 AM, Jeremiah Stack <[EMAIL PROTECTED]> wrote: > > > Hello everybody: > > I am new to this mailing list, and it said that i could the simplest of > questions. So i was wondering if anyone could be so kind as to e-mail me a > project idea or something to go out an learn t

Re: [Tutor] New to python(g)=python" g=(embarrassing)

2008-07-07 Thread Marc Tompkins
I did wonder whether there was a joke there... is the Pythong the hot new trend in beachwear? On a creepier note, if you make the mistake of going to python dot com instead of dot org, a Pythong is the least of your worries... eeewww. -- www.fsrtechnologies.com _

Re: [Tutor] line class

2008-07-08 Thread Marc Tompkins
On Tue, Jul 8, 2008 at 3:29 PM, Christopher Spears <[EMAIL PROTECTED]> wrote: > I have been reading everyone's comments on my line class. I have decided > to implement some of the suggestions. Someone suggested that I create a > Point.__cmp__ method. Here is what I have so far: > > def __cmp__(

Re: [Tutor] Another assert() question

2008-07-12 Thread Marc Tompkins
On Sat, Jul 12, 2008 at 8:10 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > But why will a tuple with two elements will always evaluate to > True? > > In [2]: (3,5) == True > Out[2]: False > In [3]: ("qwerty", "asdfg") == True > Out[3]: False > In [4]: > > The value formally known as True is only on

Re: [Tutor] Another assert() question

2008-07-13 Thread Marc Tompkins
On Sun, Jul 13, 2008 at 1:06 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > In other words, "(3,2)" isn't exactly the same as "True" - but it doesn't > evaluate to False, either, so it's true. > > > So what does (3,2) evaluate to? Or is that a meaningless question? However > in the following exampl

[Tutor] Fwd: Another assert() question

2008-07-13 Thread Marc Tompkins
Forgot to send to the list... On Sun, Jul 13, 2008 at 1:06 PM, Dick Moores <[EMAIL PROTECTED]> wrote: > Or is there an ambiguity in "evaluate" in Python that is well-understood > and doesn't cause a problem? > I should simply have said: "evaluate" is not a word IN Python (although "eval()" is,

Re: [Tutor] getting error in uploading a file

2008-07-15 Thread Marc Tompkins
On Tue, Jul 15, 2008 at 11:41 AM, Mayank Agarwal <[EMAIL PROTECTED]> wrote: > Hi, > i have a look on error_log and the error is following: > [Tue Jul 15 21:17:03 2008] [error] [client 10.73.41.64] (8)Exec format > error: exec of '/etc/httpd/cgi-bin/final.php' failed > [Tue Jul 15 21:17:03 2008] [e

Re: [Tutor] Advice for my function, isPrime(n), please

2008-07-21 Thread Marc Tompkins
On Mon, Jul 21, 2008 at 10:29 AM, Marc Tompkins <[EMAIL PROTECTED]> wrote: > > How about > >> return (x!=0) >> > ? > > Short and cryptic! > Sorry - I had deleted all the old messages in the thread, and only responded to the latest. My bad - I see now t

Re: [Tutor] Advice for my function, isPrime(n), please

2008-07-21 Thread Marc Tompkins
On Mon, Jul 21, 2008 at 10:20 AM, Daniel Sarmiento <[EMAIL PROTECTED]> wrote: > What about the following function? > > if x == 0: >return False > return True > > > I am a beginner, but I think it is more clear (at least to me) what > the function does. And it is only one line longer than > > v

Re: [Tutor] how do I create a lists of values associated with a key?

2008-08-01 Thread Marc Tompkins
On Thu, Jul 31, 2008 at 8:16 PM, Angela Yang <[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of values for one key. How do I specify this data structure? > > First tried, > > collection = [] > collection['abby'].append('apprentice1') > collection['abby'].append('apprentice2') > > That did not

[Tutor] issue with the Backslash on IDLE 1.2.2

2008-08-08 Thread Marc Rambert
notice already these ? thanks for you feedback Marc ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-13 Thread Marc Tompkins
On Wed, Aug 13, 2008 at 1:10 AM, vishwajeet singh <[EMAIL PROTECTED]>wrote: > I use pydev eclipse plugin for python and it saves me alot time. > Packages and modules can be maintained pretty well and if error is in some > dependent file I dont have to go to that folder to open it eclipse does it >

Re: [Tutor] What has Editor X got that PyWin32 hasn't?

2008-08-13 Thread Marc Tompkins
On Wed, Aug 13, 2008 at 4:15 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I've marked your list with *** for yes; ### for no; ??? for not sure or not > sure what you mean. > At 03:06 AM 8/13/2008, Marc Tompkins wrote: > >- Todo list ??? But TODO's in code ar

Re: [Tutor] names and variables

2008-08-20 Thread Marc Tompkins
On Wed, Aug 20, 2008 at 2:30 AM, Jim Morcombe <[EMAIL PROTECTED]>wrote: > I have an object called "myObject" with an attribute called "colour". > > If I type: > print myObject.colour > then python prints: >red > > Now, I have a variable "myAttribute" and set its value to "colour" by > typin

Re: [Tutor] how do you make this a better code?

2008-09-04 Thread Marc Tompkins
On Thu, Sep 4, 2008 at 6:00 PM, Roy Khristopher Bayot <[EMAIL PROTECTED]>wrote: > Correct me if I am wrong but each "import os" statement only exists in each > method. Is there a way to only import the os module once and use it in each > method? > Move it to the top of the file, outside of the

Re: [Tutor] Looking at a String as a Struct?

2008-09-11 Thread Marc Tompkins
On Thu, Sep 11, 2008 at 3:58 AM, Wayne Watson <[EMAIL PROTECTED]>wrote: > Is it possible in Python to look at a string as a "struct". I don't think > a struct exists in python. Actually, is there something analogous to a > record. In the case of strings, suppose I have string that is composed of

Re: [Tutor] Doing this in reverse?

2008-09-14 Thread Marc Tompkins
On Sat, Sep 13, 2008 at 6:02 PM, Alan Gilfoy <[EMAIL PROTECTED]>wrote: > I found a script at http://code.activestate.com/recipes/65212/ that allows > you to convert base 10 numbers to another base. I would like to convert non-base10 numbers to base 10. I wonder if I can do > so by flipping the sc

Re: [Tutor] Doing this in reverse?

2008-09-14 Thread Marc Tompkins
On Sun, Sep 14, 2008 at 4:48 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > The docs say, "If radix is zero, the proper radix is guessed based on > the contents of string; the interpretation is the same as for integer > literals." > > 'guessed' is not really a very good choice of words; 'determined

Re: [Tutor] Doing this in reverse?

2008-09-14 Thread Marc Tompkins
On Sun, Sep 14, 2008 at 2:29 PM, Kent Johnson <[EMAIL PROTECTED]> wrote: > On Sun, Sep 14, 2008 at 3:34 PM, Marc Tompkins <[EMAIL PROTECTED]> > wrote: > > On Sun, Sep 14, 2008 at 4:48 AM, Kent Johnson <[EMAIL PROTECTED]> wrote: > >> 'guessed' is no

Re: [Tutor] Where Does the DOS Window Come From?

2008-09-24 Thread Marc Tompkins
> > I'm looking at a GUI application that I hope to modify in the next few >> weeks. When it's executed the expected GUI appears along with a DOS window. >> Occasionally, I think, I've seen something put in the DOS window. How do I >> stop it from appearing and how do I find why it's used? >> > > I

Re: [Tutor] mod_python, mod_wsgi, web.py, django! What to use?

2008-09-29 Thread Marc Tompkins
On Mon, Sep 29, 2008 at 2:55 AM, Alan Gauld <[EMAIL PROTECTED]>wrote: > The biggest limitation by far on Python web development is lack > of Python support on the web servers. You need to find a provider that > either gives you an account on a server with which you can install any > frameworks you

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread Marc Tompkins
On Tue, Oct 14, 2008 at 9:23 AM, URBAN LANDREMAN <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion. > > When I ran the slightly modified code: > import win32com.client > app = win32com.client.Dispatch('Word.Application') > docOrig = > app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchPr

Re: [Tutor] using lists as values for key in dictionary?

2008-10-15 Thread Marc Tompkins
On Tue, Oct 14, 2008 at 11:54 PM, Marc Tompkins <[EMAIL PROTECTED]>wrote: > so if you turn your list into a tuple (I can never remember, is that a cast > or a coercion?) > To answer my own question: neither, but it's closer (in spirit) to a cast. -- www

Re: [Tutor] using lists as values for key in dictionary?

2008-10-14 Thread Marc Tompkins
Dictionary keys must be immutable - in other words, they must be objects that aren't allowed to change. Lists can change, so the answer is no. However, tuples are immutable, so if you turn your list into a tuple (I can never remember, is that a cast or a coercion?), you can use it as a dictionary

Re: [Tutor] using lists as values for key in dictionary?

2008-10-15 Thread Marc Tompkins
On Wed, Oct 15, 2008 at 12:22 AM, wesley chun <[EMAIL PROTECTED]> wrote: > >> so if you turn your list into a tuple (I can never remember, is that a > >> cast or a coercion?) > > > >> lX = tuple(lX) > > > > To answer my own question: neither, but it's closer (in spirit) to a > cast. > > you're kee

Re: [Tutor] documentation tut.html Error 404

2008-10-17 Thread Marc Tompkins
> > ... >> http://www.python.org/doc/current/tut/tut.html >> > Reminds me of Christopher Robin helping Winnie-the-Pooh try to fool the bees: "Tut tut, looks like rain! Tut tut, looks like rain!" -- www.fsrtechnologies.com ___ Tutor maillist - Tutor@

<    1   2   3   4   5   >