Re: curses and refreshing problem

2008-12-14 Thread Karlo Lozovina
me.sleep(1) > sys.stdout.write("\nFinised!\n") Thanks, that's it! I just assumed wget uses curses for the progress bar, so the carriage return didn't even cross my mind ;). -- ___Karlo Lozovina - Mosor | | |.-.-.

curses and refreshing problem

2008-12-13 Thread Karlo Lozovina
this with curses? Thanks... -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.o

Re: Bind compiled code to name?

2008-06-22 Thread Karlo Lozovina
" syntax. One more thing though, is there a way to access "some_name" as a attribute, instead as a dictionary: some_name = d.some_name ? Thanks... -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || IC

Bind compiled code to name?

2008-06-22 Thread Karlo Lozovina
t clear, this is what I'm trying to do. I want to emulate this: import some_module as some_name but with my code in `some_module` string, and not in file. Thanks... -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://w

Re: Can this be done with list comprehension?

2008-06-07 Thread Karlo Lozovina
_list] Are there any other alternatives to this approach? -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Can this be done with list comprehension?

2008-06-07 Thread Karlo Lozovina
as to be done in one line ;). -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Karlo Lozovina
ch, I think I'll use something like that for avoding infinite loops. Thanks a lot... -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning to 'try' block after catching an exception

2008-05-22 Thread Karlo Lozovina
doing this kind of try-except loop. -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning to 'try' block after catching an exception

2008-05-21 Thread Karlo Lozovina
Sure, that works, but I was aiming for something more elegant and Pythonic ;). -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata

Returning to 'try' block after catching an exception

2008-05-21 Thread Karlo Lozovina
r executing some_function() exception SomeExcpetion gets risen. Then, in except block I do something to fix whatever is causing the exception and then I would like to go back to try block, and execute some_function() again. Is that doable? Thanks. -- ___

Re: Returning values from function to Python shell/IPython

2008-03-09 Thread Karlo Lozovina
me, so I was wondering if there was an alternative... Anyway, thanks for your answer ;). -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Returning values from function to Python shell/IPython

2008-03-09 Thread Karlo Lozovina
cts available in the interpreter. -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Re: Order of evaluation in conditionals

2008-02-25 Thread Karlo Lozovina
> The expression 'x and y' first evaluates x; if x is false, its value > is returned; otherwise, y is evaluated and the resulting value is > returned. Thanks (to both of you :>), that's it. -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Order of evaluation in conditionals

2008-02-25 Thread Karlo Lozovina
ious about this ;). Thanks... -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphical Engine

2007-11-09 Thread Karlo Lozovina
results, but then again I'm > probably missing something. http://www.ogre3d.org/wiki/index.php/PyOgre -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Re: Keeping track of subclasses and instances?

2007-10-10 Thread Karlo Lozovina
, my question is how to keep track of subclasses and their instances, without the need for user interaction (appending them to a list, or adding to dictionary)? Thanks, -- Karlo Lozovina - Mosor -- http://mail.python.org/mailman/listinfo/python-list

Keeping track of subclasses and instances?

2007-10-10 Thread Karlo Lozovina
Hi, what's the best way to keep track of user-made subclasses, and instances of those subclasses? I just need a pointer in a right direction... thanks. -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Dynamically creating class properties

2007-10-04 Thread Karlo Lozovina
int a.getitem1 Any idea how to do that with metaclasses and arbitrary long list of attributes? I just started working with them, and it's driving me nuts :). Thanks for the help, best regards. -- Karlo Lozovina -- Mosor -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic question

