ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Python Packages for Complex Numbers and Matrix Math
by Ignacio Vazquez-Abrams other posts by this author
Aug 27 2001 2:13AM messages near this date
Re: Python Packages for Complex Numbers and Matrix Math | problem with pythonwin32
On Mon, 27 Aug 2001, Maan Hamze wrote:

> 
>  "Ignacio Vazquez-Abrams" <ignacio@[...].net> wrote in message
>  news:mailman.998866419.18595.python-list@[...]..
>  > On Sun, 26 Aug 2001, Maan Hamze wrote:
>  >
>  > > 2.  Also,
>  > > >>> x = 4 + 7j
>  > > >>> x.imag = 6
>  > > error:  object has a read-only attrib
>  > > >>> x.real = 7
>  > > same error of read-olny attrib
>  > >
>  > > why?
>  >
>  > Because. I could look into the source (or point you to the source), but
>  the
>  > answer would still simply be "Because".
>  >
>  So to pass a value to either the imag or real part:
>  >>> a=1
>  >>> b=2
>  >>> c=complex(a,b)
>  >>> b = 3
>  >>> c=complex(a,b)
>  and so on........
>  or something like:
>  >>> def PassValue(a,b):
>  ...  r=complex(a,b)
>  ...  return r
>  Maan

Yeah. Or you could do something like 'r=complex(r.real, 6)', or 'r=complex(7,
r.imag)', or 'r=complex(-(r.imag), r.real)', etc.

-- 
Ignacio Vazquez-Abrams  <ignacio@[...].net> 


-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Maan Hamze
Ignacio Vazquez-Abrams

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved