Sorry about that, here is a summary of my complete code. I haven't cleaned
it up much or anything, but this is what it does:
import time
import multiprocessing
test_constx =0
test_consty =0
def functionTester(x):
global test_constx
global test_consty
print "constx " + str(test_constx)
pr
"News Wombat" wrote in message
news:2abdd9b3-66ec-4125-a5f8-41315008c...@l17g2000yqe.googlegroups.com...
Hi everyone,
I've been experimenting with the ctypes module and think it's great.
I'm hitting a few snags though with seg faults. I attached two links
that holds the code. The line i'm h
Hi Experts,
got ready made code for ssh to unix using python
host machine is windows now when i run this its gives following error :
*
Traceback (most recent call last):
File "C:\Python26\pexpect-2.1\pexpect-2.1\pxssh.py", line 1, in
from pexpect import *
File "C:\Python26\pexpect-2.1\pexpect-2.1
geremy condra wrote:
> On Fri, Dec 10, 2010 at 4:42 AM, Astan Chee wrote:
>> On Fri, Dec 10, 2010 at 1:37 AM, Peter Otten <__pete...@web.de> wrote:
>>>
>>> I can't replicate the crash. However, your problem looks like there is a
>>> ready-to-use solution:
>>>
>>>
>>> http://docs.python.org/librar
John Nagle, 11.12.2010 00:51:
On 12/10/2010 3:25 PM, Stefan Behnel wrote:
Benjamin Kaplan, 11.12.2010 00:13:
On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote:
The only scopes Python has are module and function.
There's more. Both a lambda, and in Python 3.x,
list comprehensions, int
On Fri, Dec 10, 2010 at 3:51 PM, John Nagle wrote:
> On 12/10/2010 3:25 PM, Stefan Behnel wrote:
>>
>> Benjamin Kaplan, 11.12.2010 00:13:
>>>
>>> On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote:
>
>>> The only scopes Python has are module and function.
>
> There's more. Both a lambda, a
On 12/10/2010 3:25 PM, Stefan Behnel wrote:
Benjamin Kaplan, 11.12.2010 00:13:
On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote:
The only scopes Python has are module and function.
There's more. Both a lambda, and in Python 3.x,
list comprehensions, introduce a new scope.
Hi everyone,
I've been experimenting with the ctypes module and think it's great.
I'm hitting a few snags though with seg faults. I attached two links
that holds the code. The line i'm having problems with is this,
sn=clibsmi.smiGetNextNode(pointer(sno),SMI_NODEKIND_ANY)
It will work one time,
Benjamin Kaplan, 11.12.2010 00:13:
On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote:
How narrow are the scopes in Python?
Is each block (each level of indentation) a scope?
If it is, then I think it is very enough because the other cases can be
detected easier or it might not appear at a
On Sat, 11 Dec 2010 00:46:41 +0200, Octavian Rasnita wrote:
> How narrow are the scopes in Python?
> Is each block (each level of indentation) a scope?
Thankfully, no.
> If it is, then I
> think it is very enough because the other cases can be detected easier
> or it might not appear at all in
John Nagle, 10.12.2010 21:02:
Probably the biggest practical problem with CPython is
that C modules have to be closely matched to the version of
CPython. There's no well-defined API that doesn't change.
Well, there are no huge differences between CPython versions (apart from
the Py_ssize_t cha
On Fri, Dec 10, 2010 at 5:46 PM, Octavian Rasnita wrote:
> From: "John Nagle"
>> On 12/10/2010 2:31 AM, kolo 32 wrote:
>>> Hi, all,
>>>
>>> Python critique from strchr.com:
>>>
>>> http://www.strchr.com/python_critique
>>
>> I have criticisms of Python, but those aren't them.
>>
>> Probably
On Fri, 10 Dec 2010 12:02:21 -0800
John Nagle wrote:
>
> Probably the biggest practical problem with CPython is
> that C modules have to be closely matched to the version of
> CPython. There's no well-defined API that doesn't change.
Please stop spreading FUD:
http://docs.python.org/c-api/i
From: "John Nagle"
> On 12/10/2010 2:31 AM, kolo 32 wrote:
>> Hi, all,
>>
>> Python critique from strchr.com:
>>
>> http://www.strchr.com/python_critique
>
>I have criticisms of Python, but those aren't them.
>
>Probably the biggest practical problem with CPython is
> that C modules have
ActiveState is pleased to announce ActivePython 3.1.3.5, a complete,
ready-to-install binary distribution of Python 3.1.
http://www.activestate.com/activepython/downloads
What's New in ActivePython-3.1.3.5
==
*Release date: 6-Dec-2010*
New Features & Upgrade
On 12/10/2010 2:22 PM Ian said...
On Dec 10, 3:06 pm, Stefaan Himpe wrote:
Somehow, in the first session I cannot modify the global variable a
returned from f, but in the second session I can. To my eye, the only
difference seems to be a namespace. Can anyone shine some light on this
matter?
On Dec 10, 3:06 pm, Stefaan Himpe wrote:
> Somehow, in the first session I cannot modify the global variable a
> returned from f, but in the second session I can. To my eye, the only
> difference seems to be a namespace. Can anyone shine some light on this
> matter?
It's not the same global varia
Hello list,
Recently someone asked me this question, to which I could not give an
answer. I'm hoping for some insight, or a manual page. What follows is
python 2.6.
The problem is with the difference between
from test import *
and
import test
First things first. Here's the code to test.py
On Fri, Dec 10, 2010 at 4:42 AM, Astan Chee wrote:
> On Fri, Dec 10, 2010 at 1:37 AM, Peter Otten <__pete...@web.de> wrote:
>>
>> I can't replicate the crash. However, your problem looks like there is a
>> ready-to-use solution:
>>
>>
>> http://docs.python.org/library/multiprocessing.html#using-a-
On Fri, 10 Dec 2010 11:51:44 -0800, Ross wrote:
> Since I can't control the encoding of the input file that users
> submit, how to I get past this? How do I make such comparisons be
> True?
On Fri, 10 Dec 2010 12:07:19 -0800, Ross wrote:
> I found I could import codecs that allow me to read the
Dirk Nachbar writes:
> I want to take a copy of a list a
>
> b=a
In addition to the other good replies you've received:
To take a copy of an object, the answer is never ‘b = a’. That binds a
reference ‘b’ to the same object referenced by ‘a’.
The assignment operator ‘=’ never copies; it binds
On Dec 10, 2:51 pm, Ross wrote:
> Initially I was simply doing:
>
> currs = [u'$', u'£', u'€', u'¥']
> aFile = open(thisFile, 'r')
> for mline in aFile: # mline might be "£5.50"
> if item[0] in currs:
> item = item[1:]
>
Don't you love it when someone solves the
On 12/10/2010 2:31 AM, kolo 32 wrote:
Hi, all,
Python critique from strchr.com:
http://www.strchr.com/python_critique
I have criticisms of Python, but those aren't them.
Probably the biggest practical problem with CPython is
that C modules have to be closely matched to the version of
C
http://www.globalresearch.ca/index.php?context=viewArticle&code=20060212&articleId=1955
Evgeny Chossudovsky: Writer with a distinguished UN career
Global Research, February 12, 2006
The Irish Times - 2006-01-18
Throughout his UN career and until his death, Evgeny Chossudovsky
expressed his firm
On Dec 8, 6:26 pm, Christian Heimes wrote:
> There isn't a way to limit access to a single process. mkdtemp creates
> the directory with mode 0700 and thus limits it to the (effective) user
> of the current process. Any process of the same user is able to access
> the directory.
>
> Christian
Qui
I've a character encoding issue that has stumped me (not that hard to
do). I am parsing a small text file with some possibility of various
currencies being involved, and want to handle them without messing up.
Initially I was simply doing:
currs = [u'$', u'£', u'€', u'¥']
aFile = open(thisFil
On 10/12/2010 17:52, Dennis Lee Bieber wrote:
On Fri, 10 Dec 2010 23:02:24 +1100, Astan Chee
declaimed the following in gmane.comp.python.general:
for thread in threads:
if not thread.is_alive():
threads.remove(thread)
I can see a potential flaw ju
On Fri, Dec 10, 2010 at 9:32 AM, Ian wrote:
> On Dec 10, 9:57 am, hoesley wrote:
>> I just started using distutils to install the modules I'm working on
>> to site-packages. Now, however, if I make changes in my development
>> directory, then import the modules into python, it always loads up the
I manged to get my python app past 3GB on a smaller 64 bit machine.
On a test to check memory usage with gc disabled only an extra 6MB was used.
The figures were 1693MB to 1687MB.
This is great.
Thanks again for the help.
On 10 December 2010 13:54, Rob Randall wrote:
> You guys are right. If
For Programming puzzles visit the blog
http://coders-stop.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 10, 10:17 am, Jean-Michel Pichavant
wrote:
Hi Jean-Michel,
I think Antoine answered your other points, so I'll address the last
one:
> Last question, if no handler is found, why not simply drop the log
> event, doing nothing ? It sounds pretty reasonable and less intrusive.
That is what
cassiope wrote:
Alternatively, you can write
import copy
a = [1,2,3]
b = a.copy()
JM
I'm not a pyguru, but... you didn't use copy quite right.
Try instead: b= copy.copy(a)
You're right, you're not a python guru so don't even try to contradict
me ever again.
...
:D of course I di
On Dec 10, 9:57 am, hoesley wrote:
> I just started using distutils to install the modules I'm working on
> to site-packages. Now, however, if I make changes in my development
> directory, then import the modules into python, it always loads up the
> installed version. Thus, I can't continue devel
In my system (Ubuntu 10.04) there are sage-4.6, python 2.6.5, tk8.5-
dev installed. When I give command from terminal "sage -f
python-2.6.5.p8" to get sage's python it shows following message:
No command 'sage' found, did you mean:
Command 'save' from package 'atfs' (universe)
Command 'page' fr
I just started using distutils to install the modules I'm working on
to site-packages. Now, however, if I make changes in my development
directory, then import the modules into python, it always loads up the
installed version. Thus, I can't continue development without first
uninstalling the module
Has anyone ever built some sort of optparse/argparse module for cgi/
wsgi programs? I can see why a straight port wouldn't work, but a
module that can organize parameter handling for web pages seems like a
good idea, especially if it provided a standard collection of both
client- and server-side v
On Dec 10, 8:48 am, Dirk Nachbar wrote:
> I want to take a copy of a list a
>
> b=a
>
> and then do things with b which don't affect a.
>
> How can I do this?
>
> Dirk
Not knowing the particulars,
you may have to use:
import copy
b=copy.deepcopy(a)
--
http://mail.python.org/mailman/listinfo/pyt
On Dec 10, 10:53 am, rusi wrote:
> Ive installed python 2.7
> And trace still ignores my ignore-module etc requests
Is this a know bug with the trace module?
I find it hard to believe that as traces naturally tend to get huge
unless carefully trimmed
--
http://mail.python.org/mailman/listinfo/py
On Dec 10, 9:17 pm, nn wrote:
> On Dec 9, 10:15 pm, rusi wrote:
>
> > In trying to get from 2.x to 3 Terry suggested I use 2.7 with
> > deprecation warnings
>
> > Heres the (first) set
>
> > DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
> > in 3.x
> > DeprecationWarning: ca
On 10/12/2010 16:17, nn wrote:
On Dec 9, 10:15 pm, rusi wrote:
In trying to get from 2.x to 3 Terry suggested I use 2.7 with
deprecation warnings
Heres the (first) set
DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
in 3.x
DeprecationWarning: callable() not supported in 3
On Dec 10, 11:17 am, nn wrote:
> On Dec 9, 10:15 pm, rusi wrote:
>
> > In trying to get from 2.x to 3 Terry suggested I use 2.7 with
> > deprecation warnings
>
> > Heres the (first) set
>
> > DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
> > in 3.x
> > DeprecationWarning: c
On Dec 10, 6:06 am, Jean-Michel Pichavant
wrote:
> Dirk Nachbar wrote:
> > I want to take a copy of a list a
>
> > b=a
>
> > and then do things with b which don't affect a.
>
> > How can I do this?
>
> > Dirk
>
> In [1]: a = [1,2,3]
>
> In [2]: b = a[:]
>
> In [3]: b[0] = 5
>
> In [4]: a
> Out[4]:
On Dec 9, 10:15 pm, rusi wrote:
> In trying to get from 2.x to 3 Terry suggested I use 2.7 with
> deprecation warnings
>
> Heres the (first) set
>
> DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__
> in 3.x
> DeprecationWarning: callable() not supported in 3.x; use isinstance(x
From: "Jean-Michel Pichavant"
>
> Octavian Rasnita wrote:
>> It is true that Python doesn't use scope limitations for variables?
>>
>> Octavian
>>
> Python does have scope. The problem is not the lack of scope, to
> problem is the shadow declaration of some python construct in the
> curren
Hello ... I'm using buildbot to build some of my projects. I'm
having problems when I configure it and I think it might be with the
python configuration on my pc:
I'm getting this error:
Traceback (most recent call last): File "/usr/bin/buildbot", line 3, in
from buildbot.scripts import ru
On Freitag 10 Dezember 2010, Dirk Nachbar wrote:
> > b=a[:]
> >
> > --
> > Wolfgang
>
> I did that but then some things I do with b happen to a as
> well.
as others said, this is no deep copy. So if you do something
to an element in b, and if the same element is in a, both
are changed as they ar
Jean-Michel Pichavant, 10.12.2010 15:02:
the shadow declaration of some python construct in the current scope.
print x # raise NameError
[x for x in range(10)] # shadow declaration of x
print x # will print 9
Note that this is rarely a problem in practice, and that this has been
fixed in Pyth
On Dec 10, 1:56 pm, Wolfgang Rohdewald wrote:
> On Freitag 10 Dezember 2010, Dirk Nachbar wrote:
>
> > I want to take a copy of a list a
>
> > b=a
>
> > and then do things with b which don't affect a.
>
> > How can I do this?
>
> > Dirk
>
> b=a[:]
>
> --
> Wolfgang
I did that but then some things
Dirk Nachbar wrote:
I want to take a copy of a list a
b=a
and then do things with b which don't affect a.
How can I do this?
Dirk
In [1]: a = [1,2,3]
In [2]: b = a[:]
In [3]: b[0] = 5
In [4]: a
Out[4]: [1, 2, 3]
In [5]: b
Out[5]: [5, 2, 3]
Alternatively, you can write
import copy
a
Steven D'Aprano writes:
> On Thu, 09 Dec 2010 12:21:45 +, Mark Wooding wrote:
>
> > John Nagle writes:
>
> >> "sort" has failed because it assumes that a < b and b < c implies a <
> >> c. But that's not a valid assumption here.
> >>
> >> It's not good to break trichotomy.
> >
> > You're con
Octavian Rasnita wrote:
It is true that Python doesn't use scope limitations for variables?
Octavian
Python does have scope. The problem is not the lack of scope, to
problem is the shadow declaration of some python construct in the
current scope.
print x # raise NameError
[x for x in ra
On Freitag 10 Dezember 2010, Dirk Nachbar wrote:
> I want to take a copy of a list a
>
> b=a
>
> and then do things with b which don't affect a.
>
> How can I do this?
>
> Dirk
b=a[:]
--
Wolfgang
--
http://mail.python.org/mailman/listinfo/python-list
b = list(a)
or
b = a[:]
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Dec 10, 2010 at 7:18 PM, Dirk Nachbar wrote:
> I want to take a copy of a list a
>
> b=a
>
> and then do things with b which don't affect a.
>
> How can I do this?
>
b = a[:] will create a copy of the list. If the elements of the list
are references to mutable objects (objects of your ow
You guys are right. If I disable the gc it will use all the virtual RAM in
my test.
The application I have been running these tests for is a port of a program
written in a LISP-based tool running on Unix.
It does a mass of stress calculations.
The port has been written using a python-based toolki
I want to take a copy of a list a
b=a
and then do things with b which don't affect a.
How can I do this?
Dirk
--
http://mail.python.org/mailman/listinfo/python-list
It is true that Python doesn't use scope limitations for variables?
Octavian
- Original Message -
From: "kolo 32"
Newsgroups: comp.lang.python
To:
Sent: Friday, December 10, 2010 12:31 PM
Subject: Python critique
> Hi, all,
>
> Python critique from strchr.com:
>
> http://www.strchr
On Fri, Dec 10, 2010 at 1:37 AM, Peter Otten <__pete...@web.de> wrote:
> I can't replicate the crash. However, your problem looks like there is a
> ready-to-use solution:
>
> http://docs.python.org/library/multiprocessing.html#using-a-pool-of-workers
>
> --
> http://mail.python.org/mailman/listinf
I just saw this:
http://bugs.python.org/issue8094
which seem to be similar to what I'm having. Does anyone know if there is a
fix for it?
Thanks again
On Fri, Dec 10, 2010 at 11:02 PM, Astan Chee wrote:
> Thanks for that. I'll try and see if it makes any difference but I'm using
> python 2.6 not
Thanks for that. I'll try and see if it makes any difference but I'm using
python 2.6 not 3
Are the multiprocessing modules different? That code (or whatever is using
the multiprocessing module) seems to cause infinite python processes on my
machine and eventually kills it.
I'm running python 2.6 o
On Fri, 10 Dec 2010 11:17:33 +0100
Jean-Michel Pichavant wrote:
> Why would you log informative messages to stderr ? (debug, info, warning)
> How stderr is a better choice than stdout ?
By construction really. stderr is initially for errors, but it is
generally used for "out of band" messages suc
On 01/-10/-28163 02:59 PM, frank cui wrote:
Hi all,
I'm a novice learner of python and get caught in the following trouble and
hope experienced users can help me solve it:)
Code:
---
$ cat Muffle_ZeroDivision.py
#!/usr/bin/env
Hi, all,
Python critique from strchr.com:
http://www.strchr.com/python_critique
--
http://mail.python.org/mailman/listinfo/python-list
mark jason wrote:
On Dec 10, 11:55 am, Steven D'Aprano wrote:
# By the way, IOError is not the only exception you could see.
thanks for the help Steven. Is it OK to catch Exception instead of
IOError ?
In some operation which can cause many errors ,can I use the
following?
try:
Hi all,
I'm a novice learner of python and get caught in the following trouble and
hope experienced users can help me solve it:)
Code:
---
$ cat Muffle_ZeroDivision.py
#!/usr/bin/env python
class MuffledCalculator:
muffled =
Vinay Sajip wrote:
Some changes are being proposed to how logging works in default
configurations.
Briefly - when a logging event occurs which needs to be output to some
log, the behaviour of the logging package when no explicit logging
configuration is provided will change, most likely to log t
mark jason wrote:
> hi
> I was trying out some file operations and was trying to open a non
> existing file as below
>
> def do_work(filename):
> try:
> f = open(filename,"r");
> print 'opened'
> except IOError, e:
> print 'failed',e.message
> finally:
>
On Dec 10, 11:55 am, Steven D'Aprano wrote:
> # By the way, IOError is not the only exception you could see.
thanks for the help Steven. Is it OK to catch Exception instead of
IOError ?
In some operation which can cause many errors ,can I use the
following?
try:
do_something()
except Ex
On 12/10/2010 4:52 AM, small Pox wrote:
[... irrelevant stuff...]
> I advocate neither anti semitism nor pro semitism. just the rule of
> law that treats people equally and fairly and where money does not
> count. this cannot be achieved without demolishing fractional reserve
> lending, and not wit
69 matches
Mail list logo