Re: [Tutor] split or replace

2009-06-05 Thread W W
On Fri, Jun 5, 2009 at 6:18 AM, Norman Khine nor...@khine.net 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'

Re: [Tutor] serious problem with graphics module

2009-06-04 Thread W W
On Thu, Jun 4, 2009 at 7:47 PM, Kent Johnson ken...@tds.net wrote: On Wed, Jun 3, 2009 at 5:51 PM, W Wsri...@gmail.com 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 ;-) ) doesn't

Re: [Tutor] serious problem with graphics module

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

Re: [Tutor] Spell checking source code?

2009-06-02 Thread W W
On Tue, Jun 2, 2009 at 3:15 AM, ALAN GAULD alan.ga...@btinternet.comwrote: From: wormina...@gmail.com wormina...@gmail.com To: Alan Gauld alan.ga...@btinternet.com Sent: Tuesday, 2 June, 2009 1:09:39 AM Subject: Re: [Tutor] Spell checking source code? In vim, :set spell :set

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 jyotsna.gule...@gmail.comwrote: 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

Re: [Tutor] python workspace

2009-06-02 Thread W W
On Tue, Jun 2, 2009 at 1:30 PM, Dave Angel da...@ieee.org wrote: roberto wrote: On Tue, Jun 2, 2009 at 10:54 AM, roberto robert...@gmail.com 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

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 alan.ga...@btinternet.comwrote: Kent Johnson ken...@tds.net 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

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 alan.ga...@btinternet.comwrote: W W sri...@gmail.com 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... bastardization? i.e. def __init__

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 alan.ga...@btinternet.comwrote: W W sri...@gmail.com wrote class C: @constructor def LoadFromFile(fname, count): ... @constructor def Create(valueTuple):... Personally I prefer the Delphi style sincve it makes the constructor call

Re: [Tutor] Class Tips

2009-05-30 Thread W W
On Sat, May 30, 2009 at 8:20 PM, David da...@abbottdavid.com wrote: Alan Gauld wrote: David da...@abbottdavid.com 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

Re: [Tutor] Docking Windows using Python

2009-05-29 Thread W W
On Fri, May 29, 2009 at 7:48 PM, Hi haztan...@gmail.com 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.

Re: [Tutor] Tinkering with Tkinter

2009-05-26 Thread W W
On Mon, May 25, 2009 at 7:45 PM, Doug Reid rnrcr...@yahoo.com 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 module, so we

Re: [Tutor] IP-range

2009-05-25 Thread W W
On Sun, May 24, 2009 at 10:18 PM, Paras K. para...@gmail.com 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

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: snip 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 this

Re: [Tutor] Hi everyone

2009-05-21 Thread W W
On Thu, May 21, 2009 at 2:42 AM, spir denis.s...@free.fr wrote: snip 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

Re: [Tutor] Parsing Bible verses

2009-05-21 Thread W W
On Thu, May 21, 2009 at 4:26 PM, Eduardo Vieira eduardo.su...@gmail.comwrote: 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

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 alex.fed...@gmail.com 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

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 denis.s...@free.fr wrote: Le Tue, 5 May 2009 00:41:39 +0100, Alan Gauld alan.ga...@btinternet.com 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

Re: [Tutor] output formatting

2009-04-25 Thread W W
On Fri, Apr 24, 2009 at 10:57 PM, Matt Domeier dome...@umich.edu 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

Re: [Tutor] understanding urllib.urlopen

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

Re: [Tutor] Python help

2009-04-22 Thread W W
On Wed, Apr 22, 2009 at 11:08 AM, IT_ForMe snice14...@aol.com 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

Re: [Tutor] Looping

2009-04-20 Thread W W
On Mon, Apr 20, 2009 at 8:48 AM, Matt hellzfury+pyt...@gmail.comhellzfury%2bpyt...@gmail.com 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()

Re: [Tutor] Looping

2009-04-20 Thread W W
On Mon, Apr 20, 2009 at 12:34 PM, Matt hellzfury+pyt...@gmail.comhellzfury%2bpyt...@gmail.com 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

Re: [Tutor] for loop

2009-04-16 Thread W W
On Thu, Apr 16, 2009 at 3:45 PM, mbikinyi brat mbikinyi_b...@yahoo.comwrote: 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*

Re: [Tutor] Looking for starter projects

2009-04-15 Thread W W
On Wed, Apr 15, 2009 at 3:50 AM, Evert Edel beat...@gmail.com wrote: Hi all, snip 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

Re: [Tutor] python books

2009-04-15 Thread W W
On Wed, Apr 15, 2009 at 4:45 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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

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] Event Handling--Key Press, Mouse Movement ...

