Re: [Tutor] httpd in your laptop?!? serve web pages and wikis in your notebook?

2007-03-01 Thread Chris Hengge
I was using Abyss web server for a long time since it has multi-OS support and a friendly web based UI for administration. Seemed extremely light weight to me. On 2/27/07, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Kirk Bailey wrote: > ok, I realized SOME TIME BACK that to run MANY THINGS in

[Tutor] Trying to get a feel

2007-02-05 Thread Chris Hengge
I've asked this on the Turbogears list, but I thought I'd ask here since there is a larger active user base from what I can tell. Basically I'm trying to get an idea of how practical streaming data with something like turbogears would be for going from the client (web site user) to the server. I

Re: [Tutor] SPE - Stani's Python Editor ?

2007-01-03 Thread Chris Hengge
till a ton cheaper then Visual Studio or some of the other options out there. On 1/3/07, Mike Hansen <[EMAIL PROTECTED]> wrote: > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Chris Hengge > Sent: Tuesday, January 02, 2007 4:57 PM &g

Re: [Tutor] SPE - Stani's Python Editor ?

2007-01-02 Thread Chris Hengge
I've recently started playing with Eclipse and the two PyDev plugin's over the holidays. I'm seriously liking it... but my likes are more closely related to Visual Studio as an editor, so this is like the perfect environment for me.. http://www.showmedo.com/videos/series?name=PyDevEclipseList Th

Re: [Tutor] XML-RPC data transfers.

2007-01-01 Thread Chris Hengge
On 1/1/07, Tim Golden <[EMAIL PROTECTED]> wrote: Chris Hengge wrote: > Going off your thoughts that I'm asking to do something outside the > realm of the readers here, is there a better place to ask this kind of > oddball stuff? I've looked around and haven't been able

Re: [Tutor] XML-RPC data transfers.

2006-12-31 Thread Chris Hengge
sh things since I'm still trying to get a handle on this language... On 12/31/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Chris Hengge" <[EMAIL PROTECTED]> wrote > method is a good one. Much like your own answers to most of my > questions, > you state several wa

Re: [Tutor] XML-RPC data transfers.

2006-12-30 Thread Chris Hengge
tossed it out for critic review, but nobody said otherwise so I figured I was fine. (I started with sockets for simplicity, then XML-RPC is supposed to be next easiest with twisted being last for my needs, also the most overhead) Anyways, I'll give your suggestions a shot and see what I come up

Re: [Tutor] XML-RPC data transfers.

2006-12-30 Thread Chris Hengge
This works... d = xmlrpclib.Binary(open("C:\\somefile.exe", "rb").read()) What I need is more like screenShot = ImageGrab.Grab() d = xmlrpclib.Binary(screenShot) This doesn't work though. On 12/30/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:

Re: [Tutor] XML-RPC data transfers.

2006-12-30 Thread Chris Hengge
how-to" help... Just bits of information making it sound possible. Again, I dont want to "file transfer" anything, I want to send data that isn't in the default data-types for xml-rpc, which I've read can be done using binary mode transfers. On 12/30/06, Kent Johnson <

Re: [Tutor] XML-RPC data transfers.

2006-12-29 Thread Chris Hengge
I might have been unclear, or this tid-bit might have been lost in the thread... but I'm trying to send directly from ImageGrab.Grab(), without saving the data as a file. Thats where I'm getting hung... If it try to send an actual stored file, I have no problem. Is this maybe impossible? My though

Re: [Tutor] OT: Python 2.5 (Was Re: Length of longest item in a list, using a list comp)

2006-12-28 Thread Chris Hengge
I hope this is related enough for this thread, but I'm curious why people didn't seem to unanimously jump into 2.5 upon release. Python seems very good about holding its backward compatibility vs some other languages I've dealt with like C# that seems to require applications rewritten with every p

[Tutor] XML-RPC data transfers.

2006-12-28 Thread Chris Hengge
I'm trying to figure out how to send data using XML-RPC. Currently my target is to send a PIL imagegrab.grab() from one side of the connection to the other. I've got stuff like numbers and strings going back and forth, so I know my connection is working, but I'm not sure how to send the image. 'S

