Python deployment options.

2006-11-08 Thread king kikapu

Hi to all folks here,

i just bought a book and started reading about this language.
I want to ask what options do we have to deploy a python program to
users that do not have the labguage installed ??

I mean, can i make an executable file, or something that contains the
runtime and the modules that the program only use or am i forced to
download the language to the user machine so the .py  files can be run
??

Thanks in advance,

king kikapu

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python deployment options.

2006-11-08 Thread king kikapu

I see...So, if these are the only options, the only "safe" bet is to
install the language on the machine (beeing Win, Linux or Mac)
and execute the .py files, right ??


On Nov 8, 1:24 pm, "Chris_147" <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > Hi to all folks here,
>
> > i just bought a book and started reading about this language.
> > I want to ask what options do we have to deploy a python program to
> > users that do not have the labguage installed ??
>
> > I mean, can i make an executable file, or something that contains the
> > runtime and the modules that the program only use or am i forced to
> > download the language to the user machine so the .py  files can be run
> > ??
>
> > Thanks in advance,
>
> > king kikapuWell, on Windows you have to look for the Py2Exe package
> (www.py2exe.org)
> On Mac OS X you can use Py2App
> (http://undefined.org/python/py2app.html)
>
> Mind you, on Windows there is one big potentional problem: Python is
> compiled with Visual Studio 2003 and needs msvcr71.dll.  So Py2Exe
> wants to distribute that dll also, but if you don't have a valid Visual
> Studio license, you are not allowed to.
> It is explained further in this 
> thread:http://groups.google.com/group/comp.lang.python/browse_frm/thread/bcc...
>
> I doubt Microsoft will unleash their lawyers on you, but it is a
> problem.

-- 
http://mail.python.org/mailman/listinfo/python-list


Python visual IDE

2006-11-22 Thread king kikapu

Hi to all,

i am not sure if this question really belongs here but anyway, here it
goes: I have seen a lot of IDEs for Python, a lot of good stuff but
actually none of them has what, for example, Visual Studio has: a
Visual Editor (with the  ability to place controls on forms etc etc),
or RAD

I know that there is Glade but does anybody knows of some product, or
an ongoing effort to this direction so i can have a look at ?

Coming from Windows and vs.net world, i think the only missing point
here is the integration of the Pyrthon with a RAD IDE...

Thanks a lot and i apologize if this isn't the correct place for this
question...


Kikapu

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python visual IDE

2006-11-22 Thread king kikapu

hmmm,,,ok, i see your point.
As i understand it, as a newcomer, it is a little cumbersome to right
the code in one ide,
"glue" the UI from another toll and all that stuff.

I know it works but if someone is coming from VS.Net, it seems a little
strange, at first.

I also saw that the wxWidgets is the more "feel natural" in all
platforms so i
believe that if an IDE is able to offer RAD capabilities and build upon
this
widget, it will be an awesome tool for Python programmers,
matches this way VS and other win RAD IDEs...

Thanks a lot for your post, i'll have a look at the programs you
mention!

King Kikapu

On Nov 22, 2:09 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > Hi to all,
>
> > i am not sure if this question really belongs here but anyway, here it
> > goes: I have seen a lot of IDEs for Python, a lot of good stuff but
> > actually none of them has what, for example, Visual Studio has: a
> > Visual Editor (with the  ability to place controls on forms etc etc),
> > or RAD
>
> > I know that there is Glade but does anybody knows of some product, or
> > an ongoing effort to this direction so i can have a look at ?
>
> > Coming from Windows and vs.net world, i think the only missing point
> > here is the integration of the Pyrthon with a RAD IDE...
>
> > Thanks a lot and i apologize if this isn't the correct place for this
> > question...If you use wxWidgets, you may want to have a look at projects 
> > like
> Boa-constructor or PythonCard. If you use QT/KDE, Eric3 offers good
> integration with QT Designer IIRC.
>
> Now as you can see, the problem with RAD tools is that they are specific
> to a given GUI toolkit. Python runs on a lot of platforms, and some of
> these platforms (ie Linux) are not tied to a specific GUI toolkit. So
> integrating the RAD tool in the IDE means you can't use this IDE with
> other GUI toolkits.
>
> Also, there's a tradition in the *n*x world about preferring small,
> highly specialized tools over huge monolithic do-it-all applications. As
> an example, I daily use half a dozen languages, and I wouldn't like to
> have to learn half a dozen IDEs. I'm much more productive with a good
> code editor, the command line, and a few external tools when needed.
>
> My 2 cents...
> --
> bruno desthuilliers
> python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
> p in '[EMAIL PROTECTED]'.split('@')])"- Hide quoted text -- Show quoted text -

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python visual IDE

2006-11-22 Thread king kikapu

I have already downloaded and seen the trial of Komodo Professional.
Indeed it has a simple Gui Builder but one can only use TKinter on it.
No wxWidgets support and far from truly RAD, but it is the only
"integrated"
GUI builder in these IDEs...


On Nov 22, 4:31 pm, "Steve" <[EMAIL PROTECTED]> wrote:
> I haven't used it but Komodo (Professional version) says it has:
>
> ActiveState GUI Builder (Komodo Professional only)
>
> Enhance your applications with GUI dialogs: Simple, Tk-based dialog
> builder with seamless round-trip integration, for Perl, Python, Ruby,
> and Tcl.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python visual IDE

2006-11-22 Thread king kikapu

I didn't know about this product you mention (wxDesigner).
I download the trial and it seems pretty good, reminds me the wxGlade.

So you make the GUI in this, generate Python code and import the module

on your main project and reference it respectively ??

On Nov 22, 4:58 pm, hg <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > I have already downloaded and seen the trial of Komodo Professional.
> > Indeed it has a simple Gui Builder but one can only use TKinter on it.
> > No wxWidgets support and far from truly RAD, but it is the only
> > "integrated"
> > GUI builder in these IDEs...
>
> > On Nov 22, 4:31 pm, "Steve" <[EMAIL PROTECTED]> wrote:
> >> I haven't used it but Komodo (Professional version) says it has:
>
> >> ActiveState GUI Builder (Komodo Professional only)
>
> >> Enhance your applications with GUI dialogs: Simple, Tk-based dialog
> >> builder with seamless round-trip integration, for Perl, Python, Ruby,
> >> and Tcl.I do a lot of GUI programming with wxPython.
>
> I find that switching from desktop 1 (Eclipse/PyDev) to desktop 2
> (wxDesigner) becomes a reflex quite quickly ... even under Windows
> thanks to virtuawin (http://virtuawin.sourceforge.net) - both packages
> also are smart enough to notice when an open file has been modified
> elsewhere.
>
> I also program in Visual-Studio and overall do not find the RAD/IDE
> integration that much more convenient.
>
> Also, I generally get the job done in wxDesigner at the beginning of the
> project, and seldom have to get back into it to twick the interface.
> 
> hg- Hide quoted text -- Show quoted text -

-- 
http://mail.python.org/mailman/listinfo/python-list


decorators question

2006-12-04 Thread king kikapu
Hi,

i am new to python and i have a question about how decorators are
working.
I have understand HOW they do their magic but i am trying to figure out

WHEN they do it...

I have the following simple example:

#-
def author(author_name):
def decorator(func):
func.author_name = author_name
return func
return decorator

@author("some author")
def F():
pass

# print F.author_name
#-


I am using Eclipse/PyDev and when i run this snippet from the PyDev
debugger,
i see that even though i do not call F() (or reference F.author_name),
the decorator and all this stuff is executed and updates F.autor_name
variable.

How is this thing really working ??
I mean, if we run this .py file (pythn test.py) from the command
prompt,
what the runtime will do, even if we do not have ane commands to
execute, only functions
as above ?

It will load all the module, all the functions and when it sees that
some function(s) are decorating, then it will start execute respectives
decorators ?
And this will do it for all decorated functions ?? Even if we do not
have any references to these functions ?

Shouldn't this code called when we actually DO call it ?


Thanks a lot for any enlightment on this,


objectref

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: decorators question

2006-12-04 Thread king kikapu
>  def func():
>  pass
>
> is *exactly* the same thing as:
>
>  def func():
>  pass
>  func = decorator(func)

Yes, i know that but i thought that it is so when I call the function,
not when the runtime just loads the module...



>Python calls the decorator, not the decorated function.


Hmmm...ok...it calls the decorator but when ?? It (the runtime) loads
the .py file and start to call every decorator
it finds on it, regardless of the existance of code that actually calls
the decorated functions ??
I understand thet Python does not call the decoratated functiond but it
ends up this way...


>
> additional reading:
>
>  http://www.python.org/doc/2.4.4/whatsnew/node6.html
>  http://www.python.org/dev/peps/pep-0318
>
> and the relevant chapters in the tutorial and the language reference.
> 

I will have a lokk also thera, thanks!

> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: decorators question

2006-12-04 Thread king kikapu

At first, i am coming from another (language) programming world (C#
mainly) and i hope you understand my wonders.

Ok then, you tell me that the interpreter always execute the code in a
module...If there are only def declarations in the module and no code
to invoke them it does not execute anything. It must have a body (a
call to a(some) method(s)) so it can execute something, right ??

In Soni's example (Soni thanks for the code), it indeed prints "called
foo" but if i remove the @foo statement,
as i see right now in the debugger, it does not execute anything.

I recap: if i put only functions declarations on a .py file, like
these:
def A(): print "a"
def B(): print "b"
def C(): print "c"

and run the program, nothing happens, nothing executed. I have to put a
statment like print A() or b() to cause code execution.

But if i simple declare a decorator for one function, like the one that
Soni gave me, then it caused the deco function to execute. Why is that
??


On Dec 4, 9:46 pm, Soni Bergraj <[EMAIL PROTECTED]> wrote:
> There was a copy-and-paste error with my last message. Better try this
> for foobar.py:
>
> def foo(f):
> print "called foo"
> return 'some text'
> @foo
> def bar():
> print "called bar"
> 
> --
> Soni Bergrajhttp://www.YouJoy.org/

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: decorators question

2006-12-05 Thread king kikapu
>you're not listening.  

Be sure that i do...The fact that i come from another world does not
mean that i am not listening, just that i find as strange some (new)
things.
Thank you all guys, i know what is happening now...

Thanks again!

kikapu

-- 
http://mail.python.org/mailman/listinfo/python-list


Property error

2006-12-14 Thread king kikapu
Hi to all,

i am trying to use properties in Python and i am sure i have made
something wrong with the below code but i just cannot see what it is.

Can anyone please help me on this ?

The code is :

class Person(object):
age = 0

@property
def age():
def fget(self):
return self.age
def fset(self, value):
self.age = value

me = Person()
me.age = "34"
print me.age


and i am getting the error:

"  File "C:\projects\Python\p2.py", line 12, in 
me.age = "34"
AttributeError: can't set attribute "

What exactly i am doing wrong ??

Thanks a lot in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Property error

2006-12-15 Thread king kikapu
>What version of Python? Most recent versions don't need the

Hi, thanks for the help!

I am using 2.5 version and i think i like more the @property decorator
instead of the property(...) syntax. Is the code changing much using
@property ??

Thanks again!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Property error

2006-12-15 Thread king kikapu

Your example Dennis, work as expected. I understand the mistake i have
made. But when i try to fix the original code usihn @property now, it
gives me the same error.
So, here it is:

class Person(object):
_age = 0

@property
def age():
def fget(self):
return self._age
def fset(self, value):
self._age = value

me = Person()
me.age = 34
print me.age


I am sure it is something very obvious but my skills does not (yet)
enable me to figure this out,,,

-- 
http://mail.python.org/mailman/listinfo/python-list


db access

2006-12-28 Thread king kikapu
Hi to all,

is there a way to use an RDBMS (in my case, SQL Server) from Python by
using some built-in module of the language (v. 2.5) and through ODBC ??
I saw some samples that use statements like "import dbi" or "import
odbc" but neither modules (dbi, odbc) are present on my system...

Any hint(s) ??

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: db access

2006-12-28 Thread king kikapu

Hey Martin,

thanks for the fast reply!

I have already seen that link and i just downloaded the pyodbc module
but isn't Python already containing a "built-in" odbc module so to
allow for db communication ??

On Dec 28, 6:06 pm, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > Hi to all,
>
> > is there a way to use an RDBMS (in my case, SQL Server) from Python by
> > using some built-in module of the language (v. 2.5) and through ODBC ??
> > I saw some samples that use statements like "import dbi" or "import
> > odbc" but neither modules (dbi, odbc) are present on my system...
>
> > Any hint(s) ??
>
> > Thanks in advanceHey there,
>
> Take a look at this:http://www.python.org/doc/topics/database/
> 
> Cheers,
> 
> --
> mph

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: db access

2006-12-29 Thread king kikapu

Hi Johnf,

are you referring to this ?
http://www.freetds.org/

And how i can get psmssql.py so i can get a shot on it, is it included
in FreeTDS ??



On Dec 29, 12:12 am, johnf <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > Hi to all,
>
> > is there a way to use an RDBMS (in my case, SQL Server) from Python by
> > using some built-in module of the language (v. 2.5) and through ODBC ??
> > I saw some samples that use statements like "import dbi" or "import
> > odbc" but neither modules (dbi, odbc) are present on my system...
>
> > Any hint(s) ??
>
> > Thanks in advanceAlthough others have suggested using ODBC or ADO I have a 
> > different
> solution.  If you wanted a multi-platform I would use FreeTDS with
> psmssql.py.  psmssql.py does support the DB API 2.0 although it does not
> support any of the extendsions.  Works with Linux, Mac and Windows.
> 
> Johnf

-- 
http://mail.python.org/mailman/listinfo/python-list


program deployment

2007-01-05 Thread king kikapu
hi to all folks here,

i am learning Python, just finished a book and i am starting to write
programs.
I just want to ask, is the "correct" way to deploy my programs to other
computers, the .pyc files ??

I now that with the "-m compileall ." switch can compile a .py file
into bytecodes. So i suppose that if Python has to run a .pyc file, it
will load and execute it faster. And if i have some "sensitive" data in
my source, like passwords (and the source of cource!) they will be more
secure in a compiled file.

Is that correct ?

Thanks a lot for any help!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: program deployment

2007-01-05 Thread king kikapu
> Python code is normally deployed as straight source code.

But isn't this a problem of its own ?? I mean, many people do not feel
good if the know that their source code is lying around on other
machines...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: program deployment

2007-01-05 Thread king kikapu


> > Are they embarassed by their code?

hehehe...no, just worried about stealing their ideas...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: program deployment

2007-01-05 Thread king kikapu
> Under Windows, I ususally use py2exe+inno-setup.

Xmmm...i have downloaded this and try a (very) simple project and it is
working great.
Of your experience, does it also working great when you have more
complex solutions,
e.x. many 3rd party modules like wxWidgets and so ??

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: program deployment

2007-01-05 Thread king kikapu
Ok, i got the point...Things are a little bit different on the other
way of the fence (Microsoft way...) and so many of Python's elements
are a little (at least) strange at first...

But hey, thank you all!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: program deployment

2007-01-05 Thread king kikapu


> Of course you do not distribute .cs (or .vb) files when deploying your
> application, but decompilers for .NET are plenty. Same for Java.

Yes, but in .Net we have some strong dotfuscators that makes reverse
engineer really difficult.
In any way, it is not so easy to get to the source as .py files is.

-- 
http://mail.python.org/mailman/listinfo/python-list


About installing new Python version.

2007-04-19 Thread king kikapu
Hi to all,

i started with Python at v2.5 and now i see that a new version is
released.
As i already have a lot of stuff for Python installed in the site-
packages directory, which is the correct way to install a new Python
version without do any damage ?

Remove Python and ALL Python related software and install them all
over again (painful)?
Remove Python and do not touch anything else and install new version
on top of them at the same directory ?
Any other choice available ?

Thanks a lot for any help!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About installing new Python version.

2007-04-19 Thread king kikapu
On Apr 19, 11:39 am, [EMAIL PROTECTED] wrote:
> On Apr 19, 2:03 am, king kikapu <[EMAIL PROTECTED]> wrote:
>
> > Hi to all,
>
> > i started with Python at v2.5 and now i see that a new version is
> > released.
> > As i already have a lot of stuff for Python installed in the site-
> > packages directory, which is the correct way to install a new Python
> > version without do any damage ?
>
> > Remove Python and ALL Python related software and install them all
> > over again (painful)?
> > Remove Python and do not touch anything else and install new version
> > on top of them at the same directory ?
> > Any other choice available ?
>
> > Thanks a lot for any help!
>
> Just install the new version. It should link everything back up so the
> new version is active, but the old versions are intact.
>
> ~Sean

I installed 2.5.1 and as the installer said, it have replaced my old
installation with the new one, something like i wanted to do! So i
checked and everything seems to working fine. But this is an update
release to 2.5, i do not know what is happening when, for example, a
totally new Python version come out, like 2.6 or 2.7 or...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About installing new Python version.

2007-04-19 Thread king kikapu
On Apr 19, 12:10 pm, Ant <[EMAIL PROTECTED]> wrote:
> > checked and everything seems to working fine. But this is an update
> > release to 2.5, i do not know what is happening when, for example, a
> > totally new Python version come out, like 2.6 or 2.7 or...
>
> Again just install it - it will by default install alongside Python
> 2.5 in a different directory, and set itself as the default python
> version. You'll then need to update all your third party extensions to
> ones compiled against the new version - so if you have a lot of these,
> it makes sense to wait a while before upgrading.
>
> --
> Ant.

Hmm...ok, i was sure that i wouldn't avoid that...The nice thing is
that 2.5.1 installed in default directory so no problem for now.
Thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About installing new Python version.

2007-04-19 Thread king kikapu
On Apr 19, 1:51 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> Good question. kk is right - with a change in *major* version (such as
> 2.4 to 3.5, 3.5 to 3.6) the compiled extensions will be incompatible,
> and will need to be recompiled. This can take a while, as extension
> authors frequently have other things to do besides maintain their
> extensions.
>
> As you have found out, though, when only the *minor* version changes you
> can just frop the new version in over the old and all your installed
> extensions and packages continue to work just fine.
>
> regards
>   Steve
> --
> Steve Holden   +44 150 684 7255  +1 800 494 3119
> Holden Web LLC/Ltd  http://www.holdenweb.com
> Skype: holdenwebhttp://del.icio.us/steve.holden
> Recent Ramblings  http://holdenweb.blogspot.com

Thanks Steve, it is just the way i understood this, after seeing what
the installer did.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 32 OS on 64-bit machine

2007-05-03 Thread king kikapu
I have at home an AMD Turion 64 and using Ubuntu. You may be
interested on this, i will post here the results when i get back home!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 32 OS on 64-bit machine

2007-05-03 Thread king kikapu
At Amd Turion 64, it gives:

('32bit', 'ELF')

-- 
http://mail.python.org/mailman/listinfo/python-list


Gui thread and async jobs.

2007-05-08 Thread king kikapu
Hi, i am reading the book "Python Cookbook, 2nd edition" and i
encountered a very handy recipe, the one that is called "Combining
GUIs and Asynchronous I/O with Threads"

It is talking about retain a main GUI thread, doing async work with
worker threads and have both talk through a Queue object to dispatch
their messages, so the main (GUI) thread remain responsive.
It has a very good example by using Tkinter and Qt that is indeed
working. The only point that make me wonder is that the QUI thread has
to use some polling to check for messages in the Queue.

Author said that another alternatives exists (by not doing polling)
but the complexity makes them non-practical for the 90% of ocassions.
I remember in C# we deal with that sort of things with events/
delegates.
Hos the same thing is possible in Python, has anyone any link(s) to
have a look ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Gui thread and async jobs.

2007-05-08 Thread king kikapu
On May 8, 4:00 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > Hi, i am reading the book "Python Cookbook, 2nd edition" and i
> > encountered a very handy recipe, the one that is called "Combining
> > GUIs and Asynchronous I/O with Threads"
>
> > It is talking about retain a main GUI thread, doing async work with
> > worker threads and have both talk through a Queue object to dispatch
> > their messages, so the main (GUI) thread remain responsive.
> > It has a very good example by using Tkinter and Qt that is indeed
> > working. The only point that make me wonder is that the QUI thread has
> > to use some polling to check for messages in the Queue.
>
> > Author said that another alternatives exists (by not doing polling)
> > but the complexity makes them non-practical for the 90% of ocassions.
> > I remember in C# we deal with that sort of things with events/
> > delegates.
> > Hos the same thing is possible in Python, has anyone any link(s) to
> > have a look ?
>
> It depends on the toolkit you use. Qt has thread-safe custom events in 3.x,
> and afaik signal/slots (and thus events) are generally thread-safe in 4.x.
> So, no problems there.
>
> Diez

Aha...So you do not use polling there (in Qt), correct ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Gui thread and async jobs.

2007-05-08 Thread king kikapu
On May 8, 5:52 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> >> It depends on the toolkit you use. Qt has thread-safe custom events in
> >> 3.x, and afaik signal/slots (and thus events) are generally thread-safe
> >> in 4.x. So, no problems there.
>
> >> Diez
>
> > Aha...So you do not use polling there (in Qt), correct ?
>
> You don't need to, no.
>
> Diez

Thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list


'int' object is not callable in an threaded app

2007-05-22 Thread king kikapu
Hi,

i have a problem with the following piece of code that id just drive
me nuts (from the morning...)
I think is more Python specific than Qt, folks from Qt forum have
already give me directions of how to do it but that Python error
message is just impossible for me to figure out. And i am sure that it
something just under my nose...

So, i have a form with 2 spin boxes, a button and a progress bar. When
i hit the button i expect to see the progressbar filled with the
values of spFrom and spTo (the 2 spinboxes)

I was given help if how to setup correctly the Signals and Slots
mechanism but i am stuck at this Python error at the "worker.start()"
command:

TypeError: 'int' object is not callable


Before i go and suicide, has anybody an idea what is going on
here ??...



import sys
from PyQt4 import QtCore, QtGui
from calculatorform_ui import Ui_CalculatorForm
from ui_countNumbers import Ui_MainWindow
from time import sleep

class WorkerThread(QtCore.QThread):
def __init__(self, start, end):
QtCore.QThread.__init__(self)
self.start = start
self.end = end

def run(self):
for x in range(start, end):
self.emit(QtCore.SIGNAL("updateProgress"), x)


class CountNumbersForm(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)

@QtCore.pyqtSignature("")
def on_start_clicked(self):
worker.start()

def updateProgress(self, val):
self.ui.progres.setValue(val)


if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
count = CountNumbersForm();
worker = WorkerThread(count.ui.spFrom.value(),
count.ui.spTo.value() + 1);
QtCore.QObject.connect(worker, QtCore.SIGNAL("updateProgress"),
count.updateProgress, QtCore.Qt.QueuedConnection)
count.show()
sys.exit(app.exec_())

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 'int' object is not callable in an threaded app

2007-05-22 Thread king kikapu

> It appears that worker.start gets set to the result of
> count.ui.spFrom.value().  If that result is an int, then worker.start() is
> going to generate the TypeError you received.  Did you actually mean to call
> worker.run() instead?
>
> ---
> -Bill Hamilton

Some friend pointed out to me an hour ago, it was indeed that damn
variable...
Anyway, thanks Bill!

-- 
http://mail.python.org/mailman/listinfo/python-list


Replacing overloaded functions with closures.

2007-07-30 Thread king kikapu
Hi,

i am trying, to no avail yet, to take a C#'s overloaded functions
skeleton and rewrite it in Python by using closures.
I read somewhere on the net (http://dirtsimple.org/2004/12/python-is-
not-java.html) that in Python we can reduce code duplication for
overloaded functions by using closures.

I do not quite understand this. Let's say we have the following simple
C# code:

int func(int i) { return i * 2; }
string func(string s) { return s + s; }
bool func(bool f) { return !f; }

I wasn't able to find a way to express this thing in closures. I even
tried to have the parameters i, s and f as parameters with default
arguments with None value in the inner function and there to check for
the None and do the needed work but i am not sure if this is the
correct solution.

Any help ?


thanks in advance.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Replacing overloaded functions with closures.

2007-07-30 Thread king kikapu
> The closures discussed in the article are not a solution for
> function overloading. They are a solution for function
> composition.

Hmmm

>
> Python generally has no need for function name overloading--if
> you really want it you must do it manually using runtime type
> checking.
>
> def func(obj):
>   if isinstance(obj, bool):
> return not obj
>   elif isinstance(obj, int):
> return obj * 2
>   elif isinstance(obj, basestring):
> return obj + obj
>   else:
> raise NotImplementedError('type %r not supported' % type(obj))

I have already come up with that solution but i was a little excited
from that article that i can do the same thing with closures...And get
rid of the isinstance commands.


> I'm not sure what the author was getting at, exactly.

May be that point confused me too!

Thanks Neil!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Replacing overloaded functions with closures.

2007-07-31 Thread king kikapu
Ok, i see...

Thank you all :)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question.

