unittest tutorial

2007-09-20 Thread Gigs_
does anyone know some good tutorial for unittest? (with examples how unit work)? thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion

2007-09-14 Thread Gigs_
sorry i think that i express wrong. having problem with english what i mean is how python knows to add all thing at the end of recursion def f(l): if l == []: return [] else: return f(l[1:]) + l[:1] f([1,2,3]) recursion1 f([2,3]) + [1] recursion2 f([3]) +

Re: recursion

2007-09-14 Thread Gigs_
Steve Holden wrote: Gigs_ wrote: sorry i think that i express wrong. having problem with english what i mean is how python knows to add all thing at the end of recursion def f(l): if l == []: return [] else: return f(l[1:]) + l[:1] f([1,2,3

recursion

2007-09-13 Thread Gigs_
Can someone explain me this def f(l): if l == []: return [] else: return f(l[1:]) + l[:1] # = cant figure this, how is all sum at the end? thanks! -- http://mail.python.org/mailman/listinfo/python-list

cgi

2007-08-29 Thread Gigs_
i have simple page and form that ask for name and color and cgi script that print that name in another page and background in chosen color all the time this error pop: Error response Error code 501. Message: Can only POST to CGI scripts. Error code explanation: 501 = Server does not support

Re: cgi

2007-08-29 Thread Gigs_
Fabio Z Tessitore wrote: Il Wed, 29 Aug 2007 19:24:54 +0200, Gigs_ ha scritto: i have simple page and form that ask for name and color and cgi script that print that name in another page and background in chosen color all the time this error pop: Error response Error code 501. Message

Re: cgi

2007-08-29 Thread Gigs_
Fabio Z Tessitore wrote: Are you sure your script is in the right dir? On my home computer, php script will work in /var/www but my python script need an other dir to work properly (i don't remember which now ;-)) bye i think that it is in right dir because other script in same dir

Re: cgi

2007-08-29 Thread Gigs_
Gigs_ wrote: Fabio Z Tessitore wrote: Are you sure your script is in the right dir? On my home computer, php script will work in /var/www but my python script need an other dir to work properly (i don't remember which now ;-)) bye i think that it is in right dir because other script

function nested

2007-05-24 Thread Gigs_
i have this function. def f(start): stack = [] def f1(start): for fname in os.listdir(startDir): path = os.path.join(startDir, fname) if os.path.isfile(path): stack.append(path) else: f1(path) return

Re: function nested

2007-05-24 Thread Gigs_
def f(start): stack = [] def f1(start): for fname in os.listdir(start): path = os.path.join(start, fname) if os.path.isfile(path): stack.append(path) else: f1(path) f1(start) return stack i feel s

pipe tutorial

2007-05-22 Thread Gigs_
does anyone know some good tutorial on pipes in python? thx -- http://mail.python.org/mailman/listinfo/python-list

searching algorithm

2007-05-10 Thread Gigs_
Hi all! I have text file (english-croatian dictionary) with words in it in alphabetical order. This file contains 17 words in this format: english word: croatian word I want to make instant search for my gui Instant search, i mean that my program search words and show words to user as user

pyscripter to slow

2007-05-03 Thread Gigs_
I have some problem with pyscripter. Sometimes when I type pyscripter get to slow (i type 10 chars and pyscripter needs 5 seconds to complete this). This happens mostly on deleting some chars. It is very frustrating. Does someone have same situation? btw My comp is amd athlon x2 4000 2mb

tkinter undo

2007-04-28 Thread Gigs_
Hi I dont have idea how to write tkinter undo/redo function form my text editor and my paint program. Could someone help? I'm not asking for code, just for some guidelines to get me in the right way. thanks -- http://mail.python.org/mailman/listinfo/python-list

tkinter listbox

2007-04-25 Thread Gigs_
Hi! Im working on paint program with tkinter canvas. I have two listbox and when i click on first listbox second become deselected. I need to take one thing from first listbox and one thing from second at the same time. How to do that? thx, apologies for bad english --

Re: tkinter listbox

2007-04-25 Thread Gigs_
I have two listbox on frame, and at same time i need to use one option from both listbox. But when I click on first than on second listbox first get deselected. How to make this? Is it possiblE? -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter listbox

2007-04-25 Thread Gigs_
Gigs_ wrote: I have two listbox on frame, and at same time i need to use one option from both listbox. But when I click on first than on second listbox first get deselected. How to make this? Is it possiblE? i found, just need to use exportselection=0 -- http://mail.python.org/mailman

tkinter paint program

2007-04-24 Thread Gigs_
I'm working on tkinter paint program, mostly to learn tkinter canvas. I have method which create buttons for oval, rectangle, line, polygon etc. How to make oval button to be sunken when i click it and to remain sunken until i click on another button (like rectangle and than is another button

Re: tkinter paint program

2007-04-24 Thread Gigs_
Wojciech Muła wrote: Gigs_ wrote: I'm working on tkinter paint program, mostly to learn tkinter canvas. I have method which create buttons for oval, rectangle, line, polygon etc. How to make oval button to be sunken when i click it and to remain sunken until i click on another button (like

Re: tkinter canvas

2007-04-19 Thread Gigs_
[EMAIL PROTECTED] wrote: On Apr 18, 3:43 pm, Gigs_ [EMAIL PROTECTED] wrote: how to write text on canvas. i know that i need to use canvas.create_text, but how to write text than when i create_text? or how to access object ID in canvas and change some options? thanks in advance! All you

RE: tkinter canvas

2007-04-19 Thread Gigs_
I want to when create text box with objid = self.canvas.create_text(x, y, width=event.x-x, text='') how can i bind KeyPress to objid? I want that text appear on canvas as i write it. dont know do I need to use self.canvas.create_window, and put in that window Tkinter Text widget. Or I can do it

tkinter canvas

2007-04-18 Thread Gigs_
how to write text on canvas. i know that i need to use canvas.create_text, but how to write text than when i create_text? or how to access object ID in canvas and change some options? thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter canvas

2007-04-06 Thread Gigs_
gigs wrote: I have made drawing area and few butons. How can I make when i click my fill button that later when i click on oval oval gets filled with chousen color? when later click on my oval that is drawn in to change oval color, or to fill color in oval if click in oval with mouse --

tkinter canvas mvc

2007-04-05 Thread Gigs_
Hi all! I have just finished my tkinter text editor, learning tkinter purpose. Now I want to learn canvas so I want to make my paint program, I think that this will be the best to do over model-view-controler pattern which I need to learn also. Is there any good tutorial for mvc in python or

tkinter popup

2007-03-27 Thread Gigs_
Hi all I cant figure out how to disable resizing of my popup window? How to put this popup window to show in the middle of my text editor? It is writen with Toplevel. thx -- http://mail.python.org/mailman/listinfo/python-list

tkinter MVC

2007-03-27 Thread Gigs_
Can someone give me example how to write text editor in tkintter with model-view-controler? What goes to controler and what goes to model? thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter popup

2007-03-27 Thread Gigs_
Eric Brunel wrote: On Tue, 27 Mar 2007 12:05:07 +0200, Gigs_ [EMAIL PROTECTED] wrote: Hi all I cant figure out how to disable resizing of my popup window? myPopupWindow.wm_resizable(0, 0) It may or may not make resize controls disappear depending on your platform and/or window

P: maticna graficka monitor

2007-03-20 Thread Gigs_
prodajem: maticnu sapphire am2rd580adv, pola god stara, pod garancijom - 700kn graficku sapphire x1650 pro 256 mb pola god start pod garancijom - 600kn monitor philips 190p6es brilliance (kostao 4.100), star 1.5 godinu garancija vrijedi jos 1.5 godinu - 2000kn --

Re: P: maticna graficka monitor

2007-03-20 Thread Gigs_
Gigs_ wrote: prodajem: maticnu sapphire am2rd580adv, pola god stara, pod garancijom - 700kn graficku sapphire x1650 pro 256 mb pola god start pod garancijom - 600kn monitor philips 190p6es brilliance (kostao 4.100), star 1.5 godinu garancija vrijedi jos 1.5 godinu - 2000kn sorry

tkinter grid vs pack

2007-03-17 Thread Gigs_
For what is grid better than pack, and otherwise? thanks in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter text editor

2007-03-08 Thread Gigs_
Gigs_ wrote: I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected Btw it is cut copy ... in edit menu -- http://mail.python.org/mailman/listinfo/python-list

tkinter text editor

2007-03-08 Thread Gigs_
I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter text editor

2007-03-08 Thread Gigs_
jim-on-linux wrote: On Friday 09 March 2007 12:04, Gigs_ wrote: Gigs_ wrote: I'm writing text editor. How to enable/disable (cut, copy etc.) when text is selected/not selected Btw it is cut copy ... in edit menu state = 'diabled' ## no change allowed

Re: tkinter how to write

2007-03-08 Thread Gigs_
James Stroud wrote: Gigs_ wrote: as I write my first gui program (text editor) I wanna ask you guys how to separate code in classes.? Should I put in one class my menu and in another class text and scorllbars etc? or something else? thanks Check out Grayson: http://www.manning.com

Tkinter menu

2007-03-07 Thread Gigs_
hi i have create widget with menu bar and menus on it. when i resize my widget to less than menubar is than from right to left menus on menubar goes to second row. who to disable that? all I want is that when i resize my widget to less size, that menus on menubar stays on default position .

tkinter how to write

2007-03-07 Thread Gigs_
as I write my first gui program (text editor) I wanna ask you guys how to separate code in classes.? Should I put in one class my menu and in another class text and scorllbars etc? or something else? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter menus

2007-03-02 Thread Gigs_
master is a reference to a Tk() or Toplevel(). Frames do not contain menus, but the windows that contain them do. This is the main reason why I always rant about examples of Tkinter programming creating windows by sub-classing Frame: frames are not windows. If you want to create a

tkinter what do you use?

2007-03-02 Thread Gigs_
list = Listbox() list.insert('end', x) list.insert(END, x) what do you use 'end' or END? -- http://mail.python.org/mailman/listinfo/python-list

django learn

2007-03-01 Thread Gigs_
HI folks! I want to learn to make web pages with django. I dont know nothing about HTML. How much of HTML I need to know to be able to learn django well? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Tkinter menus

2007-03-01 Thread Gigs_
class MenuDemo(Frame): def __init__(self, parent=None): Frame.__init__(self, parent) self.pack(expand=YES, fill=BOTH) self.createWidgets() def createWidgets(self): self.makeMenuBar() self.makeToolBar() L = Label(self, text='Menu and

pyopengl vs directpython

2007-02-28 Thread Gigs_
can someone tell me which is better for making 3d game in python. something like tennis simulation thx -- http://mail.python.org/mailman/listinfo/python-list

pyscripter

2007-02-28 Thread Gigs_
im using pyscripter ide it is all alright till the next def class Checkbar(Frame): def __init__(self, parent=None, picks=[], side=LEFT, anchor=W): Frame.__init__(self, parent) self.vars = [] for pick in picks: var = IntVar() chk =

Re: pyopengl vs directpython

2007-02-28 Thread Gigs_
thanks hey, is there any good tutorial for directpython? or maybe you could suggest me the book -- http://mail.python.org/mailman/listinfo/python-list

Tkinter checkbuttons and variables

2007-02-21 Thread Gigs_
from Tkinter import * states = [] def onpress(i): states[i] = not states[i] root = Tk() for i in range(10): chk = Checkbutton(root, text= str(i), command=lambda i=i: onpress(i)) chk.pack(side=LEFT) states.append(0) root.mainloop() print states after exiting i get

ocaml to python

2007-02-19 Thread Gigs_
Is there any way to convert ocaml code to python? but not manually thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter __call__

2007-02-17 Thread Gigs_
James Stroud wrote: Gigs_ wrote: James Stroud wrote: Gigs_ wrote: def printit(self, name): print name, 'returns =', demos[name]() I have tried but cant get it to work properly. I want to instead printit method to put __call__ and call it like that Can someone help me, please

Re: Tkinter __call__

2007-02-16 Thread Gigs_
John McMonagle wrote: Gigs_ wrote: from Tkinter import * from tkFileDialog import askopenfilename from tkColorChooser import askcolor from tkMessageBox import askquestion, showerror from tkSimpleDialog import askfloat demos = { 'Open': askopenfilename, 'Color': askcolor

Re: Tkinter __call__

2007-02-16 Thread Gigs_
James Stroud wrote: Gigs_ wrote: from Tkinter import * from tkFileDialog import askopenfilename from tkColorChooser import askcolor from tkMessageBox import askquestion, showerror from tkSimpleDialog import askfloat demos = { 'Open': askopenfilename, 'Color': askcolor

TKinter newbie

2007-02-15 Thread Gigs_
Hi Im new to gui programming from Tkinter import * # get widget classes from tkMessageBox import askokcancel # get canned std dialog class Quitter(Frame): # subclass our GUI def __init__(self, parent=None): # constructor

Tkinter __call__

2007-02-15 Thread Gigs_
from Tkinter import * from tkFileDialog import askopenfilename from tkColorChooser import askcolor from tkMessageBox import askquestion, showerror from tkSimpleDialog import askfloat demos = { 'Open': askopenfilename, 'Color': askcolor, 'Query': lambda: askquestion('Warning',

Re: Tkinter: how; newbie

2007-02-14 Thread Gigs_
jim-on-linux wrote: On Tuesday 13 February 2007 18:02, Gigs_ wrote: can someone explain me this code? from Tkinter import * root = Tk() def callback(event): print clicked at, event.x, event.y frame = Frame(root, width=100, height=100) frame.bind(Button-1, callback) frame.pack

pyscripter

2007-02-14 Thread Gigs_
How to change syntax color in pyscripter for python interpreter? I have change color in toolsoptionseditor options and everything is fine till restart pyscripter. After restart only in module is good syntax color, but in interpreter is back to default. thx --

Tkinter: how; newbie

2007-02-13 Thread Gigs_
can someone explain me this code? from Tkinter import * root = Tk() def callback(event): print clicked at, event.x, event.y frame = Frame(root, width=100, height=100) frame.bind(Button-1, callback) frame.pack() root.mainloop() well, my problem is at frame.bind(,Button-1, callback)

Re: Tkinter: how; newbie

2007-02-13 Thread Gigs_
Matimus wrote: How the callback function get this two number when it has only one argument (event)? It has one argument, event, which is an instance of a class that has both x and y attributes. print clicked at, event.x, event.y It doesn't accept the coordinates as separate parameters

default mutable arguments

2007-02-08 Thread Gigs_
I read that this is not the same: if arg is None: arg = [] arg = arg or [] def functionF(argString=abc, argList = None): if argList is None: argList = [] # this ... def functionF(argString=abc, argList=None): argList = argList or [] # and this

Re: List Behavior when inserting new items

2007-02-06 Thread Gigs_
[EMAIL PROTECTED] wrote: On Jan 29, 7:57 pm, Drew [EMAIL PROTECTED] wrote: I'm looking to add an element to list of items, however I'd like to add it at a specific index greater than the current size: list = [1,2,3] list.insert(10,4) What I'd like to see is something like: [1,2,3,,4]

Re: coping directories

2007-02-02 Thread Gigs_
Gabriel Genellina wrote: En Thu, 01 Feb 2007 21:33:03 -0300, Gigs_ [EMAIL PROTECTED] escribió: class CVisitor(FileVisitor): def __init__(self, fromdir, todir): self.fromdirLen = len(fromdir) + 1# here is my problem self.todir = todir FileVisitor

Re: coping directories

2007-02-02 Thread Gigs_
Gabriel Genellina wrote: En Thu, 01 Feb 2007 21:33:03 -0300, Gigs_ [EMAIL PROTECTED] escribió: class CVisitor(FileVisitor): def __init__(self, fromdir, todir): self.fromdirLen = len(fromdir) + 1# here is my problem self.todir = todir FileVisitor

Re: coping directories

2007-02-02 Thread Gigs_
Jussi Salmela wrote: Gigs_ kirjoitti: hi people I have problem with this example, not actually the problem, but [code] class FileVisitor(object): def __init__(self, data=None): self.context = data def run(self, startdir=os.curdir): os.path.walk(startdir

coping directories

2007-02-01 Thread Gigs_
hi people I have problem with this example, not actually the problem, but [code] class FileVisitor(object): def __init__(self, data=None): self.context = data def run(self, startdir=os.curdir): os.path.walk(startdir, self.visitor, None) def visitor(self, data,

os.mkfifo

2007-01-11 Thread Gigs_
is os.mkfifo available on windows xp thx -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitwise expression

2007-01-09 Thread Gigs_
Hendrik van Rooyen wrote: Gigs_ [EMAIL PROTECTED] wrote: Can someone explain me bitwise expression? few examples for every expression will be nice x y Left shift x y Right shift x y Bitwise AND x | y Bitwise OR x ^ y Bitwise XOR (exclusive OR) ~x Bitwise negation The short

find.find

2007-01-09 Thread Gigs_
import fnmatch, os def find(pattern, startdir=os.curdir): matches = [] os.path.walk(startdir, findvisitor, (matches, pattern)) matches.sort() return matches def findvisitor((matches, pattern), thisdir, nameshere): # for name in nameshere: if

Bitwise expression

2007-01-08 Thread Gigs_
Can someone explain me bitwise expression? few examples for every expression will be nice x y Left shift x y Right shift x y Bitwise AND x | y Bitwise OR x ^ y Bitwise XOR (exclusive OR) ~x Bitwise negation thanks people -- http://mail.python.org/mailman/listinfo/python-list

list looping error

2006-12-29 Thread Gigs_
i have created list x: x = [(12, 22, 11), (13, 22, 33)] and want to print each number in tuple for i in x: for j in i: print j[0] but I get this error. What does it means? Traceback (most recent call last): File pyshell#60, line 3, in module

Re: beginner, thread else

2006-12-15 Thread Gigs_
Fredrik Lundh wrote: did you write that yourself, or did you find it in some book or article? This is the example from programming python 2nd book, I use this just for learning -- http://mail.python.org/mailman/listinfo/python-list

beginner, thread else

2006-12-14 Thread Gigs_
can someone explain me this code: -- import thread stdoutmutex = thread.allocate_lock() exitmutexes = [0] * 10 def counter(myId, count): for i in range(count): stdoutmutex.acquire() print '[%s] = %s' % (myId, i) stdoutmutex.release()

Re: characters in python

2006-10-19 Thread Gigs_
I solve it. Just have to do another encoding: http://www.python.org/dev/peps/pep-0263/ -- http://mail.python.org/mailman/listinfo/python-list

Re: characters in python

2006-10-19 Thread Gigs_
Leo Kislov wrote: On Oct 18, 11:50 am, Stens [EMAIL PROTECTED] wrote: Stens wrote: Can python handle this characters: c,c,ž,d,š? If can howI wanna to change some characters in text (in the file) to the characters at this address: