Re: [Tutor] split or replace

2009-06-05 Thread W W
On Fri, Jun 5, 2009 at 6:18 AM, Norman Khine wrote: > Hello, > What is the way to group each value so that I get a list, from a string > like: > > dir = '/expert/forum/expert/expert' > list = ['/expert', '/forum', '/expert', '/expert'] > > I've tried: > >>> dir = '/expert/forum' > >>> dir.split('

Re: [Tutor] serious problem with graphics module

2009-06-04 Thread W W
On Thu, Jun 4, 2009 at 7:47 PM, Kent Johnson wrote: > On Wed, Jun 3, 2009 at 5:51 PM, W W wrote: > > > Do you (or sombody else) know how to get ipython working with Python 2.6 > > (you know, > > the Python release, which has that new turtle module ;-) ) > > >

Re: [Tutor] advise on this loop

2009-06-04 Thread W W
On Thu, Jun 4, 2009 at 8:29 AM, Norman Khine wrote: > Hello, > I have the following code, which searches through a directory structure > such as: > > $ tree -L 2 companies > companies > |-- aberdeen-airport-ltd > | |-- aberdeen-airport-dyce-grampian > | `-- aberdeen-airport-dyce-grampian.meta

Re: [Tutor] serious problem with graphics module

2009-06-03 Thread W W
Forwarding on to the list... -- Forwarded message -- From: Gregor Lingl Date: Wed, Jun 3, 2009 at 3:46 PM Subject: Re: [Tutor] serious problem with graphics module To: W W W W schrieb: > On Tue, Jun 2, 2009 at 7:12 PM, Gregor Lingl gregor.li...@aon.at>&

Re: [Tutor] serious problem with graphics module

2009-06-02 Thread W W
On Tue, Jun 2, 2009 at 7:12 PM, Gregor Lingl wrote: > > Does anyone have experience with using IPython with Tkinter? Plenty, and it works wonderfully. I've never had any errors (that I know of) that weren't of my own making ;) My personal development environment consists of ipython for trying

Re: [Tutor] python workspace

2009-06-02 Thread W W
On Tue, Jun 2, 2009 at 1:30 PM, Dave Angel wrote: > roberto wrote: > > On Tue, Jun 2, 2009 at 10:54 AM, roberto wrote: >> >> >>> >> >>> >> hello, >>> >> i'd like to ask if there is anything in python which helps to see what >>> >> variables have been defined and their type and their dimension

Re: [Tutor] How o convert spaces into tabs??

2009-06-02 Thread W W
On Tue, Jun 2, 2009 at 12:42 PM, jyotsna guleria wrote: > > Hello every one, > > I am trying to parse a file: > > I want to convert all the spaces in between the characters to single tab. > > e.g: my file has contents like: > > 1G579011 10 2 0 00 >

Re: [Tutor] Spell checking source code?

2009-06-02 Thread W W
On Tue, Jun 2, 2009 at 3:15 AM, ALAN GAULD wrote: > > > From: "wormina...@gmail.com" > > To: Alan Gauld > > Sent: Tuesday, 2 June, 2009 1:09:39 AM > > Subject: Re: [Tutor] Spell checking source code? > > > > In vim, > > > > :set spell > > :set nospell > > :help spell > > > But that will check th

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread W W
On Mon, Jun 1, 2009 at 3:55 PM, Alan Gauld wrote: > > "W W" wrote > >> class C: >>> @constructor >>> def LoadFromFile(fname, count): ... >>> @constructor >>> def Create(valueTuple):... >>> >>> Personally I pre

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread W W
On Mon, Jun 1, 2009 at 8:59 AM, Alan Gauld wrote: > > "W W" wrote > > ( Multiple constructors (or factory methods) is one feature I would like >>> to see added to Python! ) >>> >> >> Wouldn't it be possible to create sort of a... bast

Re: [Tutor] Challenge supporting custom deepcopy with inheritance

2009-06-01 Thread W W
On Mon, Jun 1, 2009 at 2:27 AM, Alan Gauld wrote: > > "Kent Johnson" wrote > >> > Yesterday, I posted a question to python-list involving custom >> > deepcopies in an inheritance hierarchy. I haven't received any >> >> ISTM that in general B.__deepcopy__() should call A.__deepcopy__() to do >> th

Re: [Tutor] Class Tips

2009-05-30 Thread W W
On Sat, May 30, 2009 at 8:20 PM, David wrote: > > Alan Gauld wrote: >> >> "David" wrote >> >>> I took this program that determines a fertilizer application rate; >>> ... >>> And converted it to class/object to learn how they work. Just looking for some pointers, if I did it correctly etc. >>> >>>

Re: [Tutor] Docking Windows using Python

2009-05-29 Thread W W
On Fri, May 29, 2009 at 7:48 PM, Hi wrote: > My program will have two windows. I want to be able to dock the two so they > are side by side. I am wondering if this is doable in Python. If so, could > someone lead me to the right direction on where to look? Thank you very > much. > I think you co

Re: [Tutor] how to get variable from an external script or program

2009-05-29 Thread W W
On Fri, May 29, 2009 at 4:27 PM, shawn bright wrote: > Hey all > > I have a small program that when run from the command line, will > return a certain value for an arguement. Like this: > > > mfetchz 45 > > 45j > > so the program is mfetchz and the argument is 45 > > i know i can call the program

Re: [Tutor] Tinkering with Tkinter

2009-05-26 Thread W W
On Mon, May 25, 2009 at 7:45 PM, Doug Reid wrote: > The following code and it's explanation doesn't seem to work: > > > 1. >>> from Tkinter import * > > 2. >>> tk = Tk() > > 3. >>> btn = Button(tk, text="click me") > > 4. >>> btn.pack() > > > > In line 1, we import the contents of the > Tk modul

Re: [Tutor] Find a good linux distribution with python.

2009-05-25 Thread W W
On Mon, May 25, 2009 at 3:57 AM, Michael Bernhard Arp Sørensen < mich...@arpsorensen.dk> wrote: > > I just wished that Python was upgraded in the distros. If I want to play > with Python3, I will need to compile it my self and specify which Python > interpretor to use in each Python file. But thi

Re: [Tutor] IP-range

2009-05-25 Thread W W
On Sun, May 24, 2009 at 10:18 PM, Paras K. wrote: > Hello, > > I came across your answer / assistance on the IP range. I am fairly new to > the python world of programming. However, up to this point I have always > been able to get my programs to work by reading the books or following the > guide

Re: [Tutor] Parsing Bible verses

2009-05-21 Thread W W
On Thu, May 21, 2009 at 4:26 PM, Eduardo Vieira wrote: > Hello, I'm planning to create a script to read a certain file, find > the line that contains Bible references and then use that to query a > bible database in order to print the verses in another file. > I will be looking for lines like thes

Re: [Tutor] Hi everyone

2009-05-21 Thread W W
On Thu, May 21, 2009 at 2:42 AM, spir wrote: > >while word: > position = random.randrange(len(word)) >jumble += word[position] >word = word[:position] + word[(position + 1):] > Something that many of us use for debugging, and is also useful for comprehension is a sim

Re: [Tutor] Triggering code on 1 minute intervale ..

2009-05-09 Thread W W
On Sat, May 9, 2009 at 3:26 PM, Alex Feddor wrote: > .. What will be the best solution to trigger python code every minute as > soon as PC in on. > an autorun script... and in your script use the time.sleep(60) I believe. HTH, Wayne ___ Tutor maillist

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread W W
On Tue, May 5, 2009 at 5:41 AM, spir wrote: > Le Tue, 5 May 2009 00:41:39 +0100, > "Alan Gauld" s'exprima ainsi: > > > > Backwards compatibility. The file type was introduced in python 2.2, > > > before which there was open. > > > > And file has been removed again in Python v3 > > In fact o

Re: [Tutor] output formatting

2009-04-25 Thread W W
On Fri, Apr 24, 2009 at 10:57 PM, Matt Domeier wrote: > Hello, > > I have a series of lists that I need to output into files with a specific > format. Specifically, I need to have line breaks after each entry of the > list, and I need to do away with the ['..'] that accompany the data after I > t

Re: [Tutor] understanding urllib.urlopen

2009-04-23 Thread W W
On Thu, Apr 23, 2009 at 10:58 AM, johnf wrote: > On Thursday 23 April 2009 08:44:07 am Emile van Sebille wrote: > > johnf wrote: > > > > > > > But if I attempt this > > > urllib.urlopen( > > > "http://maps.google.com?q='18Tadlock > > > Place Woodland CA'" > > >

Re: [Tutor] Python help

2009-04-22 Thread W W
On Wed, Apr 22, 2009 at 11:08 AM, IT_ForMe wrote: > > Anyone know how to program this using Python > > Add up the prices for items in a shopping cart. Some items are taxable and > some items are not. You may assume a 7% tax rate for all taxable items. > Apply a 10% discount if the customer is a s

Re: [Tutor] Looping

2009-04-20 Thread W W
On Mon, Apr 20, 2009 at 12:34 PM, Matt > wrote: > Thank you. Func is in fact a call to an external non-python program. =] > Therefore, the loop must actually be mindlessly done. My question, however, > has been answered. > As an aside, why use range rather than xrange? I was under the impression

Re: [Tutor] Looping

2009-04-20 Thread W W
On Mon, Apr 20, 2009 at 8:48 AM, Matt > wrote: > Hey everyone, > > First post to this list. I hope I'm doing it right. > > Let's say I want to run func 10 times Is there a more pythonic way to do it > than this: > for i in xrange(10): > func() AFAIK that's the most pythonic way to do it... and

Re: [Tutor] for loop

2009-04-16 Thread W W
On Thu, Apr 16, 2009 at 3:45 PM, mbikinyi brat wrote: > Dear ALL, > I am a beginner in python and I just copied the code in blue below and > execute and had the result in green. Then I thought *letter* should be a > special word in python. Then I now replace letter whith *chic* and yet > the same

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread W W
On Wed, Apr 15, 2009 at 12:27 PM, Carnell, James E < jecarn...@saintfrancis.com> wrote: > Since # the list seems thick with OOP questions at the moment, I thought > this might # be relevant. Digest and enjoy. > > class Item ( object ): > >def __init__( self ): >self._FullName = '' >

Re: [Tutor] python books

2009-04-15 Thread W W
On Wed, Apr 15, 2009 at 4:45 AM, Wayne Watson wrote: > It's unlikely you are going to find a pdf on Python that's suitable for > beginners. Do you mean pdf or a digital book? There are Python books in > digital form on the web. I'm not quite sure how it works, but I know of at > least one public l

Re: [Tutor] Looking for starter projects

2009-04-15 Thread W W
On Wed, Apr 15, 2009 at 3:50 AM, Evert Edel wrote: > Hi all, > > Now since I've got the learning python book I first did a quick read trough > it and now I'm going more slowly trough it and doing all the explained > things (in the interactive prompt). I do understand the basics behind OOP > and

Re: [Tutor] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread W W
On Mon, Apr 13, 2009 at 1:22 PM, Gregor Lingl wrote: > Wayne Watson schrieb: > >> Sometime ago, one of my posts brought a response brief exchange on event >> handling*. Where might I find more about event handling with respect to the >> keyboard, and particularly with a mouse. In the latter case,

Re: [Tutor] Executing a GUI from another GUI with a click of a button

2009-04-06 Thread W W
On Mon, Apr 6, 2009 at 2:30 PM, Chris Lee wrote: > > > I know for certain that the "clock.py" works (because i got it from the > web.. -_-;;) > > but I'm having a real difficulty trying to open clock.py through my real > program > > I know you're busy and everything, but I REALLY hope you can

Re: [Tutor] Left Alignment -- Tkinter

2009-04-02 Thread W W
On Wed, Apr 1, 2009 at 11:20 PM, Wayne Watson wrote: > Alan, the game changed in the thread you branched away from to other > considerations. As stated there, I've thrown in the towel, but first let me > say what the game was about. Here's the simplest example. Say I have four > labels: small, bi

Re: [Tutor] Left Alignment -- Tkinter

2009-03-30 Thread W W
On Sun, Mar 29, 2009 at 9:30 AM, Wayne Watson wrote: > I'm looking at the NM Tech Tkinter ref, pages 5-6, on the grid > method. See pages 84-88 of Lundh. Nothing. It does not show that method. > Search of the pdf doc shows nothing. Are these sources too old? effbot does > have it. Yes, it's pretty

Re: [Tutor] Automated function creation / outsourcing code

2009-03-29 Thread W W
On Sat, Mar 28, 2009 at 5:34 AM, Martin Klimach wrote: > Is there a python editor, that can automatically turn a selection of > code into a function? Matching the input and return variables? > > I've never heard of one. I suppose you could probably write your own using regexes perhaps. -Wayne _

Re: [Tutor] Left Alignment -- Tkinter

2009-03-28 Thread W W
On Sat, Mar 28, 2009 at 9:47 AM, Wayne Watson wrote: > Hi, that's an interesting way to look at it. Actually, I was about to > probe the color idea myself, but needed to better understand how to achieve > it. Where did grid_columnconfigure(3, weight=1) come from? I don't recall > seeing that with

Re: [Tutor] Left Alignment -- Tkinter

2009-03-28 Thread W W
On Fri, Mar 27, 2009 at 2:46 PM, Wayne Watson wrote: > It's very difficult to tell. I've tried it. > fLocation=Frame(master) > fLocation.pack(side=LEFT) > I need to size the fLocation frame to make it big. As it is, it must be > giving the smallest possible size. > > I tried this

Re: [Tutor] (no subject)

2009-03-17 Thread W W
On Tue, Mar 17, 2009 at 2:16 PM, Jared White wrote: > This is what i have so far an this is not what i want it to do > "NO this isnt homework" i am trying to learn this myself > > #!/usr/bin/env python > # > #Author: J White > #Python 2.5.2 > # > howmany = int(raw_input('How many lines ')

Re: [Tutor] best gui for the job?

2009-03-13 Thread W W
On Fri, Mar 13, 2009 at 1:18 PM, Lie Ryan wrote: > W W wrote: > > What do you mean "good enough resolution"? I suppose I really meant quality - the shapes I drew with PIL were severely aliased, but maybe I didn't do it right. -Wayne -- To be considered stupid and to be

[Tutor] best gui for the job?

2009-03-13 Thread W W
Hi, What is the best gui to implement a simple paint-esque program in? I already built a really simple one in Tkinter - but Tkinter lacks a save functionality. I considered using the PIL to draw in the background, but it didn't seem to have a good enough resolution. I thought about pyGTK because

Re: [Tutor] probelm pyhton shell doesnt open help please

2009-03-08 Thread W W
On Sun, Mar 8, 2009 at 3:32 PM, mustafa akkoc wrote: > > it gives this message socket error That's not terribly descriptive... what type of python shell? IDLE? Interactive prompt? Ipython? Certainly you don't mean this? u...@system:~$ python socket error u...@system:~$ -Wayne _

Re: [Tutor] Pyusb: get data via USB sent from mouse

2009-03-08 Thread W W
On Sat, Mar 7, 2009 at 9:35 AM, andré palma wrote: > Hi folks, I'm new on pyusb programming and to learn how to get data i'm > trying  to get  data  sent  from  my mouse. > I've download a program called usbview( http://www.kroah.com/linux/usb/ ) to > display the device descriptors of any USB devi

Re: [Tutor] print problem python

2009-03-07 Thread W W
On Sat, Mar 7, 2009 at 3:11 AM, Alan Gauld wrote: > Python 3 has a lot of > changes and most of the beginners material hasn't caught > up yet. It will be easier to get answers to your questions if > you stick with v2.6 and then when comfortable with that move > to v3 aand learn about the differenc

Re: [Tutor] Configuration File, Tkinter, IntVars--Manufacturing Variables

2009-03-03 Thread W W
On Tue, Mar 3, 2009 at 1:54 PM, Wayne Watson wrote: > > BTW, the Quit function is original but doesn't kill the window when Quit is > used. What fixes that? For more bonus points, it seems as though the try > statement in the dialog should really bring up an "Error" dialog saying > something is wr

Re: [Tutor] animation with Tkinter canvas

2009-03-03 Thread W W
On Tue, Mar 3, 2009 at 3:05 AM, Mr Gerard Kelly wrote: > Hello, I am attempting to make a simple animation of a vibrating string using > Tkinter canvas. > I haven't been able to find much information on how to do it. > I have my data of position x on the string at time t. I can plot it > with > r

Re: [Tutor] modular program

2009-03-01 Thread W W
On Sun, Mar 1, 2009 at 3:36 AM, Daniele wrote: > Hi, > I'd like to write a python program which can be easily extended by other > people. Where can I find some "best practices" for writing modular programs? > I thought about a txt file containing function calls that my program will > parse and exe

Re: [Tutor] Tkinter Grid, Listbox expand

2009-02-26 Thread W W
Aha! I found the key - I was missing the weight argument: 1 from Tkinter import * 2 import os, shutil, tkFileDialog, tkMessageBox 3 4 class TkSync: 5 def __init__(self, root): 6 self.sbox = Listbox(root) 7 self.sbox.grid(row=0, column=0, sticky=N+S+E+W) 8

[Tutor] Tkinter Grid, Listbox expand

2009-02-26 Thread W W
Hi, I'm writing a Tkinter program and having severe problems with getting my listbox to expand when I resize the window. Here's my code so far: 1 from Tkinter import * 2 import os, shutil, tkFileDialog, tkMessageBox 3 4 class TkSync: 5 def __init__(self, root): 6 self.sbo

Re: [Tutor] "Ctrl-C (unix)" in python

2009-02-18 Thread W W
On Wed, Feb 18, 2009 at 4:44 PM, pa yo wrote: > I am running my Twitter>>Wiki bots in infinite loops but can't find > an easy way to turn them off gracefully once I have started them. At > the moment I have to go into the terminal window where they are > running and type "Ctrl-C". (I am running

Re: [Tutor] List weirdness

2009-02-13 Thread W W
On Fri, Feb 13, 2009 at 11:01 AM, bob gailer wrote: > Moos Heintzen wrote: > >> I guess I can't reference [0] on an empty list. (I come from a C >> background.) >> > Can you have an empty array in C? If so, it does not have any elements, so > you can't refer to element 0. I think the OP was co

Re: [Tutor] IDLE vs PythonWin

2009-02-10 Thread W W
On Mon, Feb 9, 2009 at 9:29 PM, Eric Dorsey wrote: > You can call a .py script from the command line, and it will run there. So, > in Windows XP: Start > Run > type "CMD" > Vista: Start > type "CMD" into the Start Search field. > If you're in Linux, get to a Terminal. > In Windows another window

Re: [Tutor] Simple PassGen

2009-02-09 Thread W W
On Mon, Feb 9, 2009 at 3:35 PM, Kayvan Sarikhani wrote: > Hello Tutors, > I thought that maybe adding "print random.choice(pool).strip()" > might work but not having any luck with that. Is the output this way, simply > because of the nature of the range, or can anyone point my in the right > dir

Re: [Tutor] Closing and Open File--TkFileDialogs

2009-02-07 Thread W W
On Sat, Feb 7, 2009 at 9:09 AM, Wayne Watson wrote: > Yes, amazingly enough, I'm quite familiar with basic file operations. :-) > I'm certainly no expert at all variations of it. > > Now for a related question. I'm using Win XP. One of the arguments is the > default_path. I would like it to be t

Re: [Tutor] Designing a Dialog in Python

2009-02-06 Thread W W
On Fri, Feb 6, 2009 at 3:12 AM, Alan Gauld wrote: > "Wayne Watson" wrote > >> Signature.htmlWhen I used VBasic many years ago, it had the ability to >> design a dialog and then attach it to the code. Is there something like this >> available for Python? >> > > However most Python programmers stil

Re: [Tutor] struct question

2009-02-03 Thread W W
On Tue, Feb 3, 2009 at 6:25 PM, bob gailer wrote: > >>> struct.calcsize('s') > 1 > >>> struct.calcsize('d') > 8 > >>> struct.calcsize('sd') > 16 > > Why? Should not that be 9? > >>> struct.calcsize('ds') 9 at least on the current box I'm running. It also gave me this: >>> struct.calcsize('sd')

Re: [Tutor] IDLE vs PythonWin

2009-01-31 Thread W W
On Sat, Jan 31, 2009 at 8:45 AM, Wayne Watson wrote: > Did I miss a response here? > > Wayne Watson wrote: > > vim? I'm looking at the interactive window now. Here are two choices for > what you say: > 1. > alt-tab vim > Traceback ( File "", line 1 > alt-tab vim > ^ > SyntaxErr

[Tutor] Tkinter program start with focus?`

2009-01-31 Thread W W
Hi, I'm running into a problem that's bugging me because I know a program used it, I just can't find which one it was... I want my Tkinter program to start with the focus, but I can't remember the command. TIA, Wayne -- To be considered stupid and to be told so is more painful than being called

Re: [Tutor] IDLE vs PythonWin

2009-01-31 Thread W W
On Sat, Jan 31, 2009 at 9:56 AM, Wayne Watson wrote: > Hi, sorry, but I have no idea what vim is, let alone how to use any of the > features. I'd still like to know why pythonwin prints almost completely > blank pages. vim=vi(m), linux?? > VIM = Vi IMproved = vim +- vi. Basically, vim is just an

Re: [Tutor] methods split and join in sequence

2009-01-31 Thread W W
On Sat, Jan 31, 2009 at 9:09 AM, David wrote: > Dear list, > > many thanks for all your help - much appreciated. > Today I have continued reading Harrington, and produced the following code, > which works flawlessly. > I wonder, though, how I could join all the supplied words with underscores > _

Re: [Tutor] Problem with nested for-in

2009-01-29 Thread W W
On Thu, Jan 29, 2009 at 5:06 AM, emmanuel.delaborde < emmanuel.delabo...@cimex.com> wrote: > Hello, > > I have the following snippet : > > lines = csv.reader(open("CATEGORY.csv","r")) > lines2 = csv.reader(open("CATEGORYLIST.csv","r")) > > old_cats = [] > for line in lines: print line > >

