On Nov 21, 5:33 pm, sword wrote:
> My colleague asks me an interesting problem about uuid library in
> python. In multicore system with multiprocessing, is it possible to
> get the duplicated uuid with uuid1?
>
> I just check the RFC 4122, and I can't find anything about multicore
> environment. P
Victor Subervi wrote:
> I think I finally have an interesting problem for y'all. I need to import a
> script from a lower dir, forcing me to change dirs:
I'm surprised that no one has yet mentioned packages.
Suppose you have the following folder layout and you stick an empty
__init__.py in each s
Victor Subervi wrote:
> Hi;
> I think I finally have an interesting problem for y'all. I need to import a
> script from a lower dir, forcing me to change dirs:
>
> cwd = os.getcwd()
> os.chdir('%s/..' % cwd)
> sys.path.append(os.getcwd())
> from templateFrame import top, bottom
> os.chdir(cwd)
I
James Matthews wrote:
Also as a side point... It's best to anonymize the code as best you can
so people cannot attach your code to your site (IP theft and security risk)
[snip]
Security risk, yes; IP theft, not so much. ;-)
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jan 20, 2010 at 12:30 PM, Stephen Hansen wrote:
> On Wed, Jan 20, 2010 at 7:19 AM, Victor Subervi
> wrote:
>
>> Hi;
>> I think I finally have an interesting problem for y'all. I need to import
>> a script from a lower dir, forcing me to change dirs:
>>
>
> Don't do that. If you must, then
Also as a side point... It's best to anonymize the code as best you can so
people cannot attach your code to your site (IP theft and security risk)
On Wed, Jan 20, 2010 at 8:38 AM, MRAB wrote:
> Victor Subervi wrote:
>
>> Hi;
>> I think I finally have an interesting problem for y'all. I need to
Victor Subervi wrote:
Hi;
I think I finally have an interesting problem for y'all. I need to
import a script from a lower dir, forcing me to change dirs:
Wait a moment... Your assumption that you need to change directories is
invalid. (And that means everything you do below this point unnec
Victor Subervi wrote:
Hi;
I think I finally have an interesting problem for y'all. I need to
import a script from a lower dir, forcing me to change dirs:
cwd = os.getcwd()
os.chdir('%s/..' % cwd)
sys.path.append(os.getcwd())
from templateFrame import top, bottom
os.chdir(cwd)
There's no need
On Wed, Jan 20, 2010 at 7:19 AM, Victor Subervi wrote:
> Hi;
> I think I finally have an interesting problem for y'all. I need to import a
> script from a lower dir, forcing me to change dirs:
>
Don't do that. If you must, then the correct way to do it is to adjust your
sys.path and not change di
On Mon, 11 Jan 2010 18:57:24 +0100, mk wrote:
>> I have two lists of IP addresses:
>>
>> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>>
>> thread_results = [ 'd', 'b', 'c' ]
>>
>> I need to sort thread_results in the same order as hostips.
>
> P.S. One clarification: those lists are actually more co
mk writes:
> I have two lists of IP addresses:
>
> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>
> thread_results = [ 'd', 'b', 'c' ]
>
> I need to sort thread_results in the same order as hostips.
Assuming each address in hostips appears just once:
from itertools import izip,count
d = dict(iz
mk wrote:
> mk wrote:
>> Hello everyone,
>>
>> I have two lists of IP addresses:
>>
>> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>>
>> thread_results = [ 'd', 'b', 'c' ]
>>
>> I need to sort thread_results in the same order as hostips.
>
> P.S. One clarification: those lists are actually more com
mk wrote:
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
(thread_result is a
mk writes:
> Hello everyone,
>
> I have two lists of IP addresses:
>
> hostips = [ 'a', 'b', 'c', 'd', 'e' ]
>
> thread_results = [ 'd', 'b', 'c' ]
>
> I need to sort thread_results in the same order as hostips.
[...solution:]
> hostips_limited = []
> for h in hostips:
> if h in thread_resul
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
(thread_result is a list of tup
mk wrote:
Incidentally, it *seems* that list comprehension preserves order:
hostips_limited = [ h for h in hostips if h in thread_results ]
Empirically speaking it seems to work (I tested it on real ips), but
please correct me if that's wrong.
Regards,
mk
Sounds good to me.
List are *o
16 matches
Mail list logo