Hi,
I defined a class called vec3 which contains x, y, z and in another
function, I tried to call a function which takes a vec3 as a parameter, but
it seems that parameter is passed as a generic object and I can not access x
, y, z in my vec3. Could anyone help me with that?
class vec3:
def
at 5:50 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
> On Wed, Oct 8, 2008 at 4:36 PM, Wei Guo <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I defined a class called vec3 which contains x, y, z and in another
> > function, I tried to call a function which takes a
TED]> wrote:
> Wei Guo wrote:
>
>> Hi Chris,
>> Thanks a lot for reply, you are right. I want to use this method as a
>> static method as:
>> translation = staticmethod( translation )
>>
>
> static methods are mostly useless in Python. Just put the
Hi all,
I am new of python. Could anyone help me a question as below?
Is there any function that can judge a string s is a float number or not?
FOr example, if s = '1.232' or s='1e+10', then it returns true, otherwise,
it will return false.
isdigit() in string doesn't work. float() will throw an
rror. Any
> other exception *should* be uncaught if it happens. By the way, this method
> will return true for integers as well as floats. For example, isFloat('3')
> will return 3.0. So make sure this is what you want, since it wasn't 100%
> clear from the original message
Hi I tried the first type method but it seens that it doesn't work. Could
anyone help me about it?
>>> s = '3.145'
>>> type(s) == type(float())
False
>>> type(s)
>>> type(float())
>>>
Best regards,
Wei
On 8/7/08, Wei Guo <[EM
27;
> In [2]: n = float(s)
> In [3]: type(s)
> Out[3]:
> In [4]: type(n)
> Out[4]:
>
> Why are you avoiding the very simple try:/except: solution to this problem?
>
> On Thu, Aug 7, 2008 at 1:28 PM, Wei Guo <[EMAIL PROTECTED]> wrote:
> > Hi I tried the firs