2007-08-03 Thread king kikapu
On Aug 3, 5:00 pm, gregarican <[EMAIL PROTECTED]> wrote:
> On Aug 3, 10:58 am, king kikapu <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > this is actually a question to those of us who use Eclipse and Pydev
> > as their main Python developing environment. As i use Eclipse (3.3
> > Europa) only for Python and i have nothing to do with Java, is there a
> > way to disable/uninstall some Java-specific stuff and make the
> > environment actually more snappy ??
>
> > thanks for any help
>
> I've used Eclipse for Java, Python, and Ruby development and can say
> that AFAIK "Eclipse" and "snappy" are contradictions. Like "jumbo"
> "shrimp" :-/

xexexe...I am sure about that :) I was wondering if we can throw away
some java-stuff and make our life easier (or, snappier)...

-- 
http://mail.python.org/mailman/listinfo/python-list


Eclipse/PyDev question.

2007-08-03 Thread king kikapu
Hi,
this is actually a question to those of us who use Eclipse and Pydev
as their main Python developing environment. As i use Eclipse (3.3
Europa) only for Python and i have nothing to do with Java, is there a
way to disable/uninstall some Java-specific stuff and make the
environment actually more snappy ??

thanks for any help

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question.

2007-08-03 Thread king kikapu
On Aug 3, 5:46 pm, "Danyelle Gragsone" <[EMAIL PROTECTED]> wrote:
> I wonder how long before they come out with a python version of
> eclipse.  I know there is a C/C++ now.
>
> Danyelle

