Re: [Tutor] python logging module: two handlers writing to the samefile - okay?

2007-12-15 Thread Tiger12506
- Original Message - From: "Hans Fangohr" <[EMAIL PROTECTED]> To: Sent: Saturday, December 15, 2007 1:43 AM Subject: [Tutor] python logging module: two handlers writing to the samefile - okay? > I have an example program (test.py) and the logging configuration file > (log.conf) attache

Re: [Tutor] upper and lower case input for file name

2007-12-15 Thread Tiger12506
> "earlylight publishing" <[EMAIL PROTECTED]> wrote > >>I don't know if this'll help or not but I just learned about this: >> >> file = raw_input(info).lower > > file = raw_input(prompt).lower() # note the parens! > >> The .lower is supposed to convert any input to lower case. > > It will ind

Re: [Tutor] binary translator

2007-12-15 Thread Tiger12506
> > Hey i have created a program that turns a string into a binary one. But > when i began to test the program it turned out that it could not handle > some special characters (e.g ÆØÅ). Could someone please help me? These special characters have different values than those you have put into yo

Re: [Tutor] Something I don't understand

2007-12-18 Thread Tiger12506
> Below, "student_seats" is a list of the class "student". > > Why does this code set every student.row to zero when there is only one > student in the list with row > 5? > It still sets them all to zero if I change the test to ">200" when there > are > no student.rows > 200. > But if I change the

Re: [Tutor] Required method to make foo(*Vector(0,0,0)) work.

2007-12-18 Thread Tiger12506
> Sorry I wasn't quite sure how to explain it it's a vector class i've > written > myself. > I've worked it out now, I was using a vector as part of a quaternion and > wanted to > be able to pass a vector or individual numbers so it seemed the easiest > way > to be > able to use the *sequence syn

Re: [Tutor] Placing entire Application inside a class

2007-12-18 Thread Tiger12506
It is helpful for GUI applications because of what it says about halfway down the page, within __init__ you can bind certain messages to methods of the class. I would not say that it is recommended persé but I'm sure that there are those out there that cannot write a program without putting it

Re: [Tutor] Cant write new line at end of file append

2007-12-21 Thread Tiger12506
- Original Message - From: "dave selby" <[EMAIL PROTECTED]> To: "Python Tutor" Sent: Friday, December 21, 2007 12:03 PM Subject: [Tutor] Cant write new line at end of file append > Hi all, > > I need to write a newline at the end of a string I am appending to a > file. I tried ... > >

Re: [Tutor] Python Challenge 2

2007-12-21 Thread Tiger12506
>I did this and got this string :- > > "i hope you didnt translate it by hand. thats what computers are for. > doing it in by hand is inefficient and that's why this text is so long. > using string.maketrans() is recommended. now apply on the url" > Is that the answer because it does not solve th

Re: [Tutor] Regular Expression

2007-12-21 Thread Tiger12506
>I need to pull the highligted data from a similar file and can't seem to >get > my script to work: > > Script: > import re > infile = open("filter.txt","r") > outfile = open("out.txt","w") > patt = re.compile(r"~02([\d{10}])") You have to allow for the characters at the beginning and end too. Tr

Re: [Tutor] Py2Exe Tutorial

2007-12-24 Thread Tiger12506
>I am wondering if there is a good tutorial on Py2Exe and its functions? > I have not been able to find one. I have samples but that is not good > enough. It would be nice to have something explain all the functions for > including directories, modules and all that stuff when making an > execu

Re: [Tutor] How to stop a script.

