Can parellelized program run slower than single process program?

2012-06-20 Thread Yesterday Paid
from multiprocessing import Pool
from itertools import product

def sym(lst):
x,y=lst
tmp=x*y
if rec(tmp):
return tmp
else:
return None

def rec(num):
num=str(num)
if num == "".join(reversed(num)):return True
else:return False

if __name__ == "__main__":
pool=Pool(processes=8)
lst=product(xrange(100,1000),repeat=2)
rst=pool.map(sym,lst)
#rst=sym(lst)
print max(rst)


in my old computer(2006),
when run it on single process, it takes 2 seconds
but using multiprocessing.pool, it takes almost 8 or 9 seconds
is it possible?
-- 
http://mail.python.org/mailman/listinfo/python-list


which one do you prefer? python with C# or java?

2012-06-09 Thread Yesterday Paid
I'm planning to learn one more language with my python.
Someone recommended to do Lisp or Clojure, but I don't think it's a
good idea(do you?)
So, I consider C# with ironpython or Java with Jython.
It's a hard choice...I like Visual studio(because my first lang is VB6
so I'm familiar with that)
but maybe java would be more useful out of windows.

what do you think?
-- 
http://mail.python.org/mailman/listinfo/python-list


When adding my application to Windows right-click menu

2012-06-13 Thread Yesterday Paid
I made a cipher app but to make easy, I want to make it Windows
rightclick menu can execute it
I found the way with dealing with Registry


[HKEY_CLASSES_ROOT\Directory\Background\shell\app]
 [HKEY_CLASSES_ROOT\Directory\Background\shell\app\command]
 @="C;\myapp filelocation"


but I don't know how to automatically get filelocation
Can I get the address of file that I right_clicked(it's not a proper
expression maybe)
-- 
http://mail.python.org/mailman/listinfo/python-list


python's future?

2012-06-15 Thread Yesterday Paid
I'm very new to programing though I learn very little of java,C
I love python and have fun to do something with it
but some people said python's future perhaps not that bright.
I know this question maybe looks like an idiot:(
I really hope the python rules long~ time.
what do you think about future of this lang
or famous lang like C, JAVA, C#, LISP &C
-- 
http://mail.python.org/mailman/listinfo/python-list


does python have bright future?

2012-06-15 Thread Yesterday Paid
I'm very new to programing though I learn very little of java,C
I love python and have fun to do something with it
but some people said python's future perhaps not that bright.
I know this question maybe looks like an idiot:(
I really hope the python rules long~ time.
what do you think about future of this lang
or famous lang like C, JAVA, C#, LISP &C
-- 
http://mail.python.org/mailman/listinfo/python-list


Is that safe to use ramdom.random() for key to encrypt?

2012-06-16 Thread Yesterday Paid
I'm making cipher program with random.seed(), random.random() as the
key table of encryption.
I'm not good at security things and don't know much about the
algorithm used by random module.

Is it really random or safe enough to keep my data safe?
-- 
http://mail.python.org/mailman/listinfo/python-list