>
> val('self.' + attr + '=\'' + val + '\'')
>
Obviously that was eval, not val. Also it doesn't work without the escaped
single quotes, either.
--
http://mail.python.org/mailman/listinfo/python-list
#x27;
^
SyntaxError: invalid syntax
So, uh, I'm wondering if this is a bug. And also the solution to his
problem.
Good luck. Any ideas appreciated.
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
--
http://mail.python.org/mailman/listinfo/python-list
.
Right, so for i in xrange() would be a better choice?
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
--
http://mail.python.org/mailman/listinfo/python-list
gt; is not really an exceptional case.
>
> If you insists on using a try-except clause, use it this way:
>
> Well, I don't have to use try-except. I think I got another idea though. I
could use an internal counter to keep track of how many prime numbers have
generated, and if not eno
erate from n=2 and on every
time, which makes generation time linear.
However, I just gave the link's code a quick try. It was at least 10x times
faster than my code to generate 100000 prime numbers - I'll have a closer
look.
Thanks a great deal.
Ching-Yun "Xavier" Ho, Technical
as well as the previous version, but slightly safer on my
part... and I can adapt this in my future coding habits.
Thanks again.
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http
, common sense. Also... "while True" has a bad reputation.
But mostly outside influences.
But if it's okay, it's okay by me.. I can't think of an easier way to code
the "try loop" above, anyhow.
Ching-Yun "Xavier" Ho, Technical Artist
Contact Informa
pends it into primes.
This way, it keeps trying to append until the nth prime requested exist, and
returns it.
My problem is that it's a "While True" loop, which I get a lot of "Don't do
it!" In the light of making the code better, what could I do?
Best regards,
see? the while body ran for about 7 seconds... i bet it has to do with the
> fact that the timer does not control inner loops... any suggestion?
>
>
I'm guessing it has to do with a sleep of 0.66 seconds x 10 times = sleep
for 6.6 seconds, and then it checks for e.isSet().
Best rega
I see. Thanks!
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
On Tue, Jul 14, 2009 at 11:20 PM, Jochen Schulz wrote:
> Xavier Ho:
> >
> > Why doesn
w, but I'm probably missing something. Any pointers would
be great.
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
--
http://mail.python.org/mailman/listinfo/python-list
e list mycontacts ,like
> mycontacts_numbers=3 <http://mail.python.org/mailman/listinfo/python-list>
>
>>> len(emails['mycontacts'])
3
HTH,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
--
http://mail.python.org/mailman/listinfo/python-list
lines = f0.readlines()*
Then in the for loop, change f1 to
*f1=lines[i].split()*
That may just stop it from complaining.
Untested, but logically it's sound.
Hope that works,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaX
Thanks for the response all, I finally got my 'net working on the mountains,
and I think your reasons are quite sound. I'll keep that in mind for the
future.
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID:
ing is 40x slower, and was expected. But I still
can't puzzle out why his use of appending in Version B was so much faster
than mine.
Any insights would be welcome. I'm going on a family trip, though, so my
replies may delay.
Best regards,
Ching-Yun "Xavier" Ho, Technical Arti
command like this:
python .py
That should do the trick. Alternatively, you can type in python and start
the python shell in the same folder.
Then you can just do import and whatever you like. :]
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04
ding to mailing list for some reason. What happend to the
reply-to request? =/)
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
--
http://mail.python.org/mailman/listinfo/python-list
(arg, MRAB, sorry, wrong address!)
Defining None to 0 is a bad idea. You'll have trouble debugging later on.
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavierho.com/
On Tu
x27;m just getting this "necessary" step because my books say so. If anyone
has a good explanation, please do tell.
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://x
to begin?
>
> x = max(0, min(100, normalvariate(x, y)))
>
>
That is an awesome way of shorthanding clamp.
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xavier
hat was to print out 10 random samples.
If you're not sure if this is what you want, then um.. not much I can do
there. What is this class originally for?
If you feel the clamp is too huge, well, I'm always interested in
improvements/alternatives!
Best regards,
Ching-Yun "Xavier"
:
print applicant(random.randint(0,100),
random.randint(0,100)).randomnum
==
Or you could just use randint() if you only wanted a linear distribution.
PS: Thanks, btw, new to python myself also, and looking into this was cool.
:]
I'm quite curious as to why you would like it, because:
>>> MyClass
(returns the MyClass class representation)
>>> MyClass()
(returns a instance of the MyClass class)
So, are you just looking for a method that does exactly the above?
Best regards,
Ching-Yun "
erent ways of launching
the program. And share with us what you did to run this to begin with, that
might help as well.
Best regards,
Ching-Yun "Xavier" Ho, Technical Artist
Contact Information
Mobile: (+61) 04 3335 4748
Skype ID: SpaXe85
Email: cont...@xavierho.com
Website: http://xav
201 - 224 of 224 matches
Mail list logo