2007-12-28 Thread Tiger12506
Ctrl+c will issue a KeyboardInterrupt which breaks out of programs such as the one you described. (The only situation it doesn't is when the program catches that exception. You won't see that 'til you get your sea legs ;-) ___ Tutor maillist - Tutor

Re: [Tutor] Learning about callbaks

2007-12-29 Thread Tiger12506
Callbacks are where you send python (or a library) a function which it can call(back). They are usually used to make things a little more generic. Here's a (trying to make it simple) example. example.py ### # These first three are callback functions (nothing special # is needed

Re: [Tutor] providing a Python command line within a Tkinter appl

2008-01-02 Thread Tiger12506
eval will seriously limit you in this instance because eval only works on expressions, not statements. (Assignment won't work, for example). You can use exec though. (in which case, you wouldn't necessarily want a result back) just fyi > text =my_get_pythoncommand() # text is the line of tex

Re: [Tutor] Tkinter OptionMenu question

2008-01-04 Thread Tiger12506
Try the .add_command(...) method. > Hello list! > > I was wondering if any of you could help me with this: > > I've got a small GUI connected to a SQLite DB. My OptionMenu pulls a > category list from the DB, and there's a field to add a new Category if > you > need to. Now, I'd like the have th

Re: [Tutor] Program review

2008-01-04 Thread Tiger12506
> This~~ works, but may be a little inefficient. Especially the double > addr.strip() here. Given, it doesn't really matter, but I like even better > Perhaps a use of sets here... particularly intersection somehow... Whoops, I'm not versed in sets (blush) I meant difference_update _

Re: [Tutor] Program review

2008-01-04 Thread Tiger12506
After quickly looking over the code, I find it has a good foundation, it seems to have been designed very solidly. I haven't looked very closely, but if the messages are mostly alike with just one or two slight differences, you might consider dynamically creating the messages (from a customer li

Re: [Tutor] Review and criticism of python project

2008-01-04 Thread Tiger12506
Cool! Code! (gullom voice - we must look at code, yesss) > Hi there. > > What this section area does is takes a data file that is comma separated > and > imports - there is a unique ID in the first field and a code in the second > field that corresponds to a certain section of information. Wh

Re: [Tutor] [tutor] Pil image related question -- resending messagewithout attachments

2008-01-07 Thread Tiger12506
I assume you realize that jpeg is a lossy format and that consecutively resizing the same image will no doubt end poorly in image quality. Also, I assume that you have a better understanding of the NEAREST and BICUBIC options than I do because you are apparently comparing them. I do know that thos

Re: [Tutor] classes and the deepcopy function

2008-01-07 Thread Tiger12506
> Hi > > I was trying to learn about classes in Python and have been playing > around but I am having a problem with the deepcopy function. I want to > have a function that returns a clean copy of an object that you can > change without it changing the original, but no matter what I do the > origin

Re: [Tutor] Review and criticism of python project

2008-01-07 Thread Tiger12506
> Tiger12506 wrote: > >> Ouch. Usually in OOP, one never puts any user interaction into a class. > > That seems a bit strongly put to me. Generally user interaction should be > separated from functional classes but you might have a class to help with > command line interact

Re: [Tutor] Scope and elegance

2008-01-07 Thread Tiger12506
I like this. class Counter: def __init__(self): self.score = 0 def incr(x, y): self.score += 2*x+3*y class Board: def __init__(self): self.counter = Counter() self.curcoords = (0,0) def update(self) self.counter.incr(*self.curcoords) Whatever OOP term is used to d

Re: [Tutor] Scope and elegance

2008-01-08 Thread Tiger12506
> Thanks Tiger12506! > > This has helped me understand the function(*tuple) syntax, as well as > providing me with a concrete example. > > James Cool. ;-) Here's another, totally unrelated to counters and boards. Kinda the opposite use of the * syntax I used earlier. def

Re: [Tutor] subclassing strings

2008-01-08 Thread Tiger12506
hould give an appropriate representation. The built-in string object does the equivalent of def __str__(self): return self def __repr__(self): return "'%s'" % self #Notice this will give extra single quotes around string No, you will not interfere with the internal representatio

Re: [Tutor] how to open a file using os.system

2008-01-09 Thread Tiger12506
> hi > > i am developing a GUI application using TKINTER > > i want to open a file from the askopenfile(which is a tkFileDialog) using > OS.SYSTEM. > > i have already created the file open dilog using > tkFileDialog.askopenfile(parent=root,mode='rb',title='choose a file') > Now i want to open a fil