The only problem i see in Eclipse/Pydev solution is that Eclipse is
bulky...I was not designed for specific Python usage and because of
that we have a lot of stuff that does not concern us. I started to
look at Eric4 and i must way i like it a lot. I am not sure if i
switch yet but it seems very nice.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question.

2007-08-04 Thread king kikapu
News" (or, news to me :) )

The creator of PyDev, contacted me and told me that latest version of
PyDev need not require the whole SDK but only the Runtime Platfom is
OK. That means that we download only the 40MB file (and not the 120
one) and this does not include all the Java stuff that we see in SDK.
So, combined with PyDev, we have an editor just for Python!

I test it a few hours now and it is really fast!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question.

2007-08-04 Thread king kikapu
Ah, and i think that the working set of Eclipse is smaller now...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question.

2007-08-06 Thread king kikapu
> I like pydev and purchased the extensions ... there are bugs of course but
> what stopped me from using it is a project were I had some very large files
> (my fault).

What do you mean by "very large files" ? Can't PyDev handle such ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Ipc mechanisms and designs.

2007-08-10 Thread king kikapu
Hi,

inspired of the topic "The Future of Python Threading", i started to
realize that the only way to utilize the power of multiple cores using
Python, is spawn processes and "communicate" with them.

If we have the scenario:

1. Windows (mainly) development
2. Processes are running in the same machine
3. We just want to "pass" info from one process to another. Info may
be simple data types or user defined Python objects.

what is the best solution (besides sockets) that someone can implement
so to have 2 actually processes that interchanged data between them ?
I looked at Pyro and it looks really good but i wanted to experiment
with a simpler solution.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: The Future of Python Threading

2007-08-10 Thread king kikapu
> All of which is avoided by designing the program to operate as
> discrete processes communicating via well-defined IPC mechanisms.

Hi Ben,

i would like to learn more about this, have you got any links to give
me so i can have a look ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about properties.

2007-08-10 Thread king kikapu
On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote:
> > Hi,
>
> > i read in a book the following code snippet that is dealing with
> > properties:
>
> > class ProtectAndHideX(object):
> > def __init__(self, x):
> > assert isinstance(x, int), '"x" must be an integer!"'
> > self.__x = ~x
>
> > def get_x(self):
> > return ~self.__x
>
> > x = property(get_x)
>
> > Can anyone please help me understand what the symbol "~" does here ??
>
> This has nothing to do with properties.  For integer objects ``~`` is the
> bitwise negation or invertion operator.
>
> Ciao,
> Marc 'BlackJack' Rintsch

Xmmm...ok then but what is actually doing there ?? I removed it and
things seems to work the same way...

-- 
http://mail.python.org/mailman/listinfo/python-list


Question about properties.

2007-08-10 Thread king kikapu
Hi,

i read in a book the following code snippet that is dealing with
properties:

class ProtectAndHideX(object):
def __init__(self, x):
assert isinstance(x, int), '"x" must be an integer!"'
self.__x = ~x

def get_x(self):
return ~self.__x

x = property(get_x)


Can anyone please help me understand what the symbol "~" does here ??

Thanks for any help!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Question about properties.

2007-08-10 Thread king kikapu
Maybe is just a writers' "play" and nothing else.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Ipc mechanisms and designs.

2007-08-11 Thread king kikapu
On Aug 10, 10:33 pm, Nikita the Spider <[EMAIL PROTECTED]>
wrote:
> In article <[EMAIL PROTECTED]>,
>  king kikapu <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi King Kikapu
> There's a shared memory module for Python, but it is *nix only, I'm
> afraid. I realize you said "mainly Windows" but this module seems to do
> what you want so maybe you can work out a creative solution.
>
> http://NikitaTheSpider.com/python/shm/


Yes, i am currently developing mainly on windows but a cross-platform
solution would surely interests me. I will check it out this!

@Alex: Thanks, it looks very-very interesting...


-- 
http://mail.python.org/mailman/listinfo/python-list


Eclipse/PyDev question

2007-08-13 Thread king kikapu
Hi,

i am using Eclipse (Platform Runtime binary) with PyDev and i was
wondering if someone can help me with this:

1. I set breakpoints to a .py file and i have told Eclipse to open the
Debug perspective when it sees that some .py file(s) of my project
indeed contains breakpoints. So, i press F9,  Eclipse starts, Debug
perspective opens and i can use the debugger just fine. But when the
app terminates, how can i tell Eclipse to switch automatically to the
PyDev perspective and not remain in the Debug one ?

2. Let's say we have a project that consists of some .py files. I want
to press F9 when the editor displays anyone of these files but make
Eclipse to run the whole project (that has another .py as "default")
and not the script that i am currently working on, is that possible ??


Thanks a lot for any help

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question

2007-08-13 Thread king kikapu
On Aug 13, 1:44 pm, [EMAIL PROTECTED] wrote:
> On Aug 13, 11:48 am, king kikapu <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > i am using Eclipse (Platform Runtime binary) with PyDev and i was
> > wondering if someone can help me with this:
>
> > 1. I set breakpoints to a .py file and i have told Eclipse to open the
> > Debug perspective when it sees that some .py file(s) of my project
> > indeed contains breakpoints. So, i press F9,  Eclipse starts, Debug
> > perspective opens and i can use the debugger just fine. But when the
> > app terminates, how can i tell Eclipse to switch automatically to the
> > PyDev perspective and not remain in the Debug one ?
>
> You don't, Eclipse keeps the same perspective because for what it
> knows you might want to debug some more and it correctly avoids to
> decide what is good for you. Switching to the debug perspective when
> you issue a debug command is an exception to the normal switching of
> perspectives with the respective big buttons and the menu.
> If you wish to switch perspective to edit code before debugging again,
> putting editors and appropriate accessory views in the debug
> perspective might be good enough.
>
> > 2. Let's say we have a project that consists of some .py files. I want
> > to press F9 when the editor displays anyone of these files but make
> > Eclipse to run the whole project (that has another .py as "default")
> > and not the script that i am currently working on, is that possible ??
>
> Executing the current file is a bad habit, Eclipse remembers a list of
> execution/debug configurations that can be selected from a dropdown
> list in the toolbar and edited with a dialog box; after you setup
> entry points for a project you can use and edit them as needed.
> I'm using Eclipse for Java and my entry points include remote
> debugging of a GUI application, about 6 JUnit tests, about 3 command
> line tools with many complex parameter sets each, and some Ant builds;
> it would take about one hour of trial and error to reconstruct the
> command lines, classpaths and JVM options. I only run the current file
> as a draft for an edited configuration.
>
> Regards,
> Lorenzo Gatti