Re: [Tutor] Best method for filtering lists in lists...

2006-12-19 Thread Chris Hengge
If it adds to the fun, does it make a difference if I tell you that this will be looking through [0][0] - approx [0][6544] On 12/16/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Roel Schroeven" <[EMAIL PROTECTED]> wrote >> In that case put the inner lists in a Set. That will eliminate >> duplica

Re: [Tutor] Best method for filtering lists in lists...

2006-12-15 Thread Chris Hengge
Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote: > Yes, we went over that a bit ago, but I wasn't sure if there were any > different or more appropriate approaches to this when dealing with > multidimensional lists. > Well, it depends what you term a redundant list.

[Tutor] Best method for filtering lists in lists...

2006-12-15 Thread Chris Hengge
I've got a list of lists that looks like this [[1,2,3], [4,5,6],[1,2,3]] I'm looking for a good way to drop the redundant inner lists (thousands of inner lists) Someone either have a good way to tackle this? or willing to point me in the right direction? Thanks! ___

Re: [Tutor] Confusing Unicode Conversion Problem.

2006-12-13 Thread Chris Hengge
You fixed it! Kudos and a cookie! (Name Brand even!) Thanks a lot, seems to be moving along fine now.. :] On 12/13/06, Tim Golden <[EMAIL PROTECTED]> wrote: [Chris H] > The reason I an forcing each line to string and splitting it is because the > pure numeric values coming from the excel sheet

Re: [Tutor] Confusing Unicode Conversion Problem.

2006-12-13 Thread Chris Hengge
s :) thanks On 12/13/06, Tim Golden <[EMAIL PROTECTED]> wrote: [Chris Hengge] | 'ascii' codec can't encode character u'\xa0' in position 11: | ordinal not in range(128) | Error with: FRAMEMRISER of type: | Excel Row : 6355 OK. Let's get to the basics first:

[Tutor] Confusing Unicode Conversion Problem.

2006-12-12 Thread Chris Hengge
I've got a script that uses com to read columns from an excel workbook(very slow for 6500ish items :/ ) and I'm getting this error: 'ascii' codec can't encode character u'\xa0' in position 11: ordinal not in range(128) Error with: FRAMEMRISER of type: Excel Row : 6355 FRAMEMRISER is exactly ho

Re: [Tutor] Create a script to make bootable USB device.

2006-12-08 Thread Chris Hengge
Just curious as to why nobody has at least attempted an answer for this. Is what I'm asking simply unknown? Or it is impossible to do? No big deal either way... just curious because I'm seriously interested in this. Thanks. On 12/6/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I

[Tutor] Create a script to make bootable USB device.

2006-12-06 Thread Chris Hengge
Is this something I can do using just python and libraries? I know I could automate other utilities, but I'd like to write some kind of neat utility myself that I could play with for more experience. Goal: make USB drive bootable to a dos prompt (dont care what dos, assuming I need a bootable ima

Re: [Tutor] which file runs

2006-12-05 Thread Chris Hengge
Quick and dirty way to keep people from lookin at the code. On 12/5/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote: > I have a script that makes my python scripts into .pyc files and I can > run those without a .py in the directory or anywhere else on the >

Re: [Tutor] which file runs

2006-12-05 Thread Chris Hengge
I have a script that makes my python scripts into .pyc files and I can run those without a .py in the directory or anywhere else on the system for that matter. No clever tricks needed. On 12/1/06, Christopher Arndt <[EMAIL PROTECTED]> wrote: Addendum: these rules only apply to Python *modules*.

Re: [Tutor] which file runs

2006-12-01 Thread Chris Hengge
My understanding is that whenever you run a script that has a newer.py, the .py runs, otherwise it automagically will use the .pyc On 12/1/06, johnf <[EMAIL PROTECTED]> wrote: Hi, if there is a pyc and a py file within a module and the py file has a later date which file will python run? John

Re: [Tutor] How To structure a program for cmd line mode & gui mode