Re: [Tutor] replacing CreateProcess command for Vista compatibility?

2008-01-10 Thread Tiger12506
> WindowsError: [Errno 193] %1 is not a valid Win32 application This line says that %1 is not a valid application. Windows uses %1 to mean the first argument on the command line to the program. Without seeing any code, it would be difficult to tell where this is being introduced, but the explan

Re: [Tutor] getting filen basename without extension

2008-01-11 Thread Tiger12506
I would always use the os functions to find the basename, but You could exploit the fact that Windows considers the extension to be whatever is after the last "." character. fn = fn[:fn.rfind(".")] >> > What I found is this: >> > import os >> > myfile_name_with_path = 'path/to/my/testfile.txt' >

Re: [Tutor] Why Won't My Pizza Fall?

2008-01-12 Thread Tiger12506
> Hey There Everyone, > > I'm following an example in a book and I can't find the error that's > preventing this program from running. It's just an example of how to get > a sprite moving. The images are all in the right folder. I can run the > program and get a stationary sprite to appear.

Re: [Tutor] Why Won't My Pizza Fall?

2008-01-14 Thread Tiger12506
[Background from Alan] > If some other factor were to determine its behhaviour more > closely - such as determining whether the Pizza was within > the coordinate boundaries or in collision with another Pizza > then that could be implemented via a message protocol. > Thus the context object should r

Re: [Tutor] Input

2008-01-15 Thread Tiger12506
Try regular expressions in the re module. This should make this code below much much simpler. Downside is you have to learn a slightly different syntax. Upside is - regular expressions are very powerful. > Last week someone had an issue with raw_input() and how to get input for > a number. So

Re: [Tutor] Input

2008-01-15 Thread Tiger12506
> Of course I know and use reg. exps., the point of the function is not to > validate input but to force the proper input. So? Are you going to try to tell me that you can force particular input without actually determining if its valid or not first? ;-) Just a thought. ___

Re: [Tutor] data structure question

2008-01-18 Thread Tiger12506
> > class Task(object): > def __init__(self, cargo, children=[]): > self.cargo = cargo > self.children = children > > def __str__(self): > s = '\t'.join(self.cargo) > return s > > def add_child(self,child): > self.children = self.children + [child] This is an excellent start. self.children = self

Re: [Tutor] Converting binary file date into a file?

2008-01-18 Thread Tiger12506
Many email clients encode attachments in base-64. I think there are standard modules in python which should be able to decode this. > Hi > > I made a small python program at home and tried to send by email > attachments > to my studymates. > The attachment however shows up as a strange text > >

Re: [Tutor] data structure question

2008-01-18 Thread Tiger12506
>def recursive_print(self, level=0): >print "\t"*level + self.cargo >for x in self.children: > recursive_print(x,level+1) Whoops. should be for x in self.children: x.recursive_print(level+1) ___ Tutor maillist - Tutor@

Re: [Tutor] Obssfurcatedpuytthonlessons nneeded

2008-01-19 Thread Tiger12506
>I aam writing some software which calls for some unreadable code in > it to let me secretly set a registration key- it is to be shareware. > > I know this can be done, but have not the foggiest clue of how todo it. > Any links, articles, pointers? This is impossible to do completely, and whil

Re: [Tutor] dictionaries, objects and scoping...