2007-05-12 Thread Karlo Lozovina
Cesar G. Miguel wrote: > - > L = [] > file = ['5,1378,1,9', '2,1,4,5'] > str='' > for item in file: >j=0 >while(j while(item[j] != ','): > str+=item[j] > j=j+1 >if(j>= len(item)): break > > if(str != ''): >L

Re: Dynamic subclassing ?

2007-05-12 Thread Karlo Lozovina
manatlan wrote: > I can't find the trick, but i'm pretty sure it's possible in an easy > way. It's somewhat easy, boot looks ugly to me. Maybe someone has a more elegant solution: In [6]: import new In [13]: class Button: : def buttonFunc(self): : pass In [14]: cla

Re: Basic question

2007-05-12 Thread Karlo Lozovina
Cesar G. Miguel wrote: > for j in range(10): > print j > if(True): >j=j+2 >print 'interno',j > > What happens is that "j=j+2" inside IF does not change the loop > counter ("j") as it would in C or Java, for example. > Am I missing something? If you want that kind of behaviour

Re: How to copy a ClassObject?

2007-03-21 Thread Karlo Lozovina
ple, it was the first thing to come to mind. The idea behind all of this was to create classes dynamicaly, without knowing in advance their names, or base class(es). So I figured I'd just copy the base class and modify the attributes. Instead, this way of subclassing seems to work just right for

Re: How to copy a ClassObject?

2007-03-20 Thread Karlo Lozovina
Karlo Lozovina <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > how would one make a copy of a class object? Let's say I have: > class First: > name = 'First' > > And then I write: > tmp = First Silly me, posted a question without Googling

How to copy a ClassObject?

2007-03-20 Thread Karlo Lozovina
x27;tmp' a copy of First, I tried using copy.copy and copy.deepcopy, but that doesn't work. P.S. Yes, I can do a: class tmp(First): pass but I'd rather make a copy than a subclass. Thanks. -- ___Karlo Lozovina - Mosor |

Tip: 'Open IPython here' in Windows context menu

2007-02-26 Thread Karlo Lozovina
place tcmd.exe path, with cmd.exes'. Hope this will be usefull to someone... -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: What is more efficient?

2007-02-19 Thread Karlo Lozovina
hanks, to you and all the others. -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

What is more efficient?

2007-02-18 Thread Karlo Lozovina
esn't matter? Thanks... -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailma

SQLAlchemy, py2exe and Python 2.5 problem?

2006-12-18 Thread Karlo Lozovina
t has no attribute 'getLogger' Does anyone have a clue why this happens? And what is responsible for this? SQLAlchemy, or py2exe? Thanks in advance... -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: wing ide vs. komodo?

2006-11-05 Thread Karlo Lozovina
ur code end then you can inspect all of the structures via Stack Data, and you can play with those structures using Debug Probe. Huge productivity boost... -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mos

Forum written in Python?

2006-11-02 Thread Karlo Lozovina
e are existing projects out there, I wouldn't mind contributing. So far I found out about Pocoo, but it seems to immature right now, I was looking for something comparable to PhpBB or IPB? -- ___ Karlo Lozovina - Mosor | | |.-.-. web:

SQLAlchemy and py2exe

2006-10-20 Thread Karlo Lozovina
e other packages? Thanks guys... -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

MP3 files and Python...

2006-10-10 Thread Karlo Lozovina
I'm looking for a Python lib which can read and _write_ ID3v1 and ID3v2 tags, and as well read as much as possible data from MP3 file (size, bitrate, samplerate, etc...). MP3 reproduction is of no importance... -- ___ Karlo Lozovina -

Why aren't these more popular (Myghty & Pylons)?

2006-04-15 Thread Karlo Lozovina
m people (if there are such) using it in real world applications... -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: print without newline "halts" program execution

2006-04-15 Thread Karlo Lozovina
emical purposes, what are those other ways to do it? I'm curious :). -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

print without newline "halts" program execution

2006-04-13 Thread Karlo Lozovina
it to print parts as it's finished with them. Using sys.stdout.write() produces the same behavior, so what can I do? Thanks a lot in advance. -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163

Re: Why optparse wont import?

2006-01-20 Thread Karlo Lozovina
Jorge Godoy <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rename your file to something other than optparse.py... Oh my :(... I'm so ashamed :). -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mo

Why optparse wont import?

2006-01-20 Thread Karlo Lozovina
\source\python\population\optparse.py", line 1, in ? from optparse import OptionParser ImportError: cannot import name OptionParser When I try to do that from Python prompt everything works fine. What's the problem? -- ___ Karlo Lozovina - Mosor |

Re: What's wrong with this code snippet?

2006-01-05 Thread Karlo Lozovina
anyway, thank you. -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with this code snippet?

2006-01-04 Thread Karlo Lozovina
ome "random" choices to be made, so I didn't dig much into random module. Anyway, thanks for pointing this out, appreciated. -- ___Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | ||

Re: What's wrong with this code snippet?

2006-01-04 Thread Karlo Lozovina
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Class methods must have at least the 'self' argument. So Argh! :) Thanks guys! -- ___ Karlo Lozovina - Mosor | | |.-.-. web

What's wrong with this code snippet?

2006-01-04 Thread Karlo Lozovina
rror: GenerateRandomColour() takes no arguments (1 given) --- If I remove GenerateRandomColour from class definition, and put it as a separate function, everything works fine. I've been staring at this code for half an hour and can't find what's wrong :(. Any help greatly appriciat

Work with Windows workgroups under Python?

2006-01-02 Thread Karlo Lozovina
less Pythonic way? Thanks... -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/ma

Re: Flat file, Python accessible database?

2005-11-01 Thread Karlo Lozovina
files, so this will speed me up :). -- ___ Karlo Lozovina - Mosor | | |.-.-. web: http://www.mosor.net || ICQ#: 10667163 | || _ | _ | Parce mihi domine quia Dalmata sum. |__|_|__||_|_| -- http://mail.python.org/mailman/listinfo/python-list

Flat file, Python accessible database?

2005-11-01 Thread Karlo Lozovina
e. Oh, and I'm using Python under Cygwin. Ofcourse, ease of use and simplicity is most welcomed :). I'm currently playing around SQLite+PySQLite and BerkeleyDB, but those two seem like an overkill :(. Thanks in advance... -- ___ Karlo L