Re: Compiling Python 3.6.1 on macOS 10.12.5

2017-07-11 Thread Viktor Hagström
>Why are you trying to compile Python manually? You should use Homebrew to >install Python in 99% of cases. (The package is python3) I'm not the person you answered, but I can explain why I do things that are not "optimal" or "easy" or "best". I am interested, I want to learn something, I think

Re: Compiling Python 3.6.1 on macOS 10.12.5

2017-07-11 Thread Viktor Hagström
>Why are you trying to compile Python manually? You should use Homebrew to >install Python in 99% of cases. (The package is python3) I'm not the person you answered, but I can explain why I do things that are not "optimal" or "easy" or "best". I am interested, I want to learn something, I think

Re: Compiling Python 3.6.1 on macOS 10.12.5

2017-07-11 Thread Viktor Hagström
>Why are you trying to compile Python manually? You should use Homebrew to >install Python in 99% of cases. (The package is python3) I'm not the person you answered, but I can explain why I do things that are not "optimal" or "easy" or "best". I am interested, I want to learn something, I think

Re: Cannot get any Python commands to work

2017-06-12 Thread Viktor Hagström
It seems like you are trying to run easy_install while running the Python interpreter. I am not familiar with easy_install, but my guess would be to run it outside the interpreter, in the command prompt. 2017-06-12 16:47 GMT+02:00 David Marquand mailto:dbmarqu...@gmail.com>>: I am trying to lea

Re: Cannot get any Python commands to work

2017-06-12 Thread Viktor Hagström
It seems like you are trying to run easy_install while running the Python interpreter. I am not familiar with easy_install, but my guess would be to run it outside the interpreter, in the command prompt. 2017-06-12 16:47 GMT+02:00 David Marquand mailto:dbmarqu...@gmail.com>>: I am trying to lea

Re: How to install Python package from source on Windows

2017-05-20 Thread Viktor Hagström
I have followed this discussion since the beginning, and I have been intrigued. I recently read a relevant blog post that I'd like to share. It has arguments for both sides: http://nullprogram.com/blog/2017/03/30/. 2017-05-20 0:01 GMT+02:00 eryk sun mailto:eryk...@gmail.com>>: On Fri, May 19, 2

how to zip a StringIO object?

2009-10-28 Thread Nagy Viktor
Hi, I try to run the following code: def generate_zip(object_list, template): result = StringIO.StringIO() zipped = zipfile.ZipFile(result, "w") for object in object_list: pdf = generate_pdf(object, template) if not pdf: raise IOError("Problem with generati

Re: Creating classes and objects more than once?

2008-11-28 Thread Viktor Kerkez
On Nov 28, 9:35 am, Carl Banks <[EMAIL PROTECTED]> wrote: > However, I'm not so sure the effect of os.chdir() on the import path > is a good idea. I'm not actually using os.chidir(), I just used it here to create a clearer example. Here is the simplest representation of the problem: http://www.n

Re: Creating classes and objects more than once?

2008-11-27 Thread Viktor Kerkez
On Nov 28, 12:32 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > The Python position on singletons is generally to just use a module > instead (preferred), or apply the Borg > pattern:http://code.activestate.com/recipes/66531/ The same problem appears if I use the module (as I pointed in the firs

Re: Creating classes and objects more than once?

2008-11-27 Thread Viktor Kerkez
A better way to do this was http://pastebin.com/m1130d1fe :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating classes and objects more than once?

2008-11-27 Thread Viktor Kerkez
But this means that there is no way to create a safe Singleton in python, because the classes are also created twice. This is the problem that I encountered. I created a complex implementation of a Singleton pattern using metaclasses because I needed the __init__ method to be called just once and

Creating classes and objects more than once?

2008-11-27 Thread Viktor Kerkez
Here is the situation: $ ls test $ cd test $ ls __init__.py data.py $ cat __init__.py $ cat data.py DATA = {} $ cd .. $ python >>> import os >>> from test.data import DATA >>> DATA['something'] = 33 >>> os.chdir('test') >>> from data import DATA as NEW_DATA >>> DATA {'something': 33} >>> NEW_DAT

Re: Function creation (what happened?)

2008-05-09 Thread Viktor
I figured out the first two solutions, but the third looks like the most cleaner, think I'll use that one... Thank you everyone. :) On May 9, 3:24 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > The decorator does receive the correct function. The problem is that > at this point __init__ is still

Re: Function creation (what happened?)

2008-05-09 Thread Viktor
This completely slipped of my mind... :) I'm trying to change the: http://wordaligned.org/svn/etc/echo/echo.py So if the function is method it prints ClassName.MethodName instead of MethodName(self|klass|cls=<... ClassName>). But it turned out that in the decorator, the wrapped function is alway

Function creation (what happened?)