Hey Lorenzo,

thanks for the help!

I understood that with the Debug perspective. Ok, i will, as
currently, have to swtick manually to PyDev.

But i cannot figgre out how i can tell Eclipse to run the whole
Project and not the currently active script that i work on...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question

2007-08-13 Thread king kikapu
Ah, i forgot another one:

as any project evolves, you need to organize it in directories. So, i
have a project named "Dev" and Eclipse has provided me (in Navigator)
with "Dev" and "Src". Inside Src i put my .py files. Let's say that i
want to create a directory there (will i make it in "Src" or in "Dev")
to put other .py files. I tried adding a "Folder", i also tried to add
a "Pydev Source Folder", either way i cannot refer to these files from
a .py located in Src directory with the usual "from folderA
import"...It does not understand the folder structure and i am pretty
sure i am missing something obvious here...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyDev question

2007-08-14 Thread king kikapu
Fabio,

thanks for the reply!

Anyway, i saw that i cannot import anything if i use "Source Folders"
in Eclipse/PyDev. The only way i can accomplish that is by using
"PyDev Packages". Thus, i can import whatever i want ant intellisense
is working great! I just cannot understand the usefulness of "PyDev
Source Folders"...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: IDE for Python

2007-08-21 Thread king kikapu
On Aug 21, 12:00 pm, Joel Andres Granados <[EMAIL PROTECTED]>
wrote:
> Hello list:
>
> I have tried various times to use an IDE for python put have always been
> disapointed.


I have also tried a lot of them (IDEs) in the last year. I was finally
happy with Eclipse/Pydev but i was always wanted a more "true" IDE for
Python.
I think i found it in Eric4 http://www.die-offenbachs.de/eric/index.html
You can download from here http://www.riverbankcomputing.co.uk/pyqt/download.php
(binary installer for Windows that contains Eric and PyQt)
and have a look at it!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-03 Thread king kikapu
On Sep 3, 9:15 am, Michele Simionato <[EMAIL PROTECTED]>
wrote:
> On Sep 3, 2:21 am, llothar <[EMAIL PROTECTED]> wrote:
>

> My personal opinion (and I am not the only one in the Python
> community) is that
> if you want to scale the way to go is to use processes, not threads,
> so removing the GIL would be a waste of effort anyway.
> Look at the 'processing' module in PyPI.
>
>  Michele Simionato


I second that. You may also look here,
http://www.parallelpython.com/

I tested it and work as expected. You can see all your processing-
cores work nicely and balanced.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-03 Thread king kikapu
I was wondering (and maybe i still do) about this GIL "problem". I am
relatively new to Python (less than a year) and when i started to
think about it i said: "Oh, this IS a problem". But when i dig a
little more, i found that "Ah, maybe it isn't".
I strongly believe that the best usage of multiple cores processor
will be achieved if programming languages are modified to support this
on their "hearts". Code blocks that would be identified by the
compiler and run in parallel and such things. Laboratories are working
on these stuff but i do not expect something in the very-near future.

So, as i mentioned above, there are solutions for that right now
("parallel python" and others) that enabled us with little effort to
spawn a new python interpreter, thus allowing the OS to schedule it on
a different core and do the job this way relatively cheap.
I wouldn't recommend going to IronPython despite the fact that the CLR
better utilize MP. The reason for this is that i would NEVER give up
the freedom that CPython gives me by exchange "better" usage of the MP
and platform lock-in.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-03 Thread king kikapu
I was wondering (and maybe i still do) about this GIL "problem". I am
relatively new to Python (less than a year) and when i started to
think about it i said: "Oh, this IS a problem". But when i dig a
little more, i found that "Ah, maybe it isn't".
I strongly believe that the best usage of multiple cores processor
will be achieved if programming languages are modified to support this
on their "hearts". Code blocks that would be identified by the
compiler and run in parallel and such things. Laboratories are working
on these stuff but i do not expect something in the very-near future.

So, as i mentioned above, there are solutions for that right now
("parallel python" and others) that enabled us with little effort to
spawn a new python interpreter, thus allowing the OS to schedule it on
a different core and do the job this way relatively cheap.
I wouldn't recommend going to IronPython despite the fact that the CLR
better utilize MP. The reason for this is that i would NEVER give up
the freedom that CPython gives me by exchange "better" usage of the MP
and platform lock-in.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-03 Thread king kikapu
I was wondering (and maybe i still do) about this GIL "problem". I am
relatively new to Python (less than a year) and when i started to
think about it i said: "Oh, this IS a problem". But when i dig a
little more, i found that "Ah, maybe it isn't".
I strongly believe that the best usage of multiple cores processor
will be achieved if programming languages are modified to support this
on their "hearts". Code blocks that would be identified by the
compiler and run in parallel and such things. Laboratories are working
on these stuff but i do not expect something in the very-near future.

So, as i mentioned above, there are solutions for that right now
("parallel python" and others) that enabled us with little effort to
spawn a new python interpreter, thus allowing the OS to schedule it on
a different core and do the job this way relatively cheap.
I wouldn't recommend going to IronPython despite the fact that the CLR
better utilize MP. The reason for this is that i would NEVER give up
the freedom that CPython gives me by exchange "better" usage of the MP
and platform lock-in.

-- 
http://mail.python.org/mailman/listinfo/python-list


wxPython import error...

2007-03-04 Thread king kikapu
Hi,

i am just completed installing Python/Pydev/Eclipse/wxPython on an
Ubuntu system and all are running fine except program that contains
references to wx

It gives me:
ImportError: /usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/
_core_.so: undefined symbol: PyUnicodeUCS4_FromEncodedObject

I installed the wx packages the way the wx web site says, especially
for Ubuntu.

Can anyone help with this as i have been searching the net for this
with no luck...

Thanks for any help

-- 
http://mail.python.org/mailman/listinfo/python-list


PythonCard thoughts

2007-03-19 Thread king kikapu
Hi to all folks here,

i downloaded and "playing" with PythonCard and i just want to share my
thoughts so maybe we can discuss a little about it.
I was used to wxGlade before and i think PythonCard is even better.
I like the separate implementation of GUI and Code that PythonCard
provides, i also like the "binding system" so you can bind functions
to events and have them executed at runtime.
I also like that it does not force you to use sizers and all that
stuff and that you can freely place your components on the form and
set their exact position just with the mouse.

The only "problem" i see with this design is that by that separation
of Gui/Code, you loose the intellisense that (ex. PyDev) some editors/
plugins can provide because in the .py file nothing is indicating
that , for example, the btnDoWork is a Button object.
This force you to remember many properties and switch back and forth
between your code and the wxPython help file. This is not the case for
wxGlade because all boilerplate code is in the same file (for good and
for bad) and PyDev (and others too) can "understand" for which kind of
objects we are talking about and so can display -and thus help us-
with their properties.

Apart from that, everything else is great.

Any opinions/suggestion on all this ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PythonCard thoughts

2007-03-19 Thread king kikapu
> I don't know much about PythonCard or wxGlade, but I use wxPython (which
> wxGlade uses, right?) and you now have the option to separate your GUI
> and code using an XRC file (xml file that describes layout). So perhaps
> this is something you can do with wxGlade, but at the same time it might
> still create the problem you describe above. However, it's very to have
> your Python files contain just logic.