2009-04-13 Thread W W
On Mon, Apr 13, 2009 at 1:22 PM, Gregor Lingl gregor.li...@aon.at 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

Re: [Tutor] Left Alignment -- Tkinter

2009-04-02 Thread W W
On Wed, Apr 1, 2009 at 11:20 PM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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

Re: [Tutor] Left Alignment -- Tkinter

2009-03-30 Thread W W
On Sun, Mar 29, 2009 at 9:30 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: snipI'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

Re: [Tutor] Automated function creation / outsourcing code

2009-03-29 Thread W W
On Sat, Mar 28, 2009 at 5:34 AM, Martin Klimach beachfl...@googlemail.comwrote: snipIs there a python editor, that can automatically turn a selection of code into a function? Matching the input and return variables? snip I've never heard of one. I suppose you could probably write your own

Re: [Tutor] Left Alignment -- Tkinter

2009-03-28 Thread W W
On Fri, Mar 27, 2009 at 2:46 PM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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

Re: [Tutor] Left Alignment -- Tkinter

2009-03-28 Thread W W
On Sat, Mar 28, 2009 at 9:47 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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

Re: [Tutor] (no subject)

2009-03-17 Thread W W
On Tue, Mar 17, 2009 at 2:16 PM, Jared White dukelx2...@gmail.com 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

[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] best gui for the job?

2009-03-13 Thread W W
On Fri, Mar 13, 2009 at 1:18 PM, Lie Ryan lie.1...@gmail.com wrote: W W wrote: snip 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 told

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 andre...@gmail.com 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

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 mustafa.c...@gmail.com 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:~$

Re: [Tutor] print problem python

2009-03-07 Thread W W
On Sat, Mar 7, 2009 at 3:11 AM, Alan Gauld alan.ga...@btinternet.com wrote: snip 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

Re: [Tutor] animation with Tkinter canvas

2009-03-03 Thread W W
On Tue, Mar 3, 2009 at 3:05 AM, Mr Gerard Kelly gerard.ke...@uqconnect.edu.au 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

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 sierra_mtnv...@sbcglobal.net wrote: snip 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

Re: [Tutor] modular program

2009-03-01 Thread W W
On Sun, Mar 1, 2009 at 3:36 AM, Daniele d.co...@gmail.com 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

[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

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

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

2009-02-18 Thread W W
On Wed, Feb 18, 2009 at 4:44 PM, pa yo payo2...@gmail.com wrote: I am running my TwitterWiki 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

Re: [Tutor] List weirdness

2009-02-13 Thread W W
On Fri, Feb 13, 2009 at 11:01 AM, bob gailer bgai...@gmail.com wrote: Moos Heintzen wrote: snip 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

Re: [Tutor] IDLE vs PythonWin

2009-02-10 Thread W W
On Mon, Feb 9, 2009 at 9:29 PM, Eric Dorsey dors...@gmail.com 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

Re: [Tutor] Simple PassGen

2009-02-09 Thread W W
On Mon, Feb 9, 2009 at 3:35 PM, Kayvan Sarikhani ksarikh...@gmail.comwrote: Hello Tutors, snip 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

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

2009-02-07 Thread W W
On Sat, Feb 7, 2009 at 9:09 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: Yes, amazingly enough, I'm quite familiar with basic file operations. :-) I'm certainly no expert at all variations of it. snip Now for a related question. I'm using Win XP. One of the arguments is the

Re: [Tutor] Designing a Dialog in Python

2009-02-06 Thread W W
On Fri, Feb 6, 2009 at 3:12 AM, Alan Gauld alan.ga...@btinternet.comwrote: Wayne Watson sierra_mtnv...@sbcglobal.net 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?

Re: [Tutor] struct question

2009-02-03 Thread W W
On Tue, Feb 3, 2009 at 6:25 PM, bob gailer bgai...@gmail.com 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') 12

Re: [Tutor] methods split and join in sequence

2009-01-31 Thread W W
On Sat, Jan 31, 2009 at 9:09 AM, David ld...@gmx.net 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

Re: [Tutor] IDLE vs PythonWin

2009-01-31 Thread W W
On Sat, Jan 31, 2009 at 9:56 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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.

[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

Re: [Tutor] IDLE vs PythonWin

2009-01-31 Thread W W
On Sat, Jan 31, 2009 at 8:45 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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 interactive input, line 1 alt-tab

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 stories = []

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 sierra_mtnv...@sbcglobal.netwrote: Thanks. I'll post a msg to a XP group about this. I suspect

[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] Finding the End of a Def?

2009-01-24 Thread W W
On Sat, Jan 24, 2009 at 7:06 AM, Wayne Watson sierra_mtnv...@sbcglobal.netwrote: 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:

Re: [Tutor] Defining bit type

2009-01-24 Thread W W
On Sat, Jan 24, 2009 at 9:38 AM, Vicent vgi...@gmail.com wrote: snip 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.snip Well, I can think of something that might be of some help: In [18]: bit = {True:1, False:0}

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 bgai...@gmail.com 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. snip I would love to set up a script to parse a file and show

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 sidewalk...@gmail.comwrote: 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

Re: [Tutor] Question about pygame/tkinter interaction

2009-01-19 Thread W W
On Mon, Jan 19, 2009 at 12:05 PM, Steve Willoughby st...@alchemy.comwrote: 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

[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 be

Re: [Tutor] Creating simple windows in XP

2009-01-16 Thread W W
On Thu, Jan 15, 2009 at 5:45 PM, Alan Gauld alan.ga...@btinternet.comwrote: 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

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 pine...@hotmail.com wrote: snip 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:

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 sierra_mtnv...@sbcglobal.netwrote: 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.

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 lie.1...@gmail.com 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

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

Re: [Tutor] Repply

2008-12-27 Thread W W
On Sat, Dec 27, 2008 at 3:42 AM, Alan Gauld alan.ga...@btinternet.comwrote: 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

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 xboxmunc...@gmail.com 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

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 benjamin.kap...@case.eduwrote: 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,

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 tesujicam...@gmail.comwrote: snip 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

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, 2008 at

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: snip 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] 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] 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: snipSince 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] '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 about the

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 different compared

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] 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 and

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. snip5. And, everything either in Python or with APIs that Python can

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'] ['a', 'z', 'e']

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've tried