2008-01-22 Thread Tiger12506
Just a thought~ The built-in id() function can be useful in helping to sort out stuff. Returns a unique identifier for each object created so you can test whether a different name is a different object or just a different name for the same object. (This is what the 'is' operator does... Note:

Re: [Tutor] Projects (fwd)

2008-01-23 Thread Tiger12506
> up to a thousand (not tested) > > words = {0:'zero', 1:'one', 2:'two', 3:'three', ... , 10:'ten', > 11:'eleven', 12:'twelve', ..., 19:'nineteen', > 20:'twenty', , 90:'ninety', 100:'one hundred' } > def digitToString(n) : >try : >retStr = words[n] >except KeyError : >

Re: [Tutor] Projects (fwd)

2008-01-23 Thread Tiger12506
> This could be written much more efficiently. It can be done with only > these > lists~ > ones = > ['zero','one','two','three','four','five','six','seven','eight','nine'] > teens = > ['ten','eleven','twelve','thirteen','fourteen','fifteen','sixteen','seventeen','eighteen','nineteen'] What is it

Re: [Tutor] Projects (fwd)

2008-01-23 Thread Tiger12506
> Isn't dictionary access faster than list access? Why are three lists > 'much more efficient'? Oh no, no, no. Dictionaries are faster when you are *searching through* for a particular value. If you already know the index of the item in the list, lists are much faster. Dictionaries are hash ba

Re: [Tutor] [ctypes-users] calls to windll.user32

2008-01-24 Thread Tiger12506
> Something like this happens with Pygame and IDLE. In Windows if you > right click on a Python file and choose the "Edit with IDLE" option IDLE > is started with a single process. If the program is run and it does its > own windowing then it conflicts with Tkinter, used by IDLE. Start IDLE

Re: [Tutor] Projects (fwd)

2008-01-24 Thread Tiger12506
> Nope, if you read the code you'll see the only mapping done is up to 20 > and then by tens up to 100, that's all. > The same code could be used with a list, you'd only have to change the > exception name. I see. There were "..." in between each of the tens entries which I took to mean that "big

Re: [Tutor] (no subject)

2008-01-24 Thread Tiger12506
>Hi >i have been fooling around in python a bit and looked at a couple of >tutorials, but something i >wonder about: is it posible to make python make >an output in a windows "tekstbox" for >instance to make several adjustments >to my network settings at once, by running a python >program >and i

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

2008-01-24 Thread Tiger12506
>> I've had little experience with dos. I believe I should use the >> COMPACT, and then the MOVE dos command... Would >> it go something like this? > > You could use these but you'd be better just using Python > to do it via the shutil and os modules and avoid the DOS > commands completely IMHO.

Re: [Tutor] question about a number and bytes.

2008-01-29 Thread Tiger12506
> Hello there all. > > I have a need to make a hi byte and lo byte out of a number. > > so, lets say i have a number 300, and need this number to be > represented in two bytes, how do i go about that? First question. Why would you need to do this in python? Second question. If you could do that,

Re: [Tutor] [tutor]Imagechop error

2008-02-02 Thread Tiger12506
> Hello everyone, >I am tryin to use the imagechop module but i am not able to > implement it successfully. I want to compare two images and give the > resultant of the image using difference module. i am tryin to save the > resultant image. But i am getting some wierd error. It gives error

Re: [Tutor] Import error in UNO

2008-02-05 Thread Tiger12506
> "muhamed niyas" <[EMAIL PROTECTED]> wrote > >> Also i set 'C:\Program Files\OpenOffice.org 2.0\program' in PATH >> evvironment >> variable. > > Close but not quite. > You need to set the module folder in your PYTHONPATH environment > variable. > > PATH is where the python interpreter lives >

Re: [Tutor] Traversing python datatypes via http

2008-02-05 Thread Tiger12506
> Is it possible to traverse say python lists via http:// > > say there is a list in the memory > > can we traverse the list using list/next list/prev list/first list/last > > is there a pythonic library to do that? > > thanks That's a very unlikely request. There are a few ways to interpret this

Re: [Tutor] Hello and newbie question about "self"

2008-02-05 Thread Tiger12506
>> I probably won't need to start writing classes but I really want to >> finish the book before I start coding something. One of the greatest mistakes of my life was to completely finish a programming book before I started coding something. It is why I cannot write a Visual Basic program to thi

Re: [Tutor] Pixelize ubuntu python script acting odd.

2008-02-07 Thread Tiger12506
Some suggestions throughout > def runThrough(): >walk = os.walk("/media/sda1/Documents/Pictures/2007") #location of the > pics I want to use >count = 0 >for root, dirs, files in walk: >try: >for x in files: >if x.lower().find(".jpg")> -1: #If it's a

Re: [Tutor] Anyone fancy giving me some tips and an expert opinion??

2008-02-07 Thread Tiger12506
I'll throw in a couple of ideas, but I won't pretend to be an expert. ;-) >I have written what i see as a pretty decent script to resolve this > question: > > Write an improved version of the Chaos program from Chapter 1 that allows > a > user to input two initial > values and the number of iter