Yes, both products (PythonCard and wxGlade) uses wxPython. It's just
that PythonCard is sitting on top of wxPython and it intercepts the
events generated. Then it search for an appropriate declared function
on your code and call it (all this happens at runtime).
It shield us from much of the boilerplate code that gui toolkits
require and in the case that you need to address directly wxPython,
you just can!

I discovered that when you run your designed GUI from PythonCard's
layoutEditor, you have the ability to define a command line option
that is called
"Message Watcher". This, will show you the names of the actual events
that you have to write code for, so you, at least for this, do not
have
to dig the docs for their names. Pretty good!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PythonCard thoughts

2007-03-19 Thread king kikapu
> Would you please explain more in detail this "Message Watcher" option?
> I use PythonCard from time to time, and I find it very easy to use and
> practical, even considering the small shortcomings you mentioned
> above, but I have no idea of this feature you're talking about..
>
> Regards,
> Luis

Luis, go to File/Run Options and check the third choice called
"Message Watcher", then run your design.
You will then see that every event that is triggered is displayed to
you and when you actually want to see the event that you interested
in,
you just cause it to happen and then it is displayed on the message
watcher event grid.
You then go to your source file and armed with the known notation
(on_controlName_eventName) you write the code.

I copy from the manual of PythonCard:
"The Message Watcher integrates with the wxPython event model to show
you in real time the events that are being triggered when a PythonCard
application is running. It helps determine where the application code
should go and verify that a PythonCard application is operating as
expected."

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PythonCard thoughts

2007-03-19 Thread king kikapu

Ο/Η John Henry έγραψε:
> (If I understand your question correctly)
>
> There is no restirction on what you call your objects.  For instance,
> I do call all of my buttons btnSomeThing, and so forth.

No, i surely didn't mean this! What i mean is that the creation of
these components happens to NOT reside in the .py file that we are use
to put our logic in, so, the various Editors/Plug-ins cannot
"understand" what type is the object we refer to so they cannot
provide intellisense information.

Let' say for example, that we create a design in PythonCard that
contains a form and just one butto named btnStart. In our .py file we
want to refre to that button in a way such:
self.components.btnStart

At this point, if we had the code that created this button in our
file, PyDev (for example) would show us the properties of btnStart
because it has understood that we are using a wx.Button.

This is not the case of thePython card because this creation is
happened to runtime by...PythonCard!

Anyway, it is not that important from keeping me from using
PythonCard.

Do we know more things about the developing of this product, is it
active/dead or something ??
I plan to use it to create something that will take a long time to
finish and i wouldn't want to find out that the product is a dead-
end...

-- 
http://mail.python.org/mailman/listinfo/python-list

About Trolltech QT OpenSource license.

2007-04-10 Thread king kikapu
Hi to all,

i am coming from the Microsoft (.net) world and at the quest of
finding the right GUI toolkit that i can use from Python, i have two
obvious choices to choose from: wxPython and Qt.

Both are looking very good. Qt has Qt designer, a tool that really
reminds me of the forms designers that we have in VS.Net.The
productivity someone can gain from tools like these can be really
astonished.
I saw at the forum here that a lot of debate is coming from the
"strange" interpretation of it's Open Source Edition lisence.
After a lot of reading i was under the impression (and many others
with me) that even a stand alone developer working in-house at company
cannot use Qt OS Edition and must buy the commercial lisence.

I sent an emai to them today and i think their response is
interesting, so i appose it here;

#
Thank you for your inquiry regarding the Qt Open Source Edition.

The open source edition may be used for either your own private use or
for an application used only internally by your company if the
application is developed by you on company time.  With internal
company use under the GPL it is absolutely imperative that the
application not be distributed outside of the legal entity.  If this
happens then the GPL source distribution requirements (as well as all
other GPL
requirements) will take effect.  The internal use by the company falls
under the "private modification" exception to the GPL.

Please note that if you begin your application development with the
GPL version, that application must be GPL licensed and Trolltech does
not permit developers to start with the Qt Open Source Edition and
later convert to a commercial license.

Good luck with your development and please contact [EMAIL PROTECTED]
if your company wishes to purchase a commercial Qt license at some
point in the future.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About Trolltech QT OpenSource license.

2007-04-10 Thread king kikapu

Ο/Η Jarek Zgoda έγραψε:
> king kikapu napisa³(a):
>
> This is a bullsh*t. Qt is free (as in "free speech") on GPL. Nothing
> stops you from using it in any commercial project if only it fits the
> licensing terms (i.o.w. it's free software). This specially applies to
> inhouse development, as in such case there's no "distribution".

Hmmm...how a commercial software (that means i get paid for give it)
it will be consider "free software" ?
I ask because i surely do not understand correctly the GPL lisence and
all that stuff.

> Hey, there's no such statement here. Where did you get this "must buy
> the commercial lisence"?

Good point! I got it because at the last portion of my email, i asked
for it. I asked them that:
"And in  the case i want to build something that i want to later sell
(as an individual)..."

so i got it back.


> Plus, this (sales)person forgot to state clearly, that GPL covers only
> distribution, not the cost of software. If you manage to get some hot
> cash for selling sources of your GPL-ed program, the license would not
> try to stop you from doing that. ;)

As i said, i do not fully understand all this license stuff. All i
want to ask is, i can make GPL software and gain money from this ? And
if that so, then why they "force" you to buy the commercial lisence in
such case ?

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: About Trolltech QT OpenSource license.

2007-04-10 Thread king kikapu

Ο/Η Peter Decker έγραψε:
> There is another alternative: Dabo, which wraps the wxPython toolkit.
> It has a GUI designer, although not as polished as the Qt Designer.
> Check out some of their screencasts to see their tools in action. You
> can find them at http://dabodev.com/documentation

I am aware but i prefer to use PythonCard if i choose wxPython over
Qt. I think Dadbo has a lot of work to be done, it is surely very
promising, thanks!


@ Kevin and Jarek :
thanks for the enlightening of that GPL thing. So, if i understand, i
create my Python software using Qt as my GUI, i earn the money for it
with the obligation to release my source code and somewhere in my
files i explicilty write that this software is under the GPL lisence,
is that correct ?? And i am legal all the way out ??

So why these people at Trolltech have the word "Commercial" at their
mouth all the time ?? I can understand of course that money is all
about but becauce they released Qt under GPL they simply cannot
prevent anyone from gaining money using it.

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: About Trolltech QT OpenSource license.

