Multiprocessing PyPy-CPython

2015-11-24 Thread LJ
Hi everyone. Im trying to solve some problems in parallel using the multiprocessing module in Python 2.7. A general model is built using CPython and then the subproblems are solved in parallel returning results in a queue. This is currently working fine. I would like to solve the subproblems us

PyPy subprocess

2015-11-01 Thread LJ
By the way, Im using python 2.7. Thanks -- https://mail.python.org/mailman/listinfo/python-list

PyPy subprocess

2015-11-01 Thread LJ
nd Im seeing savings of 50% in time when using PyPy to somve the subproblems. Any help would be highly appreciated. Lj. -- https://mail.python.org/mailman/listinfo/python-list

pypy - Gurobi solver library

2015-09-29 Thread LJ
Hi All, I use gurobipy to model a large scale optimization problem. Is there a way to use pypy with the gurobipy library? Has anyone done this? Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: A little test for you Guys😜

2015-09-22 Thread Lj Fc via Python-list
On Tuesday, September 22, 2015 at 11:19:00 PM UTC+2, sohca...@gmail.com wrote: > On Tuesday, September 22, 2015 at 11:45:00 AM UTC-7, Lj Fc wrote: > > you have 10 minutes😂 Good luck!! > > > > > > 1. What is PEP8 ? > > > > 2. What are the different way

id() and is operator

2015-02-22 Thread LJ
Hi everyone. Quick question here. Lets suppose if have the following numpy array: b=np.array([[0]*2]*3) and then: >>> id(b[0]) 4582 >>> id(b[1]) 45857512 >>> id(b[2]) 4582 Please correct me if I am wrong, but according to this b[2] and b[0] are the same object. Now, >>> b[0] is b[2]

About Modifying Globals

2014-12-04 Thread LJ
Hi All, I have a quick question regarding the modification of global variables within functions. To illustrate, consider the following toy example: a={"1": set()} b=9 def gt(l): a["1"] = a["1"] | set([l]) When calling this last function and checking the a dictionary, I get: >>> gt(5) >>> a

Re: Comparison

2014-09-22 Thread LJ
On Monday, September 22, 2014 1:12:23 PM UTC-4, Chris Angelico wrote: > On Tue, Sep 23, 2014 at 2:57 AM, LJ wrote: > > > Quick question here. In the code I am working on I am apparently doing a > > lot of dictionary lookups and those are taking a lot of time. > > >

Comparison

2014-09-22 Thread LJ
Hi All, Quick question here. In the code I am working on I am apparently doing a lot of dictionary lookups and those are taking a lot of time. I looked at the possibility of changing the structure and I found about the numpy structured arrays. The concrete question is: what would be the differe

Iterating through set

2014-07-14 Thread LJ
Hi All. I'm coding a Dynamic Programming algorithm to solve a network flow problem. At some point in the algorithm I have to iterate through a set of nodes, while adding and/or removing elements, until the set is empty. I know a regular set() object does not work in a case like this, so I wonde

Re: Numpy Array of Sets

2014-05-25 Thread LJ
Thank you very much! -- https://mail.python.org/mailman/listinfo/python-list

Re: Numpy Array of Sets

2014-05-25 Thread LJ
Thank you for the reply. So, as long as I access and modify the elements of, for example, A=array([[set([])]*4]*3) as (for example): a[0][1] = a[0][1] | set([1,2]) or: a[0][1]=set([1,2]) then I should have no problems? -- https://mail.python.org/mailman/listinfo/python-list

Re: Numpy Array of Sets

2014-05-25 Thread LJ
Wolfgang, thank you very much for your reply. Following the example in the link, the problem appears: >>> A = [[0]*2]*3 >>> A [[0, 0], [0, 0], [0, 0]] >>> A[0][0] = 5 >>> A [[5, 0], [5, 0], [5, 0]] Now, if I use a numpy array: >>> d=array([[0]*2]*3) >>> d array([[0, 0], [0, 0], [0

gmail/poplib: quickly detecting new mail

2006-07-01 Thread LJ
. (see code sample below) Thanks, LJ --- import poplib import time from email.Parser import Parser parser = Parser() server = poplib.POP3_SSL("pop.gmail.com", 995) print server.user("XXX-MY_EMAIL") print server.pass_("XXX-MY_PW") server.set_debuglevel(0) def ge