Re: [Tutor] designing POOP

2008-02-07 Thread Tiger12506
There's a couple of errors in here that no one has addressed yet because the question was geared towards programming style... So now I will address them. Or undress them, I suppose. ;-) > #!/user/bin/python > """ >>From the testing laboratory of: > b h a a l u u at g m a i l dot c o m > 2008-02-

Re: [Tutor] designing POOP

2008-02-08 Thread Tiger12506
> This is something that one can only gain from experience? > I really had to struggle to get the Light class to work at all. > I have no idea how many times I started over. But I do feel > that I am starting to learn some of this stuff. This surprises me... I guess it does take experience. What i

Re: [Tutor] Cobra

2008-02-08 Thread Tiger12506
It's dangerous posting something like this on a python website. ;-) It has definite strengths over python, it seems, and some things I do not like. Particularly interesting is the compilation directly to exe. Damn. I'm am seriously impressed with that. Cobra appears too new to learn and switch t

Re: [Tutor] designing POOP

2008-02-08 Thread Tiger12506
> There is nothing like growing a program to the point where you don't > know how it works or how to change it to make you appreciate good design Amen. I was recently fighting with an example of a multi-client, simple server that I wanted to translate into assembly. Not only was the code unreada

Re: [Tutor] Adding network play to an open source game.

2008-02-08 Thread Tiger12506
I wish to warn you that I've never done anything like this before, but I have a couple of thoughts here. First thought is, network games tend to be slow because sending state information to everyone with enough frames per second to make it decent game play is a lot of information to send... So t

Re: [Tutor] Change dictionary value depending on a conditionalstatement.

2008-02-10 Thread Tiger12506
>>> list = [] > >>> total = 0 > >>> if total > 0: > ... x = {'id': 'name', 'link': 'XX'} > ... list.append(x) > ... else: > ... y = {'id': 'name', 'link': 'YY'} > ... list.append(y) > ... > Yeah. list = [] x = {'id':'name'} if total > 0: x['link'] = 'XX' else: x['link'] = 'Y

Re: [Tutor] designing POOP

2008-02-11 Thread Tiger12506
> "bhaaluu" <[EMAIL PROTECTED]> wrote > >> States, getters-setters, direct access... >> I'm still in toilet-training here/ 8^D >> Can you provide some simple examples that >> illustrate exactly what and why there is any >> contention at all? One clear example I can think of that shows the view

Re: [Tutor] designing POOP

2008-02-12 Thread Tiger12506
>> This is all fine and dandy, but the video game is pretty worthless unless >> it >> can show us what the score is. There are two ways to go about this. A) >> Give >> the video game a display which it updates, or B) Tear open the case of >> the >> video game and look at the actual gears that in

Re: [Tutor] Closing file objects when object is garbage collected?

2008-02-12 Thread Tiger12506
> I'm having issues when I test my software on XP, but not Linux. When I > run the progam it fails after running for a while but not at exactly > the same point each time. It fails in one of two ways, the user > interface either completely disappears, or gives a OS error message > unhanded exceptio

Re: [Tutor] designing POOP

