Beginning setup problem

2006-11-01 Thread vedran
Hello again,

Before few months,I write to this mailing list with python script
install problem,but nobody give me right solution.I work on windows
XP,and Python 2.4.
Now,when I write in Python 2.4:

>>> from distutils.core import setup
>>> setup(..) # whatever I write

I got the error:


Traceback (most recent call last):
  File "", line 1, in -toplevel-
setup()
  File "C:\Python24\distutils\core.py", line 101, in setup
_setup_distribution = dist = klass(attrs)
  File "C:\Python24\distutils\dist.py", line 130, in __init__
setattr(self, method_name, getattr(self.metadata, method_name))
AttributeError: DistributionMetadata instance has no attribute
'get___doc__'

When I run setup.py with CMD:

python setup.py install   (or build or install)

Again I got the error:
Traceback (most recent call last):
  File "", line 1, in -toplevel-
setup()
  File "C:\Python24\distutils\core.py", line 101, in setup
_setup_distribution = dist = klass(attrs)
  File "C:\Python24\distutils\dist.py", line 130, in __init__
setattr(self, method_name, getattr(self.metadata, method_name))
AttributeError: DistributionMetadata instance has no attribute
'get___doc__'

     Regards,
 Vedran,
v-programs

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


ftplib security support

2006-11-07 Thread vedran
Hello,

One simple question.Which security ftplib support,and how to I 'load'
these security to ftputil.
(Please don't give me security modules)

e.g.


ftp=FTPHost('myhost','myusername','mypassword',session_factory=ftplib.FTP)

 is this example well?  (for loading ftplib security to ftputil)






Thanks

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


directpython application bug

2006-11-09 Thread vedran
Hello,
I using directpython for making 3d miniature applications,but I have
one problem about directpython.
This is my code for example:

import d3d
import d3dc
import d3dx



device=d3d.createDevice()
groundtexture=d3d.Font(u'my program',30)

...and when I run this code, directpython just open window and after
few minutes close the window


  What to I do?


   Thanks!!!

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


directpython object move

2006-11-09 Thread vedran
Hello,

How can I move objects in directpython???













   I appreciate that.Thanks

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


Presenting calculation results

2008-09-10 Thread Vedran
Hello!

I would like to present the results of the calculations on the web using 
Python and Apache. Currently I have java console applications that 
generate text files with results. Can somebody point me in the right 
direction from where to start?

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


Decorators without function

2010-08-09 Thread Vedran
Hello!

Is it possible to apply a decorator on a block of code, without defining 
a function that decorator is applied to. 

I have to generate a lot of similar graphs. For that reason I use 
plot_decorator to perform usual figure setup(outfile, legend, x_label, 
y_label and so on), and pylab.plot commands to do the actual plotting. 

Current solution:

@plot_decorator(fig_params1)
def plt():
pylab.plot(..first graph data...)
pylab.plot(..second graph data..)   
plt()

Is it possible to apply decorator only to the body of plt (several 
pylab.plot commands) without actually defining this function, because I 
use it only once, right after the definition?
-- 
http://mail.python.org/mailman/listinfo/python-list


fsolve() from scipy crashes python on windows

2006-06-06 Thread Vedran Furač
When I call optimize.fsolve(...) python interpreter crashes immediately,
no error messages, nothing, just brings me back to c:\
On linux the same code works fine. I tried it on different computers. I
seems that it doesn't crash on pentium4, only on athlon and pentium2.

python 2.4.3 (activestate), scipy 0.4.8/0.4.9, windows xp


Regards,

Vedran Furač
-- 
http://mail.python.org/mailman/listinfo/python-list


Strange result with math.atan2()

2006-05-02 Thread Vedran Furač
I think that this results must be the same:

In [3]: math.atan2(-0.0,-1)
Out[3]: -3.1415926535897931

In [4]: math.atan2(-0,-1)
Out[4]: 3.1415926535897931

In [5]: -0 == -0.0
Out[5]: True


This is python 2.4.4c0 on Debian GNU/Linux.


Regards,

Vedran Furač


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

Re: Strange result with math.atan2()

2006-05-02 Thread Vedran Furač
Ben Caradoc-Davies wrote:
> Vedran Furač wrote:
>> I think that this results must be the same:
>> In [3]: math.atan2(-0.0,-1)
>> Out[3]: -3.1415926535897931
>> In [4]: math.atan2(-0,-1)
>> Out[4]: 3.1415926535897931
> 
> -0 is converted to 0, then to 0.0 for calculation, losing the sign. You 
> might as well write 0.0 instead of -0
> 
> The behaviour of atan2 conforms to the ISO C99 standard (Python is 
> implemented in C). Changing the sign of the first argument changes the 
> sign of the output, with no special treatment for zero.
> 
> http://www.ugcs.caltech.edu/manuals/libs/mpfr-2.2.0/mpfr_22.html

Well, here I can read:

Special values are currently handled as described in the ISO C99 standard
for the atan2 function (note this may change in future versions):

* atan2(+0, -0) returns +Pi.
* atan2(-0, -0) returns -Pi. /* wrong too */
* atan2(+0, +0) returns +0.
* atan2(-0, +0) returns -0. /* wrong too */
* atan2(+0, x) returns +Pi for x < 0.
* atan2(-0, x) returns -Pi for x < 0


And the formula (also from that site):
if x < 0, atan2(y, x) = sign(y)*(PI - atan (abs(y/x)))
^^^

So, you can convert -0 to 0, but you must multiply the result with sign of
y, which is '-' (minus).

Also, octave:

octave2.9:1> atan2(-0,-1)
ans = -3.1416

or matlab:

>> atan2(-0,-5)

ans =

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

Re: Strange result with math.atan2()

2006-05-02 Thread Vedran Furač
Serge Orlov wrote:

>> So, you can convert -0 to 0, but you must multiply the result with sign of
>> y, which is '-' (minus).
> 
> But you miss the fact that 0 is an *integer*, not a float, and -0
> doesn't exist.

Yes, you are right, I completely missed that 0 is integer in python, and I
need a float.


Regards,

Vedran Furač
-- 
http://mail.python.org/mailman/listinfo/python-list