2007-04-11 Thread king kikapu
On Apr 11, 10:56 am, Robert Kern <[EMAIL PROTECTED]> wrote:
> Others have given good answers. I would only like to clarify what I think is 
> the
> source of confusion here. While the FSF and many open source advocates make a
> distinction between the words "commercial" (meaning that someone derives money
> from distributing the software, whether it is GPLed or not) and "proprietary"
> (meaning that the software is not being distributed under an open source 
> license
> but one that restricts user's rights), Trolltech abuses the term "commercial" 
> to
> mean "proprietary" in this case.

Ok, i see...So i can use Qt OS edition and earn money from this as
long as i explicitly say (is a reference to a GPL in a readme text
file enough for this ?) that this software is under the GPL lisence
and i have the obligation to give the source code with it.
I will reply to that email of Trolltec's today and i will tell them
about the things mentioned here, basically just the sentence i wrote
above.
I see what they will reply and post it here...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About Trolltech QT OpenSource license.

2007-04-11 Thread king kikapu

> > Ok, i see...So i can use Qt OS edition and earn money from this as
> > long as i explicitly say (is a reference to a GPL in a readme text
> > file enough for this ?) that this software is under the GPL lisence
> > and i have the obligation to give the source code with it.
>
> It's a bit more complicated than that.

Why ? From the whole discussion here, i understand that ok, i will
give my source code with my program and i can sell this at the same
time and earn money.
If i mess with Qt, i will write software for myself, internaly at the
company i work for and maybe produce software and sell it by myself.
If you think that i am missing something, please let me know.
(Maybe i should stick with wxPython and PythonCard...)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About Trolltech QT OpenSource license.

2007-04-11 Thread king kikapu

Ο/Η Robert Kern έγραψε:
> It's a bit more complicated than that. There are good resources for
> understanding the implications of the GPL on the FSF's site which other people
> have pointed out.

>From what i can understand, you can sell your product and you have to
give the source. Also you must state clearly somewhere in the software
that this is under GPL.
Are there other complications that comes to the party ?
(i really like Qt but if i have chances to mess with laywers, i show
stick to wxPython and PythonCard...)

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: About Trolltech QT OpenSource license.

2007-04-12 Thread king kikapu
On Apr 12, 1:02 am, Robert Kern <[EMAIL PROTECTED]> wrote:
> All parts of the software have to be licensed compatibly with the GPL. The FSF
> has a fairly comprehensive list of the licenses they believe are 
> GPL-compatible.
> The source that you provide needs to be the preferred form for making
> modifications; i.e., you can't use a tool that obfuscates the code. You need 
> to
> provide the scripts that you use to build the software. You have to be careful
> about using patented techniques in your code. The source code must be offered 
> at
> no extra charge (this part of the license is a bit tricky, so please read the
> license and the commentaries).

Ok, i see...You said "All parts of the software have to be licensed
compatibly with the GPL". What if, let's say, my application's GUI is
made by Qt (Open Source edition that is indeed under GPL license) and
in this application i use some module(s) that i bought from some other
company and they aren't under GPL, do you see any implication to
this ?

Thanks you all again!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About Trolltech QT OpenSource license.

2007-04-12 Thread king kikapu
I dig a little bit more on the Trolltech's site and i think that this
page is telling all the truth:

http://www.trolltech.com/developer/downloads/qt/faq

So, this tells us all the good stuff people in this thread are talking
about, i think is clear enough.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python editor/IDE on Linux?

2007-04-13 Thread king kikapu
I experiment with Ubuntu nowadays, and i find my Windows combination a
realy win also there,
Eclipse and PyDev.

-- 
http://mail.python.org/mailman/listinfo/python-list


PyODBC Stored proc calling

2007-01-18 Thread king kikapu
Hi to all,

can anyone give me a jump-start about how to call Stored Procedures
from PyODBC ??
I want to execute a very simple testing Stored Procedure on an Sql
Server database.

I started using PyODBC and code like the following

cnxn = pyodbc.connect('DRIVER={SQL
Server};SERVER=hercules;DATABASE=pubs;UID=sa;PWD=pwd'')

for row in cnxn.execute("select au_fname from authors"):
print row.au_fname
cnxn.close()

and based on this, i can now write more complex ad-hoc sql string to
get/update data.
But how i can actually call Stored Procedures and passing parameters to
them ??

Let's say i have the following SP:

create procedure test_bed(@data varchar(100))
as
// do something here.


Any help ??

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyODBC Stored proc calling

2007-01-19 Thread king kikapu
No one is using pyodbc ??  :)

-- 
http://mail.python.org/mailman/listinfo/python-list


"Correct" db adapter

2007-01-31 Thread king kikapu
Hi to all,

i have started a month ago to seriously studying Python. I am now
looking at the databases stuff
and i want the opinion of more experienced Python programmers (than
me) at the following :

I see that there are a lot of databases adapters on the net, some
following the DB-API 2.0 and some others do not. I want to use a db-
module that do not tie me down to a specific database and that fully
supports DB-API 2.0
Now i am using Sql Server but who knows about tomorrow.

I started using pyodbc and looking how i can e.x. call stored
procedure with arguments and all that stuff.
This is using ODBC syntac and i found enough info on the net.

Is the approach i took the "correct" one or is there a better db-
module so i can use ?

Thanks in advance

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Correct" db adapter

2007-01-31 Thread king kikapu
Thanks for the replies.

I think i do not need something like ORM, but just a db-module that i
can "work" the database with it.
I just want to know if pyodbc is the "correct" solution to do so or if
it is another db-module that is more
usefull for this job.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Correct" db adapter

2007-02-01 Thread king kikapu
Ok, i see..

Thanks a lot all of you for the help. I know from my Win/.Net/Sql
Server expertise that odbc put a layer in the mix. That's why, for
example, in .Net we have a native SqlClient data provider that talks
to Sql Server directly.

But one of the reasons that i started learning Python, is to NOT to be
tied-up again with ANY company or specific product again (i had enough
MS addiction over these years...). So, based on this direction, i am
using pyodbc, which is DB-API2 compliant and i suppose that the code i
write this way, will have little changes to use another db in the
future.

I dig the net and found that there are several efforts for modules
specific to some databases but some of them are incomplete, faded, or
not db-api2 compliant.

So, i will check mxOdbc and see if there is a reason to use it over
pyodbc.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: "Correct" db adapter

2007-02-02 Thread king kikapu
Thank you all!

-- 
http://mail.python.org/mailman/listinfo/python-list


Object type check

2007-02-07 Thread king kikapu
Hi to all,

in statically-types languages, let's say C# for example, we use
polymorphism through interfaces. So we define an interface I with
method M and then a class C that implements I interface and write code
for the M method.
So, if we have a function that takes a parameter of type I, we know
before-hand that it will have an M method to call.

But in dynamic languages this is not the case and we can pass whatever
we want to that function. Assuming that someone writes a library in
Python that other programmers will use, what is the correct way to
check inside that function if the parameter passed is of the correct
type, maybe "isinstance" BIF ?

Thanks in advance!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Object type check

2007-02-07 Thread king kikapu
> Dont restrict them to particular types. You would
> not restrict them to a particular class in C#. Instead, you define the
> interfaces simply by how you use the objects.

Of cource i restrict them to particular types! In C# you cannot pass
something bad
this way because the compiler will just catch it!

I see what you mean by "duck typing". So you suggest the "do nothing
at all" direction,
better document my code so other can see what is expected, right ?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Object type check

2007-02-07 Thread king kikapu
at first, thanks you all for your help!

So, i will follow your advice.In a moment though, i thought that "ok,
do not check anything of the parameter's type but do a try/catch at
the calls inside the function"

But this way, i would rather defeat the purpose because i have to try/
catch in *every* call inside the func.
So, i suppose that i wouldn't want to do that and just try to make the
call in whatever they passed me in.

Strange world the dynamic one

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Object type check

2007-02-07 Thread king kikapu
> And so what ? Once an exception got caught, what are you going to do ?

You have absolutely right, that's the reason i rejected this.

> You're starting to see the light, my friend !-)
>
> > Strange world the dynamic one
>
> If that's too dynamic for you, then run for your life


Hehe...you know, it is a little bit strange if you are used to Delphi,
C# or any other statically-typed language and suddenly you starting
programming in a dynamic one, really strange! :)
All of the efforts all these years to declare everything correct, to
fight with the compiler (and to always have him win...), to ...[put
whatever here] and now Python...What can i say!...

Thanks for the help!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Object type check

2007-02-08 Thread king kikapu
> def modify(list_of_x):
> for x in list_of_x:
> try:
> x.change_in_place  # don't call the method, just check it exists

XX...what exactly is going on here ? I mean, what is actually
happens if you omit the parenethesis as you just did ? I understand
that it does not call the method, but what is really doing ??

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Object type check

2007-02-08 Thread king kikapu

Ο/Η Michele Simionato έγραψε:

> See http://users.rcn.com/python/download/Descriptor.htm for more than
> you ever wanted
> to know about attribute access in Python.
>
>  Michele Simionato

Great stuff Michele, thanks!

-- 
http://mail.python.org/mailman/listinfo/python-list

NetUseAdd mystery

2007-02-26 Thread king kikapu

Is anyone see any error in the following code:

mapDrive = "MyServer\\C$"
data = {'remote' : mapDrive, 'local' : 'M:', 'password' :
'mypassword', 'user' : 'Administrator', 'asg_type' : 0}
win32net.NetUseAdd(None, 1, data)