2008-02-14 Thread Tiger12506
> Hmm. Not to me. The second version couples the game state with the > display. I would rather have True... > This is an example of Model-View-Controller architecture (google it). > Notice that the Game and Display are now reusable (maybe there are both > GUI and text interfaces to the game, f

Re: [Tutor] read from standard input

2008-02-14 Thread Tiger12506
> while 1 < 2: while 1: or while True: is more common >x = raw_input() raw_input() always return a string, no matter what you type in. >if type(x) != int or x == 11: type(x) is always x can never be 11, but can possibly be '11'. (Notice quotes indicating string instead of integer) If

Re: [Tutor] designing POOP

2008-02-14 Thread Tiger12506
> Now I'm curious. > > MVC is one of the oldest, best established and well proven design > patterns going. It first appeared in Smalltalk in the late 1970's and > has been copied in almost every GUI and Web framework ever since. > I've used it on virtually(*) every GUI I've ever built(**) to the >

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

2008-02-16 Thread Tiger12506
> infile$ = "ad.txt" > outfile$ = "ad.csv" > infile=sys.argv[1] > outfile=sys.argv[1]+".csv" And these will give two different results. The QBasic version says "ad.txt" "ad.csv" whereas the python version will give "ad.txt" "ad.txt.csv" so you need to say infile = sys.argv[1] outfile = sys.arg

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

2008-02-16 Thread Tiger12506
> And here is my I got work for me in Python. > > === > === > import sys > infile=sys.argv[1] > outfile=sys.argv[1]+".csv" > > f1=open(infile) > f2=open(outfile, 'w') > > s2="" > > for line in f1: > s=line.strip() > if s=="": > continue > elif s==".block": > continue > elif s==".report": > continue

Re: [Tutor] How to deal with a thread that doesn't terminate

2008-02-20 Thread Tiger12506
Similar to the TerminateProcess function in win32api, there is the TerminateThread function which you can use if you know the handle of the thread, but it seems that you can only get the thread handle if you are calling from that thread, or if you were the one who created it (and saved the retu

Re: [Tutor] DATA TYPES

2008-02-20 Thread Tiger12506
> As I understand it python is not a strongly typed language so no > declaration > of variables is necessary. My question is this: > > If I use a variable in a program that stores certain numbers and I'm > porting > it to say ... java where I must first declare the variables before I use > them

Re: [Tutor] DATA TYPES

2008-02-20 Thread Tiger12506
> I was thinking more or less along the same lines, but > - you don't need the copy() Hehehe, did you try it Kent? > - locals is a dict mapping names to values, so something like > for name, value in locals().iteritems(): > print "varname: %s type: %s" (name,type(value)) And this returns

Re: [Tutor] results not quite 100 percent yet

2008-02-20 Thread Tiger12506
> As far as I can see, these routines give me the results > I'm looking for. I get a distribution of four negative numbers, > four positive integers in the range 10 to 110, and nothing > is placed in room 6 or room 11: I'll throw a couple of thoughts out there since I know that you appreciate to

Re: [Tutor] how to display terminal messages in dialog windowusingtkinter

2008-02-22 Thread Tiger12506
> If you literally want print statements to appear in a dialog then no, > you can't do that (so far as I know!). But if you want the Tkinter Alan??? Redirect standard output. It doesn't have to be a file object. It can be any object with a write method. _

Re: [Tutor] Truncate First Line of File

2008-02-27 Thread Tiger12506
This is bill's method written out in code which is the python you seek, young warrior! inname = 'inputfile' outname = 'outfile' infile = open(inname,'r') outfile = open(outname,'w') infile.readline() line = infile.readline() while line != "": outfile.write(line) infile.close() outfile.close()

Re: [Tutor] Python oddity

2008-02-27 Thread Tiger12506
Python lists are mutable. All mutable objects will behave in the fashion you described, whereas immutable objects -- tuples, integer, floats, etc. -- will behave in the fashion that you expect. This is because python keeps references to objects. When you say bb = aa, you are really saying, "Ta

Re: [Tutor] Python oddity

2008-02-28 Thread Tiger12506
> i'd like to know, too. my take so far is > > * don't make any copies if you can avoid doing so, > * make shallow copies if need be, > * make deep copies only if you can't think of any > other way to accomplish what you're up to. Yep. That's pretty much it, for space reasons, mostly. Imagine a li

Re: [Tutor] How to open IE7 to a certain URL?

2008-02-29 Thread Tiger12506
time.sleep is not exactly accurate, so I would suggest that you use this method, short 5 minutes or so and then do a sleep(10) or so in a loop to get closer to the time. >>import time >>b = '20:00:00' >> >>(bhour, bmin, bsec) = b.split(':') >>bsec = int(bsec) + int(bmin)*60 + int(bhour)*360 >>

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

2008-03-15 Thread tiger12506
> Considering the fact that choices[x] == x, shouldn't it be : > del choices[proxyq] choices = [9,2,1,3,6,4,7,8,5,0] for idx, x in enumerate(choices): print idx == x False False False True False False False False False False Not always. ___ Tutor

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

2008-03-16 Thread tiger12506
> choice() returns a random element from the list of choices, not its index. > One could call pop() instead of del, but del is probably a little faster, > and > doesn't return a value that we wouldn't use anyway. pop() wouldn't give > us a > random element, unless passed a random argument, such

Re: [Tutor] Calling super classs __init__?

2008-03-20 Thread tiger12506
>> class SubClass(BaseClass): >> def __init__(self, t, *args, **kw): >> super(SubClass, self).__init__(*args, **kw) >> # do something with t > Is there a proper way to handle the case when SubClass() is called using > positional arguments, and you do not desire "t" to be at th

Re: [Tutor] Help this newbie

2008-03-20 Thread tiger12506
This is Windows I presume? Try: cd\python25 python C:\Elliot\filename.py But for windows you shouldn't have to. You can just double-click the file. On the other hand, if you mean 'import' as it means in the context of the actual python language, then you would put the line "import filename" at

Re: [Tutor] Calling super classs __init__?

2008-03-20 Thread tiger12506
Woah. Either you're leaving out essential info, or python got a lot more complicated. Firstly, super returns all base classes. How? Does it return a tuple of them, or a container object, or is this something horribly worse such as syntactic sugar? It doesn't make sense for it to return a tuple

Re: [Tutor] Calling super classs __init__?

2008-03-21 Thread tiger12506
of super... was it there in previous versions of python? - Original Message - From: "Andreas Kostyrka" <[EMAIL PROTECTED]> To: "tiger12506" <[EMAIL PROTECTED]> Cc: Sent: Friday, March 21, 2008 4:25 AM Subject: Re: [Tutor] Calling super classs __init__?

Re: [Tutor] Little problem with math module

2008-04-21 Thread tiger12506
my problem is, INSIDE the funcion...the variable erro is correct, but when i return it to the test...and the test prints itcomes out 0.0. Its disturbing...i didnt found a way of solving this. err is defined in the function so it thinks it's a local variable. You can set it to change only th

Re: [Tutor] Why next vs. __next__ ?

2008-04-21 Thread tiger12506
It's actually considered a mistake. The original rationale is spelled out in PEP 234 - see the Resolved Issues section: http://www.python.org/dev/peps/pep-0234/ It is being renamed to __next__() in Python 3.0 and there will be a builtin next() method that calls it. Instead of iterator.next()

Re: [Tutor] Little problem with math module

2008-04-21 Thread tiger12506
ing global erro and then using modulename.erro when he uses the actual value. - Original Message - From: "Kent Johnson" <[EMAIL PROTECTED]> Cc: Sent: Monday, April 21, 2008 9:33 PM Subject: Re: [Tutor] Little problem with math module tiger12506 wrote: my probl

Re: [Tutor] seeking help to a problem w/ sockets

2008-04-27 Thread tiger12506
How is the window being closed? By someone forcing it to close? Or terminating the process? If someone is just closing the window you can setup an atexit handler that will close the socket before it finishes. However, if the process is being terminated, then you will have to use one of the other

<    1   2