2008-05-09 Thread Viktor
Can somebody give me an explanation what happened here (or point me to some docs)? Code: HMMM = None def w(fn): print 'fn:', id(fn) HMMM = fn print 'HMMM:', id(HMMM) def wrapper(*v, **kw): fn(*v, **kw) wrapper.i = fn print 'wrapper:', id(wrapper) return wrappe

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
use properties. However, Python already > has properties. Their syntax is quite nice in my opinion, and > rather explicit, too. Their only flaw is that they are not > "virtual" (in C++ speak). In other words, you can't pass a "self" > parameter to them. Tha

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
46.html > WOW, thats true! :-D (AFAIK these creations are rather complicated than just plain ugly.) Thanks for your comment. Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
register observers for various events fired by the property and so on. This is advanced Python programming, not "cargo cult". Regards, Viktor PS.: Use Python 1.5.2 if you do not need advanced features. ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
developers to implement change events for properties that allows any number of observers to monitor property changes. This could be very useful in GUI programming, for example. Regards, Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Ferenczi Viktor
xygen myself, but I'd prefer > to have almost anything fill in this vacuum, rather than continue things > the way they are. Maybe the community should ask Guido to suggest a "preferred" tool for documenting Python code. Regars, Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest and decorators

2007-09-04 Thread Ferenczi Viktor
gt;>> fn() 'ok' """ return 'ok' if __name__ == '__main__': import doctest doctest.testmod() --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- Regard, Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest and decorators

2007-09-04 Thread Ferenczi Viktor
> @functools.wraps Correctly: @functools.wraps(f) Pass the function to be wrapped by the decorator to the wraps function. Regards, Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest and decorators

2007-09-04 Thread Ferenczi Viktor
r > cumbersome. Please take a look at the documentation of the functools standard module in the Python manual, especially the wraps decorator. It could probably help. Viktor -- http://mail.python.org/mailman/listinfo/python-list

Py3K: Ensuring future compatibility between function annotation based tools

2007-09-04 Thread Ferenczi Viktor
place of tuples? I don't think so. Ideas?) This way all annotation based tools will be compatible and should work seamlessly without imposing any unnecessary constraint. Anybody with a better solution? Any comments? Greetings, Viktor -- http://mail.python.org/mailman/listinfo/python-list

Re: overiding assignment in module

2005-10-25 Thread Viktor Marohnic
Ok thanks a lot. I think i got the point. I also thought that it could be possible to do something like this globals().__setitem__ = custom_setter but __setitem__ is readonly -- http://mail.python.org/mailman/listinfo/python-list

overiding assignment in module

2005-10-25 Thread Viktor Marohnic
Hello. I would to do something like this. container = [] p1 = point() l1 = line() and i would like to override = method of the module so that its puts all objects into container. how i can do something like that. thanks for help, viktor. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyGTK and pyexe

2005-03-21 Thread Viktor
I succeeded :))) And the winner is: from distutils.core import setup import py2exe opts = { "py2exe": { "includes": ["pango", "atk", "gobject", "gtk","gtk.glade"], "dll_excludes": ["

Re: PyGTK and pyexe

2005-03-19 Thread Viktor
Nope, it doesn't work... I've tried that and the only thing I got was: ImportError: could not import pango ImportError: could not import pango Traceback (most recent call last): File "test.py", line 5, in ? File "gtk\__init__.pyc", line 113, in ? AttributeError: 'module' object has no attribut

PyGTK and pyexe

2005-03-18 Thread Viktor
Did anybody managed to "pack", a program that uses pygtk with pyexe? The best result I got was: Pango-ERROR **: file shape.c: line 75 (pango_shape): assertion faled: (glyphs->num_glyphs > 0) aborting... I'm using python2.4, pygtk-2.6.1-1.win32-py2.4, gtk-win32-2.6.4-rc1. Thanks in advance. --

Re: Stable GUI + wxPython memory leak

2005-02-17 Thread Viktor
Peter Hansen wrote: > On which platform? On Linux, and I'm watching the percentage of used memory with *top* or *ps v* (I have 256 MB). The aplication started with 19% used and after 45 minutes playing I saw i eat up almost 70%. I also noticed that: >>> from Tkinter import * >>> l = Listbox() >>

Re: Stable GUI + wxPython memory leak

2005-02-16 Thread Viktor
I just noticed that wxPython is leaking memory?! Playing with wxPython-demo, I started with 19MB used, and ended whith almost 150MB used?! It's wxPython 2.5.3.1 running on Python 2.4. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stable GUI

2005-02-16 Thread Viktor
Lars wrote: > Maybe you should describe your particular application and the reasons > why you really need lightspeed widget rendering ? Stability goes > without saying:) It's a GUI for some database input, output routines. It sopouse to wark 24h/day, and about 150 input-outputs/h. Fast: Because i

Stable GUI

2005-02-16 Thread Viktor
Which GUI is the most stable one? I don't need any fancy looking widgets (look and feel doesn't realy matter to me), I "just" need it to be rock stable and fast... -- http://mail.python.org/mailman/listinfo/python-list