Re: [Tutor] Question

2008-11-10 Thread W W
On Mon, Nov 10, 2008 at 9:40 AM, Alan Gauld [EMAIL PROTECTED]wrote: snip 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: snip 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 exciting

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 self.rect The

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 the

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 a

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'? you

[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

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 name,

Re: [Tutor] python editor / IDE

2008-10-31 Thread W W
Denis, You'll find that most editing is subjective - people use what they're comfortable with. My recommendation to you, since you love notepad++ and are obviously comfortable with it; set it as your default editor and install IPython, then use the %ed magic function to work on your code; or have

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: snip 1, text, aa

Re: [Tutor] Iterate over multiple objects

2008-10-29 Thread W W
On Wed, Oct 29, 2008 at 5:38 AM, A.T.Hofkamp [EMAIL PROTECTED] wrote: snip With the zip() function you can merge two sequences into one: for x, y in zip(string1, string2): print x, y Ah! I *knew* there was a way - I just couldn't remember what it was. Thanks! -Wayne

[Tutor] Iterate over multiple objects

2008-10-29 Thread W W
Hi, I'm trying to compare two strings because I want to find the difference. i.e. string1 = foobar string2 = foobzr is there a simple way to do this with a for loop? This is the method I tried, but it gives me an error: In [14]: for x, y in bar[0], bar[1]: : print x, y :

Re: [Tutor] Need help w/ a for loop

2008-10-24 Thread W W
On Thu, Oct 23, 2008 at 10:29 PM, Monte Milanuk [EMAIL PROTECTED] wrote: Hello again, and thanks to all of you who extended your help! snipMaybe I'm not clever enough, but I didn't see how either example could be used for doing the addition/subtraction determination. Or rather, I found a

Re: [Tutor] random equation generator

2008-10-23 Thread W W
www.google.com/search?q=pygtk+tutorial www.google.com/search?q=python+random+generator www.google.com/search?q=python+dict If you would like to develop the game, you should first try to develop the game, and then ask when you get stuck. If you can't figure out how to get a user to guess between

Re: [Tutor] Need help w/ a for loop

2008-10-23 Thread W W
On Wed, Oct 22, 2008 at 11:09 PM, Monte Milanuk [EMAIL PROTECTED] wrote: Hello all, New guy here, so go easy on me ;) Welcome to python and the tutor list! I'm starting to work my way through Python Programming by Zelle, and have hit a bit of a wall on one of the programming exercises in

Re: [Tutor] How to clear the screen

2008-10-20 Thread W W
On Mon, Oct 20, 2008 at 3:13 AM, Alan Gauld [EMAIL PROTECTED]wrote: Chris Fuller [EMAIL PROTECTED] wrote want to clear the screen, printing the control sequence ESC[2J is all you need. print chr(0x1b) + '[2J' I don't know if this is the most graceful solution... but it seems to work:

  1   2   3   >