It gives me "pywintypes.error: (1326, 'NetUseAdd', 'Logon failure:
unknown user name or bad password.')" and i cannot figured out why...I
searched the forum about the syntax of NetUseAdd command and i think
that the syntax is correct and also are the data that i pass to it.
(the same data can give me a connection if i use "net use ..." from a
command line"

So, what am i doing the wrong way (and keeps me on this the last 2
hours??...)


Thanks for a any enlightenment...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: NetUseAdd mystery

2007-02-26 Thread king kikapu
> I think your problem is that C$ is a "special" share.  Try creating
> a share and connect to it instead.  It is either that your your userid/
> password are in fact incorrect.
>
> -Larry

No, my credentials are absolutely correct. As for the "$", what is the
possible problem with that ?? Net use is working great and i think
that also the net functions of win32api are working correct.
The problem must be in some other point...

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: NetUseAdd mystery

2007-02-27 Thread king kikapu
> You need to use level 2 info to pass the username.
> Level 1 is for the old-style share with its own password.
> Also, it should be 'username': instead of just 'user':.
>
>  hth
>Roger

Roger many-many thanks! That was it, i had to put "username" instead
of "user" and 2 instead of 1 at the calling...

Thanks again!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: book for a starter

2007-02-27 Thread king kikapu
Me, i bought this
http://www.amazon.com/Core-Python-Programming-2nd/dp/0132269937/sr=8-1/qid=1172592163/ref=pd_bbs_sr_1/105-9302229-1138834?ie=UTF8&s=books
and i really think it is a great book for learning Python.
It refers to the latest Python version (2.5) and covers a lot of
things, besides the language.

-- 
http://mail.python.org/mailman/listinfo/python-list


Eclipse/PyQt/Eric4 question

2007-12-13 Thread king kikapu
Hi, this is actually goes to whoever is using Eclipse and Eric4, the
IDE that comes bundled with PyQt.
I was using Eclipse until i saw Eric4 and i started experiment with
it, very nice work.

Eric4 has a feature that actually reminds us the work of some
expensive IDEs, like Visual Studio, Delphi and the like: when you
compile your project, it checks to see if some .ui files (Qt Designer
form files) has changed and if so, it call pyuic.bat and compiles it
(or them) transparently so it then runs your program with latest form
changes.

In Eclipse, i have the luxury of double-click a .ui file and thus Qt
Designer opens and then design my forms there, but i cannot fing an
automatic way to accomplish the thing that eric4 does: e.x.
automatically compile changed .ui files when i hit F9. And it really a
loss of time to go to dos-prompt and do this manually.

Has anyone who work on Eclipse/PyDev and PyQt, found a way to do
this ??
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyQt/Eric4 question

2007-12-13 Thread king kikapu
> You can create a builder for calling an external program to do that on
> builds (right-click project -> properties > Builders).
>
> Another option is configuring an external program run --> menu: run >
> external tools > open external tools dialog (and you can bind a
> shortcut to rerun the last external tool launched).
>
> Cheers,
>
> Fabio


Hmmm...but this means that i am forced to do this for ALL .ui files on
the project, either changed or not and this can slow things down...
(pyuic.bat can run for one or for ALL .ui files)
The goal is to find a way to automatically do this only for the
changed ones, like eric does...

Anyway, thanks for the help!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse/PyQt/Eric4 question

2007-12-14 Thread king kikapu
On 14 Δεκ, 01:09, "Fabio Zadrozny" <[EMAIL PROTECTED]> wrote:
> > Hmmm...but this means that i am forced to do this for ALL .ui files on
> > the project, either changed or not and this can slow things down...
> > (pyuic.bat can run for one or for ALL .ui files)
> > The goal is to find a way to automatically do this only for the
> > changed ones, like eric does...
>
> When you do a new builder, you can make it be run only when a file is
> changed, and you can select as arguments only receiving the files
> changed (build_files)... take a look at the variables to specify as
> arguments (you could also select 'python.exe' as the external program
> and choose some python script as argument + the files changed).
>
> The auto-build can be specified at the build options tab.
>
> Cheers,
>
> Fabio

Axa! I didn't know (or better, i didn't experiment enough) this...So,
basically you tell me that this is possible on Eclipse! I will test it
at home on the afternoon, is sounds great!
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: What is The Eric4 IDE???

2008-03-20 Thread king kikapu
I use it for some time now and i think it is the best Python IDE out
there, especially if someone wants to "play" with Qt. If you are on
Windows, just install the Windows binary, it' all there!
-- 
http://mail.python.org/mailman/listinfo/python-list


Psyco alternative

2008-03-27 Thread king kikapu
Hi,

it seems that Psyco's author will not port it for the upcoming Python
3000 release  :(
So, for us who use it we will continue to use CPython 2.5.x version
for some time to come. Is there an alternative to Psyco so i can have
a look at ?

Thanks in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Psyco alternative

2008-03-27 Thread king kikapu
On 27 Μαρ, 14:35, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> king kikapu <[EMAIL PROTECTED]> writes:
> > it seems that Psyco's author will not port it for the upcoming Python
> > 3000 release  :(
>
> I think the idea is it will be part of PyPy and you should use that.

I know that his efforts are on PyPy now but i do not know when PyPy is
going to be stable and if i can use it with my current "development
stack" (PyQt, Eric4 etc). I mean, i do not know if it will be possible
to "abandon" CPYthon and use PyPy instead.
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Psyco alternative

2008-03-27 Thread king kikapu
On 27 Μαρ, 15:56, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> king kikapu wrote:
> > On 27 Μαρ, 14:35, Paul Rubin <http://[EMAIL PROTECTED]> wrote:
> >> king kikapu <[EMAIL PROTECTED]> writes:
> >> > it seems that Psyco's author will not port it for the upcoming Python
> >> > 3000 release  :(
>
> >> I think the idea is it will be part of PyPy and you should use that.
>
> > I know that his efforts are on PyPy now but i do not know when PyPy is
> > going to be stable and if i can use it with my current "development
> > stack" (PyQt, Eric4 etc). I mean, i do not know if it will be possible
> > to "abandon" CPYthon and use PyPy instead.
>
> Currently? No way. It's *way* to slow.
>
> Diez

Ok, i know this. The one that i do not know, is if, let'say, in 2
years it will be ready for seriously development, PyPy will aim to
"replace" CPython entirely ?? We are talking about an whole new
distribution ?

As for psyco, are there any alternatives to use now ?
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Psyco alternative

2008-03-27 Thread king kikapu
>
> > As for psyco, are there any alternatives to use now ?
>
> Nope, but I heard through the grapevine that while it won't be supported for
> all times to come, a new version is in the making.

Aha!! It seems you have better "sources" than me!  :)


> But ultimately, the author says that the approach is flawed, so at *some*
> point it will be discontinued. But that could be said about nearly
> everything, couldn't it?
>
> Diez

It is a pity because this module *does* really solve some problems...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Psyco alternative

2008-03-27 Thread king kikapu
> If it's about "some problems", then maybe Cython is an alternative.
>
> http://cython.org
>
> Stefan

Hmmm...thanks but i think Pyrex-like solution is not the ideal one.
Coming from C# and having 8 years of expertise on it, i have gain a
very positive thinking about jit compilers and i think that psyco (ok,
a just-in-time specializer) is a more easy (and more correct) way to
go that mixing 2 languages.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Psyco alternative

2008-03-27 Thread king kikapu
> One reason attention is going to PyPy instead of Psyco...
>
> Jean-Paul

I had a look at PyPy, it, indeed, have a very long way to go so we can
consider it an alternative.
-- 
http://mail.python.org/mailman/listinfo/python-list


Eclipse and PyDev Package explorer

2008-03-28 Thread king kikapu
Hi,

i am trying to "fit" Eclipse/Pydev in my needs/preference, so i want
to ask this:

As it is now, i see all my projects in that TreeView (PyDev Package
Explorer). I would rather want this to behave like a more "normal" IDE
where you Open one project and if you want close it and Open another,
just one at a time and not a TreeView with ALL your projects loaded in
every time you open the IDE.

Is there a way to accomplish thiks in Eclipse/Pydev ??
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Eclipse and PyDev Package explorer

2008-03-28 Thread king kikapu
A, and another one: If i set a custom builder for a pydev project, is
there a way for this builder to automatically be "assigned" to every
(pydev) project i will create from now on or i have to re-define it
for every new one ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Netbeans Early Access and Python3

2008-12-06 Thread king kikapu
Hi,

have anyone using this release of NetBeans (6.5 with Python support)
with Python 3 without any problems ? I mean, does it work with Python3
or only with 2.x ?
--
http://mail.python.org/mailman/listinfo/python-list


  1   2   >