2006-12-01 Thread Chris Hengge
I'm wondering if this (snipped from another poster) 1. Look at module cmd in the Python standard library if you have not already. (see http://docs.python.org/lib/module-cmd.html) would be used for something like a built in console found in alot of games? On 12/1/06, Tony Cappellini <[EMAIL PR

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Chris Hengge
]> wrote: Chris Hengge wrote: > Anyone point me to something more efficient then > > for item in list1: > if item not in list2: > list2.append() > > This just seems to take a bit a time when there are thousands or dozens of > thousands of records just t

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-12-01 Thread Chris Hengge
Ok, well... I think people lost the scope of my question.. I'm happy using the first method that was given to my post, I have stated in two emails that the order doesn't matter.. What I asked was why the order was changed, or more directly, what is the command actually doing to my data? I'm sure

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-11-30 Thread Chris Hengge
not preserve the order. If you care about the order of elements in list1, my suggestion will not work. On Thu, 2006-11-30 at 16:01 -0500, Python wrote: > On Thu, 2006-11-30 at 12:51 -0800, Chris Hengge wrote: > > Anyone point me to something more efficient then > > > list2 =

Re: [Tutor] Best Known Method for Filtering redundant list items.

2006-11-30 Thread Chris Hengge
for my program, its just for a script that takes excel columns and posts them into a given SQL db column... On 11/30/06, Python <[EMAIL PROTECTED]> wrote: On Thu, 2006-11-30 at 12:51 -0800, Chris Hengge wrote: > Anyone point me to something more efficient then > list2 = list(set(lis

[Tutor] Best Known Method for Filtering redundant list items.

2006-11-30 Thread Chris Hengge
Anyone point me to something more efficient then for item in list1: if item not in list2: list2.append() This just seems to take a bit a time when there are thousands or dozens of thousands of records just to filter out the dozen or so copies.. Thanks.

Re: [Tutor] A Million Sevens

2006-11-18 Thread Chris Hengge
That must be part of Pythons shiny ability of dynamic data types? Must be a messy operation to change data-types like that.. I think I'll just do my best to work with the right data-types the whole time ;D On 11/18/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Chris Hengge&qu

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
rollercoaster that this calculation would require.. Anyways.. back to the poster... Perhaps you wanted an error like this? print '=' * 10 Traceback (most recent call last): File "", line 1, in ? MemoryError On 11/17/06, Luke Paireepinart <[EMAIL PROTECTED]> wro

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
I'm thinking you either have a problem with a memory leak (my memory isn't changing, just at 100% CPU), or your CPU overheated from poor cooling since it is at 100% utilization. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Well, I dont get the point.. its not locking

Re: [Tutor] A Million Sevens

2006-11-17 Thread Chris Hengge
Well, I dont get the point.. its not locking up my system or anything.. its just crunching away... even while I type this... I guess your point is that it should stop since a 32 bit O/S can only count to: 4,294,967,296 On 11/17/06, Thomas <[EMAIL PROTECTED]> wrote: Earlier today I typed the fol

Re: [Tutor] Problem making '.exe' from python.

2006-11-17 Thread Chris Hengge
Just wanted to wrap that up so nobody wastes time replying. I've fixed my Inno scripts and all my packages work now, case closed! Thanks again Jason. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Awesome! Thank you! This has been driving me crazy for weeks. Now to figure

Re: [Tutor] Problem making '.exe' from python.

2006-11-17 Thread Chris Hengge
uot; field filled out with the directory the script is located. On 11/17/06, Chris Hengge <[EMAIL PROTECTED]> wrote: > Whether using py2exe or pyInstaller I've noticed a problem and I'm not > sure how to fix it... > > When I create a .exe and then make a shortcut to the f

[Tutor] Problem making '.exe' from python.

2006-11-17 Thread Chris Hengge
Whether using py2exe or pyInstaller I've noticed a problem and I'm not sure how to fix it... When I create a .exe and then make a shortcut to the file and run it.. the program will crash without warning. If I run the .exe directly it runs fine. My assumption of the problem: Since it is still bui

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
Just so you can compare... msg = MIMEText.MIMEText("How are you!?") email.Message.Message.get_content_type(msg) 'text/plain' On 11/16/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I would start by "forcing" 'text/plain'. If that doesn't wo

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
. On 11/16/06, shawn bright <[EMAIL PROTECTED]> wrote: use MIMEText(message, 'someTypeThatIsn'tPlain') ? but type/plain is what i am after. i am a bit confused here. It defaults to plain, but there is not anything in the message headers that say what type it is. Should i use MIM

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
I just re-read your email, and I dont think I answered it accurately since you apparently want plain... so maybe you can still use my example for "force" the type? On 11/16/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Not sure if I'm really helping, but I want to try

Re: [Tutor] email content-type: text/plain

2006-11-16 Thread Chris Hengge
Not sure if I'm really helping, but I want to try for all the help I've gotten... I took this from: http://docs.python.org/lib/module-email.message.html ## *class MIMEText*( _text[, _subtype[, _charset]]) Module: email.mim

Re: [Tutor] Alternatives to PY2EXE

2006-11-16 Thread Chris Hengge
o make using it stupidly easy. It really does boggle my mind how people can be so wierd when asked to run something that isn't a .exe... Guess its a side-effect of the windows generation. On 11/16/06, Tim Golden <[EMAIL PROTECTED]> wrote: [Chris Hengge] | Because alot of the users

Re: [Tutor] exception problems in socket programming

2006-11-15 Thread Chris Hengge
I ran this code based on yours: import socket, sys s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect(('something.com', 5000)) except socket.error, (value, message): if s: s.close() print "Could not open socket: " + message raw_input("\nPress any key") And I got

Re: [Tutor] Alternatives to PY2EXE

2006-11-15 Thread Chris Hengge
icon to my .exe also... but thats just being picky and lazy. On 11/15/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Because alot of the users here at Intel dont want to admit you can write usable programs in a "scripting" language.. so when they see a .exe they feel comfy... I'm

Re: [Tutor] free IDE for Python?

2006-11-15 Thread Chris Hengge
BTW... that also counts as my vouce for using SPE =D On 11/15/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I tried it back before I tried SPE. I remember it taking several hours and being very bloated. Have you watched the showmedo video? Thats what I used... http://showmedo.com/videos/

Re: [Tutor] free IDE for Python?

2006-11-15 Thread Chris Hengge
I tried it back before I tried SPE. I remember it taking several hours and being very bloated. Have you watched the showmedo video? Thats what I used... http://showmedo.com/videos/series?name=PyDevEclipseList If I personally "had" to use something that obnoxious I'd just reinstall ironpython and

Re: [Tutor] Alternatives to PY2EXE

2006-11-15 Thread Chris Hengge
Because alot of the users here at Intel dont want to admit you can write usable programs in a "scripting" language.. so when they see a .exe they feel comfy... I'm working on pushing "agile language"... I personally think its more appropriate then scripting =D On 11/15/06, Alan Gauld <[EMAIL PRO

Re: [Tutor] Syntax when using classes question.

2006-11-11 Thread Chris Hengge
Thanks for the great feedback! I was missing the whole "methods that share the same data" aspect of a class.. Thats makes them MUCH more clear to understand. Thanks for both of you having the patience to help me figure this out =D Time for me to ditch the classes from my pyForge.py!On 11/11/06, Al

Re: [Tutor] Syntax when using classes question.

2006-11-11 Thread Chris Hengge
I guess I'm just lost as to the point of classes... Outside of using them to abstract a collection of methods that have similair roles I dont see the point.. But when I group similar methods together (promptForge is a bad example, but I've got class fileForge which has a few file writing or reading

Re: [Tutor] Syntax when using classes question.

2006-11-11 Thread Chris Hengge
Oops... should have said this...    pyForge.promptForge.prompt()TypeError: unbound method prompt() must be called with promptForge instance as first argument (got nothing instead) ^ Thats why... I have to use :import pyForgepyForge.promptForge().prompt()On 11/11/06, Chris Hengge < [EMAIL PROTEC

Re: [Tutor] Syntax when using classes question.

2006-11-11 Thread Chris Hengge
hings that I've repeated... It was mainly an attempt at learning classes, and I wanted all my re-usable code to be centralized so I didn't keep opening scripts and cutting and pasting. On 11/10/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> As for sav

[Tutor] Syntax when using classes question.

2006-11-10 Thread Chris Hengge
is the following dummycode good practice? Or pythonic? or what? I'm just curious because there are several ways I've found to use libraries and classes...Method 1:from lib import classlib().class(param1, param2) Method 2: (C Style?)from lib import classmyClass = class()myLib.class(param1, param2)Th

Re: [Tutor] Looking for some constructive peer review.

2006-11-09 Thread Chris Hengge
d messages back, but I am not sure how I'd go about letting multiple users communicate to each other, or forward messages. Does this involve traversing threads? or sockets? or something else? Thanks. On 11/9/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> I writ

Re: [Tutor] Looking for some constructive peer review.

2006-11-09 Thread Chris Hengge
Oops... I started another sentence at the end, then ended up on the phone and forgot what I was doing and hit send Now I dont remember the other bug.. Oh well.. Thanks again.On 11/9/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I write this little IM style client the other night based o

[Tutor] Looking for some constructive peer review.

2006-11-09 Thread Chris Hengge
I write this little IM style client the other night based on some sample socket and threading examples I found plus a little of my own twist just to make it more interesting.. I'd like some constructive peer review just to help me make sure I'm doing this correctly / well. You can test it by connec

Re: [Tutor] Which is the latest version of Python for windows

2006-11-09 Thread Chris Hengge
I've been trying to look for a roadmap or something from them that would show estimated product release dates. Does this not exist?On 11/9/06, Terry Carroll <[EMAIL PROTECTED]> wrote:On Thu, 9 Nov 2006, Simon Brunning wrote: > On 11/9/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:> > I am so sorr

Re: [Tutor] Questions about PIL

2006-11-09 Thread Chris Hengge
ted in memory, never written to disk.. On 11/8/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> Thanks for the detailed examples again Luke. Sorry I wasn't more clear> with my implimentation. The loop I was refering to was the one in the> start of my post bu

Re: [Tutor] Questions about PIL

2006-11-09 Thread Chris Hengge
rjust(9)print "Calculated FPS   : %s" % str(calculatedFPS)[:4].rjust(9)print "Changes Registered   : %s" % str(count).rjust(9) raw_input("\nPress Any Key...")On 11/8/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> alist = differenc

Re: [Tutor] Questions about PIL

2006-11-08 Thread Chris Hengge
alist = difference(image1,image2)a = [b for b in alist.getdata() if b != (0,0,0)]if len(a) != 0:    print "Not the same"is much slower then (9x)if im1.tostring() != im2.tostring()   print "something changed!" This loop itself is fairly slow by itself though.. I'm going to try and see if there i

Re: [Tutor] Questions about PIL

2006-11-08 Thread Chris Hengge
e]     else :   # Dont really care because this [space] isn't important.   On 11/8/06, Danny Yoo < [EMAIL PROTECTED]> wrote:On Wed, 8 Nov 2006, Chris Hengge wrote: > I'm trying to figure out how to compare im1 to im2 and recognize the> difference. I dont care wh

Re: [Tutor] Questions about PIL

2006-11-08 Thread Chris Hengge
ing more of a way to create quadrants of the screenshot. (Or any number of area's) that I could independantly interact with. I know this isn't a CPU friendly task, but just humor me please =P On 11/8/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> I'm trying

[Tutor] Questions about PIL

2006-11-08 Thread Chris Hengge
I'm trying to figure out how to compare im1 to im2 and recognize the difference. I dont care what the difference is... something likeif im1 is not im2: print "Not same"I've tried im.tostring () but that doesn't ever enter the loop either.

Re: [Tutor] (OT) Flame wars

2006-11-06 Thread Chris Hengge
I may have just missed the point to your attempt to derail this conversation =PHowever.. Why do all that when you can just str = "Hello World"print str * 2(Maybe I missed some concept that this small example doesn't accuratly reflect) On 11/6/06, Danny Yoo <[EMAIL PROTECTED]> wrote: > Wow... I had

Re: [Tutor] (OT) Flame wars (was: Amazing power of Regular Expressions...)

2006-11-06 Thread Chris Hengge
Wow... I had to click this e-mail just because I saw the first posts on the mentioned thread and could see it turning for the worst.. > I'm serious, if you think ^[0-9A-Za-z_.-]*$ is unclear and complex, go> away > and relearn regales.>> Michael.If this is your method to helping people, you should

Re: [Tutor] Print Screen

2006-11-04 Thread Chris Hengge
Wow, that hasn't come up in my searching, thanks! Looks like you are right and the project is dead, but the author did toss there code up for viewing so I can stumble around a bit there. On 11/3/06, Jonathon Sisson <[EMAIL PROTECTED]> wrote: Chris,I don't know if this has been mentioned yet, but t

Re: [Tutor] GUI with Designer

2006-11-03 Thread Chris Hengge
age and get a nice copy of his user manual (pdf).If you want to know more about SPE, check out: http://www.serpia.org/speor video demonstations at:http://showmedo.com/videos/series?name=PythonDevelopmentWithSPE On 11/3/06, Dick Moores <[EMAIL PROTECTED]> wrote: At 02:10 PM 11/3/2006, Chr

Re: [Tutor] GUI with Designer

2006-11-03 Thread Chris Hengge
I vouch for the SPE with wxGlade and XRC! (packaged together with IDE)On 11/3/06, Carlos Daniel Ruvalcaba Valenzuela < [EMAIL PROTECTED]> wrote:wxPython is good for cross-platform stuff and has a few gui designers (Boa Constructor and others comes to mind), I don't know much aboutPyQT state in this

Re: [Tutor] Print Screen

2006-11-03 Thread Chris Hengge
of the process for this? I'm thinking I'll probably have to find something in another language and just try to duplicate it with python to get me started. On 11/3/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> Wow.. I have visions of writing a little wanna-b

Re: [Tutor] Print Screen

2006-11-03 Thread Chris Hengge
Wow.. I have visions of writing a little wanna-be VNC client/server now using the ImageGrab.grab() =DThis ImageGrab trick does exactly what I wanted. Thanks for the tip!Actually, I want to write a little package for the learning experience sometime over the holidays (plus I use VNC fairly often), b

Re: [Tutor] How to capture 'Ctrl+c' in Python

2006-11-02 Thread Chris Hengge
le True:   ky = msvcrt.getch()   length = len(ky)   if length != 0:   # send events to event handling functions  if ky == " ": # check for quit event doQuitEvent(ky)  else:      doKeyEvent(ky) On 11/2/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Chris Hengge" &

Re: [Tutor] How to capture 'Ctrl+c' in Python

2006-11-02 Thread Chris Hengge
h != 0:   # send events to event handling functions  if ky == " ": # check for quit event doQuitEvent(ky)  else: doKeyEvent(ky)On 11/2/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Chris Hengge" <[EMAIL PROTECTED]> wrote> Do you by chance know o

Re: [Tutor] How to capture 'Ctrl+c' in Python

2006-11-02 Thread Chris Hengge
h are more practical, but I'm still interested in this. On 11/2/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Chris Hengge" <[EMAIL PROTECTED]> wrote> Do you by chance know of a way to capture special keys like "Print> Screen"?Try the key capture code in my

Re: [Tutor] Print Screen

2006-11-02 Thread Chris Hengge
Because I dont know any other way to capture the screen? (In my mind using print screen would be universal) =POn 11/2/06, Luke Paireepinart < [EMAIL PROTECTED]> wrote:Chris Hengge wrote:> I posted this in a similar thread a few days ago, and no replies so I > think it needs its own listing.>> Anyon

[Tutor] Print Screen

2006-11-02 Thread Chris Hengge
I posted this in a similar thread a few days ago, and no replies so I think it needs its own listing. Anyone know of a way to capture special keys like "Print Screen"?I have a small script to grab all they keycodes, but it doesn't seem to catch several keys on the keyboard. I've got a utility that

[Tutor] str.strip() help

2006-11-01 Thread Chris Hengge
I can't figure out a way to .strip("string")Example might look like this:>>> myStr = "I want to strip my words.">>> print myStr.strip("my")>>> 'I want to strip words.' Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo

Re: [Tutor] How to capture 'Ctrl+c' in Python

2006-11-01 Thread Chris Hengge
Do you by chance know of a way to capture special keys like "Print Screen"?I have a small script to grab all they keycodes, but it doesn't seem to catch several keys on the keyboard. I've got a utility that I'd like to be able to automagically get a screenshot when something goes wrong so I dont ha

Re: [Tutor] One million and counting

2006-10-31 Thread Chris Hengge
Very cool! Congrats!On 10/31/06, Alan Gauld <[EMAIL PROTECTED]> wrote: Hi folks,In just thought I'd mention that my web tutor has now passedthe million visitors mark. Thanks to all those on the tutorlist who have paid a visit.Alan GauldAuthor of the Learn to Program web site http://www.freenetpages

Re: [Tutor] Using sys.exit()

2006-10-30 Thread Chris Hengge
Try using SPE, I've really liked it for some of extra features inside it like TODO tags that are automanaged. Also, its written in python, so thats kinda  cool factor. It's also free. On 10/30/06, Dick Moores <[EMAIL PROTECTED]> wrote: At 05:06 PM 10/30/2006, Dick Moores wrote:>I'd like to know ho

[Tutor] VNC library for python

2006-10-28 Thread Chris Hengge
Does this exist? I see projects talking about writing viewers in python, and talking about their flaws or potential, but I've not seen a single library.Thanks. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is this only catching one occurance?

2006-10-27 Thread Chris Hengge
"Failed to strip excess hex files." On 10/27/06, Chris Hengge <[EMAIL PROTECTED]> wrote: Thats for this very humorous reply =DOn 10/26/06, Luke Paireepinart < [EMAIL PROTECTED]> wrote: Chris Hengge wrote:> Here is my code:> for unWantedItem in directory

Re: [Tutor] Why is this only catching one occurance?

2006-10-27 Thread Chris Hengge
I've tried to use your example:for unWantedItem in directoryList[,,-1]:but I get an error:for unWantedItem in directoryList[,,-1]:                     ^SyntaxError: invalid syntax I understand what you are saying to do, and it makes sense, but I'm not sure how to implime

Re: [Tutor] Why is this only catching one occurance?

2006-10-27 Thread Chris Hengge
Thats for this very humorous reply =DOn 10/26/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> Here is my code:> for unWantedItem in directoryList:> try: > if "hex" in unWantedItem.lower():> if

[Tutor] Why is this only catching one occurance?

2006-10-26 Thread Chris Hengge
Here is my code:for unWantedItem in directoryList:    try:    if "hex" in unWantedItem.lower():    if not "bmc" in unWantedItem.lower():   print unWantedItem + " removed!"    directoryList.remove(unWantedItem)This only seem

Re: [Tutor] New to programming and Python

2006-10-26 Thread Chris Hengge
I'm sure I speak for us all when I ask what sort of things are giving you problems? Maybe that would help us point you in the right direction. Good Luck!On 10/25/06, Jorge Azedo <[EMAIL PROTECTED]> wrote: Hi guys ( and gals )I'm totally new to the whole programming scene (I decided to enter itfor

Re: [Tutor] OOP and Python.. a gentle remark

2006-10-25 Thread Chris Hengge
I dont know about the rest of you, but this thread posting from Alan cleared up some fuzzyness I've had about classes. /me is happier using this. instead of self. =DGreat post! On 10/25/06, Alan Gauld <[EMAIL PROTECTED]> wrote: "Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote> Why is it necessary to ex

Re: [Tutor] My first real python project: LOLLERSKATES

2006-10-20 Thread Chris Hengge
All I can say to this... LOLLERSKATES =DOn 10/20/06, Tracy R Reed <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE-Hash: SHA1I have been a sysadmin for quite a while now and used to do a lot of perl. I haven't done much programming at all in the last couple of yearsbut have been mea

Re: [Tutor] Best way to replace items in a list.

2006-10-20 Thread Chris Hengge
I like it because it different.. and it reads cleanly... =PAs far as the first occurance.. I'm not concerned about checking extra, because the first occurance is the only one I should ever need. On 10/20/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> I'

Re: [Tutor] Best way to replace items in a list.

2006-10-20 Thread Chris Hengge
Will that replace the location? or add to it? Thanks.On 10/20/06, Jason Massey <[EMAIL PROTECTED] > wrote:Why not:if item in list: loc = list.index(item)  list[loc] = strOn 10/20/06, Chris Hengge < [EMAIL PROTECTED]> wrote: I'm trying to build a little piece of code that repl

[Tutor] Best way to replace items in a list.

2006-10-20 Thread Chris Hengge
I'm trying to build a little piece of code that replaces an item in a list. Here is a sample of what I'd like to do.str = "This was replaced"ff item in list:   replace item with str I know I can do list.remove(item), but how do I place str back into that exact location?Is this how / best way?if ite

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
Oops, my mistake, I did read your code, as well as all the others and I had your code mixed with another submission. In that case, excellent contribution =DOn 10/19/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> More on that.. some of the file I work with are tho

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
More on that.. some of the file I work with are thousands of lines long... one is even 10's of thousands.. so reading the entire thing into ram is MUCH faster then reading line by line with the filestream open. On 10/19/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I dont care for slo

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
ake though. On 10/19/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote:> I thought my solution was the easiest.. but I guess everyone skipped it =PNo, we didn't skip it,but as we're all programmers here, we showed alternate ways that itcould be done. Your pos

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
I thought my solution was the easiest.. but I guess everyone skipped it =POn 10/19/06, Kent Johnson <[EMAIL PROTECTED] > wrote:Danny Yoo wrote:>> file('filename.txt').readlines()[-1] Not to hijack the thread, but what stops you from just putting a file.close() after your example line?>

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
Very informative and creative reply! Thanks for sharing :]On 10/19/06, Danny Yoo <[EMAIL PROTECTED] > wrote:>> >> file('filename.txt').readlines()[-1]>> >> > Not to hijack the thread, but what stops you from just putting a>> > file.close() after your example line? Which file should file.close()

Re: [Tutor] Generic Application Frameworks?

2006-10-19 Thread Chris Hengge
About frameworks being complicated... I'm sure there are exceptions to this, but my experience is that if you think of a framework as a tool, sure , you gotta learn how to use it first, which means it will slow you down upfront.. But.. once you know how to use the tool in theory it will make your j

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
Oh wow.. I totally missed that... nevermind.. ignore that question =DOn 10/19/06, Danny Yoo <[EMAIL PROTECTED] > wrote:>> file('filename.txt').readlines()[-1]> Not to hijack the thread, but what stops you from just putting a > file.close() after your example line?Which file should file.close() clos

Re: [Tutor] Generic Application Frameworks?

2006-10-19 Thread Chris Hengge
http://dabodev.com/aboutHere we go... 3 tier application framework.. Thats almost perfect.. I suppose I could figure out the auto update thing myself... since that is all that it is missing for what I was wanting.. Thanks again! On 10/19/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I ran a

Re: [Tutor] Generic Application Frameworks?

2006-10-19 Thread Chris Hengge
D] [mailto:[EMAIL PROTECTED]]On Behalf Of Chris HenggeSent: Thursday, October 19, 2006 1:22 PMTo: PyTutorSubject: Re: [Tutor] Generic Application Frameworks? Just incase anyone doesn't want to see that document to knowwhat I'm asking about...Razor/

Re: [Tutor] Generic Application Frameworks?

2006-10-19 Thread Chris Hengge
Just incase anyone doesn't want to see that document to know what I'm asking about...Razor/Carbon includes:Auto UpdatePlugin System with managementError reportingIts got a few other features, but these are my focus. On 10/19/06, Chris Hengge <[EMAIL PROTECTED]> wrote: I was curi

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
Not to hijack the thread, but what stops you from just putting a file.close() after your example line?On 10/19/06, Chad Crabtree < [EMAIL PROTECTED]> wrote:file('filename.txt').readlines()[-1] Some will say that this is no good because the file is still open.  However I've been told that when the o

Re: [Tutor] Trying to extract the last line of a text file

2006-10-19 Thread Chris Hengge
I'd personally do something like this. file = open(myfile, 'r')fileContents = file.readlines() # read the entire document into memory for speed.file.close()print fileContents[-1] # This is the last line. On 10/19/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote: My algorithm is like this: first count

  1   2   >