Re: [Tutor] Find a Word in *.py (Win XP)

2009-01-28 Thread W W
You know, it probably wouldn't be terribly difficult to write the search in python. Then you *could* find strings inside rather easily. HTH, Wayne On Wed, Jan 28, 2009 at 9:30 AM, Wayne Watson wrote: > Thanks. I'll post a msg to a XP group about this. I suspect Python hashes > the code somehow.

[Tutor] Tk+Ipython unexpected behavior

2009-01-26 Thread W W
Hi all, I'm going through "An Introduction to Tkinter" by Fredrik Lundh and came across (what seems to be) some slightly unexpected behavior. I'm editing the python file with my favorite text editor, and using the %run magic function in Ipython to test my program(s). On the second example(pg 4

Re: [Tutor] Defining "bit" type

2009-01-24 Thread W W
On Sat, Jan 24, 2009 at 9:38 AM, Vicent wrote: > >> So, maybe I can adapt the definition of "bool" type, I don't know... >> Anyway, I want to manage 0's and 1's, not "Falses" and "Trues". >> > Well, I can think of something that might be of some help: In [18]: bit = {True:1, False:0} In [19]:

Re: [Tutor] Finding the End of a Def?

2009-01-24 Thread W W
On Sat, Jan 24, 2009 at 7:06 AM, Wayne Watson wrote: > If you are familiar with vi and C, one could enter a simple keystroke and > jump from an opening paren to the corresponding closing one. > > I've long forgotten most of C, but here's a rough segment of a program: > > main() > ( > while (x ==T

Re: [Tutor] Possible to search text file for multiple string values at once?

2009-01-23 Thread W W
On Fri, Jan 23, 2009 at 1:11 PM, Scott Stueben wrote: > Thanks for the help so far - it seems easy enough. To clarify on the > points you have asked me about: > > A sqlite3 database on my machine would be an excellent idea for > personal use. I would like to be able to get a functional script fo

Re: [Tutor] Possible to search text file for multiple string values at once?

2009-01-23 Thread W W
On Fri, Jan 23, 2009 at 12:38 PM, bob gailer wrote: > Scott Stueben wrote: > >> Hi all, >> >> I understand that python excels at text processing, and wondered if >> there is a way to use python to accomplish a certain task. >> I would love to set up a script to parse a file and show results fro

[Tutor] 2.5 vs 3k?

2009-01-19 Thread W W
So, I'm curious about this whole python 3k thing. Is python migrating to 3k only? Will 2.x no longer be "officially" supported? If so/not, what are some of the arguments for migrating to 3k? What makes it "better" than the python we all know and love? Thanks for the info/comments, Wayne -- To b

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread W W
On Mon, Jan 19, 2009 at 12:05 PM, Steve Willoughby wrote: > Is it reasonable to expect that I could use Tkinter for > everything else, but use pygame/pymedia to handle things like > creating a video playback window on the screen, or is pygame > going to want to run the whole GUI event loop and scr

Re: [Tutor] Ip address

2009-01-19 Thread W W
On Mon, Jan 19, 2009 at 8:11 AM, Irimia, Suleapa < irimia.sule...@unknownsoftware.ro> wrote: > Hello list, > > I am new to python and i have a question. I managed to build a client which > connect to an website and grab things from there. I run this client on a > linux box, which have multiple ip

Re: [Tutor] Creating simple windows in XP

2009-01-16 Thread W W
On Thu, Jan 15, 2009 at 5:45 PM, Alan Gauld wrote: > You mean like doing > > import tkMessageBox > tkMessageBox.showinfo("Window Text", "A short message") > > in Tkinter? :-) > > OR > > res = tkMessageBox.askokcancel("Which?", "Ready to stop?") > print res > > At that level Tkinter is pretty easy

Re: [Tutor] running & debugging in python interactive shel

2009-01-15 Thread W W
On Wed, Jan 14, 2009 at 8:18 PM, Che M wrote: > > I'd like to add to this question and expand it: can anyone point me to > a good resource on debugging *generally*? > The first result on "Debugger tutorial" on google sent me to this: http://www.cs.princeton.edu/~benjasik/gdb/gdbtut.html Thou

Re: [Tutor] Working with IDLE in XP, Set Up for A New Program

2009-01-11 Thread W W
On Sat, Jan 10, 2009 at 8:08 PM, Wayne Watson wrote: > I immediately answered my own question by clicking on a link that took me > to a web site with the pdf; however, it looks like I installed Python 2.6. > It'll be easy to uninstall, but I don't see 2.5 -- yet. > http://www.activestate.com/sto

Re: [Tutor] How do we upload multiple files simultaneously?

2009-01-10 Thread W W
On Sat, Jan 10, 2009 at 4:19 PM, Lie Ryan wrote: > On Fri, 09 Jan 2009 21:48:51 -0800, john dow wrote: > > > Dear All, > > > > I a newbie to python... > > > > my problem is to upload more than one file on a single go. I have an > > option open is using some FTP client... > > > > You might be int

Re: [Tutor] Top posters to tutor list for 2008

2009-01-04 Thread W W
I think I find it most interesting that the greatest percent is still under 15% and then it tapers rapidly. I'm curious what % of people posted 5 or less messages... perhaps it will become a personal project somewhere down the road ;) -Wayne On Fri, Jan 2, 2009 at 7:28 AM, Kent Johnson wrote: >

Re: [Tutor] Repply

2008-12-27 Thread W W
On Sat, Dec 27, 2008 at 3:42 AM, Alan Gauld wrote: > > Its C rather than C++. > The <> in include statements are a variation on the "" which can also be > used. > The differences are subtle and have to do with the search path I think. But > its > been so long since I did serious C/++ I can't recal

Re: [Tutor] WinMerge

2008-12-16 Thread W W
Perhaps bold/italics/underline/strikethrough? -Wayne On Tue, Dec 16, 2008 at 12:50 PM, Wayne Watson wrote: > Is there a way to highlight differences between the two files when > printing in b/w? Help suggests there may be some texturing, but all I see is > color choices. > -- > >Way

Re: [Tutor] Having Issues with CMD and the 'python' command

2008-12-16 Thread W W
On Mon, Dec 15, 2008 at 9:56 AM, Benjamin Kaplan wrote: > It's not a question of sensibility. It's a question of purpose. The Zen is > the philosophy of a language that tries to be easy to learn and easy to use. > Python is used by programmers who want to experiment with it, but who > usually know

Re: [Tutor] listen in on other program's tcp connections

2008-12-16 Thread W W
On Tue, Dec 16, 2008 at 12:57 AM, xbmuncher wrote: > On windows XP, I'm running a program that sends TCP connections on port > 5039. I'v ran wireshark to determine this. I want to create a simple program > that listens for these connections and intercepts and then turns the data > transferred int

Re: [Tutor] problems finding position in list and changing it for GO game

2008-12-15 Thread W W
On Mon, Dec 15, 2008 at 10:01 PM, Lee Meredith wrote: > > the MOUSEBUTTONDOWN gives the black0 XandYpositions with the*.append* > how do I reference the address in the list by using XandYpositions > Then replace them or take it out off the list > > This code puts out an error when you hit the let

Re: [Tutor] how to run a process forever

2008-12-10 Thread W W
while True: is also a common way to make your program "run forever". Although you still need to create some sleep/wait function or it will eat up your available processes (so I'm told). -HTH, Wayne On Wed, Dec 10, 2008 at 12:28 PM, Steve Willoughby <[EMAIL PROTECTED]>wrote: > On Wed, Dec 10, 200

Re: [Tutor] importing images and sound

2008-12-02 Thread W W
On Tue, Dec 2, 2008 at 2:02 PM, Steve Willoughby <[EMAIL PROTECTED]> wrote: > > That depends on what GUI toolkit you're using. If you're > going to be doing a lot with sound and images, particularly > video clips, you might want to look at pymedia or pygame Pyglet is another option. -Wayne __

Re: [Tutor] 'for' loops

2008-12-01 Thread W W
On Mon, Dec 1, 2008 at 6:44 PM, WM. <[EMAIL PROTECTED]> wrote: > I recently asked a question about 'for' loops, expecting them to be similar > to 'for-next' loops. I have looked at several on-line tutors but am still > in the dark about what 'for' loops do. > Does anyone have a plain English abou

Re: [Tutor] Tutor Digest, Vol 58, Issue 2

2008-12-01 Thread W W
On Mon, Dec 1, 2008 at 5:24 PM, Alan Gauld <[EMAIL PROTECTED]>wrote: > Since the OP isn't using the loop counter a simpler solution > is simply > > for x in range(3): but the OP was looping from 3 to 1, and that's the easiest way I knew of. -Wayne ___

Re: [Tutor] Tutor Digest, Vol 58, Issue 2

2008-12-01 Thread W W
Try this: for x in xrange(3, 0, -1): : print x : : 3 2 1 HTH, Wayne On Mon, Dec 1, 2008 at 2:20 PM, WM. <[EMAIL PROTECTED]> wrote: > Stooges.py > > i,j,k = 3,3,3 > while i != 1: >print 'Larry, Moe & Curly Joe!' >i -= 1 >while j != 1: >print 'Go Mad!

Re: [Tutor] Leaving PHP for Python

2008-11-25 Thread W W
On Tue, Nov 25, 2008 at 6:43 AM, Jason DeBord <[EMAIL PROTECTED]> wrote: > > The following for example: > > from mod_python import apache > > def handler(req): > req.write("Hello World!") > return apache.OK > > Frankly, I don't understand what is going on in the above. This is a bit > diff

Re: [Tutor] Open Source database software

2008-11-24 Thread W W
On Mon, Nov 24, 2008 at 6:19 PM, Mike Meisner <[EMAIL PROTECTED]> wrote: > Y'all have been so good with suggestions on my programming problems in > the past, I wonder if anyone could provide a suggestion on a more general > topic. > 5. And, everything either in Python or with APIs that Python ca

Re: [Tutor] file locations

2008-11-24 Thread W W
On Mon, Nov 24, 2008 at 1:10 PM, Jeff Peery <[EMAIL PROTECTED]> wrote: > Hello, > I have a wxapp from which I would like to execute another wxapp. the > 'child' wxapp is located in a sub directory of the 'parent' wxapp. The > problem I'm having is that I execute the child app from the parent app a

Re: [Tutor] My horrible looking program needs improvement.

2008-11-24 Thread W W
On Mon, Nov 24, 2008 at 10:00 AM, Peter van der Does <[EMAIL PROTECTED] > wrote: > I wrote my 1st Python program and it works as I want it to work but > ,IMHO, it looks horrible. Nothing to be ashamed of, unless you don't mind it looking horrible. The fact that you want a clean program is a good

Re: [Tutor] the sense of brackets

2008-11-22 Thread W W
On Sat, Nov 22, 2008 at 9:42 AM, spir <[EMAIL PROTECTED]> wrote: > I have long thought "[]" /simply/ is a list constructor syntax. > What do you think of the following? > > t = "aze" > print t, list(t), [t] > print list(list(t)), list([t]), [list(t)], [[t]] > ==> > aze ['a', 'z', 'e'] ['aze'] > ['

Re: [Tutor] experience/opinions with deploying python GUI app to Linux, Win32, and Mac OS X

2008-11-12 Thread W W
On Wed, Nov 12, 2008 at 9:03 PM, greg whittier <[EMAIL PROTECTED]>wrote: > - web app running locally -- no experience with this, but everybody > has a web browser and there are frameworks like django I could use > - curses -- probably not as pretty as mac/windows users would expect > I'd probably

Re: [Tutor] Running a script from another folder

2008-11-12 Thread W W
On Wed, Nov 12, 2008 at 10:27 AM, <[EMAIL PROTECTED]> wrote: > Suppose I have a python script in /usr1/myID/bin and I want to run it from > another folder. If I enter > > python ~myID/bin/myscript > > that works. Is there a way to get by with > > python myscript > > or even > > myscript.py > > I'v

Re: [Tutor] Question

2008-11-10 Thread W W
On Mon, Nov 10, 2008 at 9:40 AM, Alan Gauld <[EMAIL PROTECTED]>wrote: > What does nano do that vi (or emacs) doesn't? Given that vi is the > "standard" editor on *nix ity would seem the obvious choice. But everyone > seems to be using nano? Why? AFAIK, it's a little smaller/faster than emacs..

Re: [Tutor] Intermediate/advanced concepts

2008-11-07 Thread W W
On Fri, Nov 7, 2008 at 4:12 AM, Eric Abrahamsen <[EMAIL PROTECTED]>wrote: > >> > > Also, are there other concepts that I should focus on? Frankly, I'm a bit >> bored because I've hit this ceiling, and I'm not really sure where to go to >> next. > > If you want to learn all sorts of new and exciti

Re: [Tutor] Date validation?

2008-11-06 Thread W W
On Thu, Nov 6, 2008 at 1:27 PM, Eric Dorsey <[EMAIL PROTECTED]> wrote: > Greetings,I have a program where I ask a user to enter a date in format > -MM-DD, and get a string like: '2008-10-25' > > Can anyone tell me how I would verify this is a real date before allowing > it to be passed on to t

Re: [Tutor] using rect.inflate()

2008-11-06 Thread W W
On Wed, Nov 5, 2008 at 8:14 PM, John Fouhy <[EMAIL PROTECTED]> wrote: > 2008/11/6 Christopher Spears <[EMAIL PROTECTED]>: > > I inserted this code snippet into the Spaceship class: > > > > self.rect = self.image.get_rect() > > print self.rect > > self.rect = self.rect.inflate(-50, -50) > > print s

Re: [Tutor] accessing an image with pygame.image.load()

2008-11-04 Thread W W
On Mon, Nov 3, 2008 at 8:37 PM, Jerry Hill <[EMAIL PROTECTED]> wrote: > Beyond what Bob says about being careful of the escape character ('\') > and the need to either double it up in a string literal or use a raw > string, are you sure that path is right? Usually a drive letter is > followed by

Re: [Tutor] How to check online status

2008-11-03 Thread W W
On Mon, Nov 3, 2008 at 9:54 AM, Timmie <[EMAIL PROTECTED]> wrote: > Dear fellow Pythonistas, > is it possible to check with Python whether a computer is connected to the > internet or not? Yes. That's the short answer anyway. > I don't not find a module which can do such a thing like 'ping'?

[Tutor] Iterate by twos

2008-11-02 Thread W W
is there a better/more pythonic way to do something like this? spam = ['c','c','v','c','v'] for x in xrange(0,5,2): print spam[x], spam[x+1] There are other things I'll be doing with the values, but I want to get them in chunks of two. (I realize that this code will throw errors, it's just a

Re: [Tutor] Debugging, other

2008-11-01 Thread W W
On Sat, Nov 1, 2008 at 11:21 AM, Jennifer Miller <[EMAIL PROTECTED]>wrote: > Hello, > > I would like to step through with debugging in PythonWin, I have added > this toolbar, but I cannot click on it as an option. Also, when I > click run, to define the arguments, do I enter them in the format >

Re: [Tutor] mergin two csv files based on a common join

2008-10-31 Thread W W
On Fri, Oct 31, 2008 at 4:04 PM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > Hello again, > Thanks for the replies on my previous post, but I have a different > problem now and don't see how to deal with it in a smooth way. I'd probably use a dict with a list as the value: > > "1", "text"

  1   2   3   >