On Tue, Feb 24, 2015 at 5:56 PM, Steven D'Aprano
wrote:
> Most people are not using the bleeding edge version of Python, and even
> those who do, aren't usually using it in production. There are still plenty
> of people using Python 2.3 in production, and even a few using 1.5.
>
> But as you say,
Paul Rubin wrote:
>> With threads in a single process, this isn't a problem. They all
>> access the same memory space, so they can all share state. As soon as
>> you go to separate processes, these considerations become serious.
>
> Right, that's a limitation of processes compared to threads.
>
Chris Angelico wrote:
> On Mon, Feb 23, 2015 at 6:41 PM, Steven D'Aprano
> wrote:
- and you must be using libraries and tools which prevent you moving to
Jython or IronPython or some other alternative.
>>>
>>> I don't get this at all. Why should I not want Python to have the same
>>> c
Ned Deily wrote:
> In article <54ebdcfa$0$11100$c3e8...@news.astraweb.com>,
> Steven D'Aprano wrote:
>> Almost right!
>>
>> You can install Python from source. Unzip the source tar ball, cd into
>> the source directory, and run:
>>
>> ./configure
>> make
>>
>> BUT do *not* run `make install`
On Tue, Feb 24, 2015 at 4:27 PM, Paul Rubin wrote:
>> Sure, your code might not be making any mutations (that you know of),
>> but malloc definitely is [1], and that's just the tip of the iceberg.
>> Other things like buffers for stdin and stdout, DNS resolution etc.
>> all have the same issue.
>
Ryan Stuart writes:
> I'm not sure what else to say really. It's just a fact of life that
> Threads by definition run in the same memory space and hence always
> have the possibility of nasty unforeseen problems. They are unforeseen
> because it is extremely difficult (maybe impossible?) to try an
Cem Karan wrote:
I tend to structure my code as a tree or DAG of objects. The owner refers to
the owned object, but the owned object has no reference to its owner. With
callbacks, you get cycles, where the owned owns the owner.
This is why I suggested registering a listener object
plus a meth
Chris Angelico writes:
> So, you would have to pass code to the other process, probably. What
> about this:
> y = 4
> other_thread_queue.put(lambda x: x*y)
the y in the lambda is a free variable that's a reference to the
surrounding mutable context, so that's at best dubious. You could use:
Ben Finney wrote:
>> In C language, there is &A for address of A
>
> There is no “address of a value” concept in Python. You access a value
> by some reference, either a name or an item in a collection. When a
> reference changes to reference some different value, other references
> are not affec
Ethan Furman wrote:
> On 02/22/2015 11:41 PM, Steven D'Aprano wrote:
>
>> If you want *CPython* to work without a GIL, well, are you volunteering
>> to do the work? It is a massive job, and the core devs aren't terribly
>> interested. Probably because they understand that the GIL is not often an
Laura Creighton wrote:
> DO NOT REBUILD PYTHON ON CENTOS!
>
> It can break the whole package management system
> which depends on having a particular version of python installed.
>
> If you are running Centos you need to use virtualenv to be safe.
>
> Laura
Almost right!
You can install Pyth
On Mon, Feb 23, 2015 at 3:14 PM, Ethan Furman wrote:
> On 02/23/2015 01:00 PM, Tobiah wrote:
>
>> Anyway, it raises the question as to whether having '.' in the
>> PYTHONPATH is at all a sane thing to do.
>
> The current directory is added to sys.path /only/ for the interactive
> interpreter.
Wh
On Mon, Feb 23, 2015 at 1:02 PM, wrote:
> What's REALLY interesting is that this happens:
>
import myModule
myModule.myInt
> 1
myModule.myInt = 2
myModule.myInt
> 2
del myModule
import myModule
myModule.myInt
> 2
>
> I would REALLY expect that deleting the modul
Ian Kelly :
> Obviously one can use any Turing-complete language to emulate features
> of any other Turing-complete language, but I think the point is that
> there is no syntactic support for it.
While my "contribution" was made tongue-in-cheek, there's a grain of
truth in every joke.
First of a
On Tue, Feb 24, 2015 at 6:06 AM, Marko Rauhamaa wrote:
> What I'm saying is that there's nothing special about Python's object
> model or variables. Guido could decide tomorrow to add a C-esque "&"
> operator to Python without breaking a single existing Python program.
> The Python compiler would
Peter Otten <__pete...@web.de>:
> The OP explicitly mentions the & operator. There's no python analog to
> that and the behavior shown below:
>
> $ cat pointers.c
> #include
>
> int main()
> {
> int a = 2, b = 5;
> int * Li[2] = { &a, &b };
> printf("%d %d\n", *Li[0], *Li[1]);
> a = 3;
>
On Sat, 21 Feb 2015 04:15:50 -0800, pfranken85 wrote:
> Hello!
>
> I have a best-practice question: Imagine I have several hardware devices
> that I work with on the same I2C bus and I am using the python smbus
> module for that purpose. The individual devices are sensors, ADC, DAC
> components.
I've been reworking some of the code in the platform I use at work.
I'm the sole developer/maintainer/hard-core user left, so I can pretty
much do what I want with it (convert modules to Cython, delete no
longer used modules, etc). The platform uses PyGtk, so we use signals
and other features of t
On 2015.02.23 09:58, loial wrote:
> Is there a quick way to concatenate all the values in a list into a string,
> except the first value?
>
> I want this to work with variable length lists.
>
> All values in list will be strings.
>
> Any help appreciated
>
The tutorial covers strings and lists
On 23/02/2015 15:29, Tim Golden wrote:
> On 23/02/2015 13:57, Colin Atkinson wrote:
>> I am deploying Python to hundreds of machines using SCCM 2012. I am
>> using the below command to install:
>>
>> Msiexec /i “python.msi” TARGETDIR=”C:\Program Files\Python”
>> ALLUSERS=1 /qn
>>
>> Even though I
Arrgh! I forgot to warn you that you need a very recent version of
virtualenv to work with PyPy. I am very sorry about that. Glad to
see that things are working now.
Laura
--
https://mail.python.org/mailman/listinfo/python-list
In <12821378-62af-4954-8b61-aa0738c5f...@googlegroups.com> loial
writes:
> Is there a quick way to concatenate all the values in a list into a string,
> except the first value?
> I want this to work with variable length lists.
> All values in list will be strings.
> Any help appreciated
big
On 2015-02-23 07:58, loial wrote:
> Is there a quick way to concatenate all the values in a list into a
> string, except the first value?
>
> I want this to work with variable length lists.
>
> All values in list will be strings.
Using
"".join(my_list[1:])
should work.
If it is an arbitrary
On Mon, 23 Feb 2015 07:58:39 -0800, loial wrote:
> Is there a quick way to concatenate all the values in a list into a
> string, except the first value?
>
> I want this to work with variable length lists.
>
> All values in list will be strings.
>
> Any help appreciated
''.join(mylist[1:])
all
loial wrote:
> Is there a quick way to concatenate all the values in a list into a
> string, except the first value?
>
> I want this to work with variable length lists.
>
> All values in list will be strings.
>
> Any help appreciated
>>> strings
['All', 'values', 'in', 'list', 'will', 'be', 's
Is there a quick way to concatenate all the values in a list into a string,
except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Any help appreciated
--
https://mail.python.org/mailman/listinfo/python-list
Dave Farrance schrieb am 23.02.2015 um 15:13:
> Dave Cook wrote:
>> On 2015-02-22, Dave Farrance wrote:
>>
>>> It's still quicker to do a re-write in the more cumbersome C
>>
>> You should try Cython.
>
> I did try Cython when I was trying to figure out what to do about the slow
> speed. My initi
On 23/02/2015 13:57, Colin Atkinson wrote:
> I am deploying Python to hundreds of machines using SCCM 2012. I am
> using the below command to install:
>
> Msiexec /i “python.msi” TARGETDIR=”C:\Program Files\Python”
> ALLUSERS=1 /qn
>
> Even though I am using /qn, a command prompt still appears
Thanks for your replies, I will give readline a try.
> PS: and you mention being on CentOS but running apt-get. I believe CentOS
> and other Red-Hat based distros use "yum" instead of "apt-get"
Yes, I think I need to use:
yum install readline-devel
Best regards
David
--
https://mail.python.o
On 23.02.2015 14:27, Marko Rauhamaa wrote:
> pfranke...@gmail.com:
>> The corresponding call is a call to the python smbus library. It
>> includes several sleeps (even though they are only about 50ms).
>> Therefore I think it is worthwhile to encapsulate it into a coroutine.
>
> Maybe. Then you'll
On 2015-02-23 13:44, David Aldrich wrote:
> I want to use the Python 3.4 interpreter interactively, via a PuTTY
> ssh session. Python is running on Centos 5.
>
> Currently, the arrow keys do not work:
[snip]
> sudo apt-get install libreadline-dev
>
> followed by a rebuild of Python
>
> or
>
>
On Tue, Feb 24, 2015 at 12:44 AM, David Aldrich
wrote:
> I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh
> session. Python is running on Centos 5.
>
> This stackoverflow thread:
>
> http://stackoverflow.com/questions/893053/python-shell-arrow-keys-do-not-work-on-remote-mac
Dave Cook wrote:
>On 2015-02-22, Dave Farrance wrote:
>
>> It's still quicker to do a re-write in the more cumbersome C
>
>You should try Cython.
I did try Cython when I was trying to figure out what to do about the slow
speed. My initial attempt showed no speedup at all. The documentation
to
Laura Creighton wrote:
>Good news -- it seems to be working fine with PyPy.
>https://travis-ci.org/hugovk/Pillow/builds
>
>for me, not extensively tested, it just seems to be working.
>
>I have several pypy's floating around here, each within its own
>virtualenv. If you aren't familiar with vir
Hi,
I am deploying Python to hundreds of machines using SCCM 2012. I am using the
below command to install:
Msiexec /i "python.msi" TARGETDIR="C:\Program Files\Python" ALLUSERS=1 /qn
Even though I am using /qn, a command prompt still appears at the end of the
install for about 5-6 seconds. I
"ast" :
> Is there a way to define a container object able to store some
> variables so that a change of a variable make a change in this object
> content ?
>
> I dont need this feature. It is just something I am thinking about.
>
> In C language, there is &A for address of A
In Python, you can a
Hi
I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh
session. Python is running on Centos 5.
Currently, the arrow keys do not work:
$ /usr/local/bin/python3.4
Python 3.4.2 (default, Feb 11 2015, 15:06:33)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux
Type "help", "copy
On Sunday, 22 February 2015 14:11:54 UTC, Mark Lawrence wrote:
> On 19/02/2015 16:27, Phillip Fleming wrote:
> > In my opinion, Python will not take off like C/C++ if there is no ANSI
> > standard.
> >
>
> Python has already taken off because it doesn't have a standard as such.
>
Bjarne Stroust
Cem Karan wrote:
>
> On Feb 21, 2015, at 12:27 PM, Steven D'Aprano
> wrote:
>> The simplest possible identity-based scheme would be something like this:
>>
>>
>> # don't hate me for using a global variable
>> CALLBACKS = []
>>
>> def register(func):
>>if func not in CALLBACKS:
>>
pfranke...@gmail.com:
> Hello Marko!
>
> Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa:
>> In asyncio, you typically ignore the value returned by yield. While
>> generators use yield to communicate results to the calling program,
>> coroutines use yield only as a "trick" to im
On 02/23/2015 07:55 AM, ast wrote:
hi
a = 2; b = 5
Li = [a, b]
Li
[2, 5]
a=3
Li
[2, 5]
Ok, a change in a or b doesn't impact Li. This works as expected
Is there a way to define a container object able to store some variables
so that a change of a variable make a change in this object c
hi
a = 2; b = 5
Li = [a, b]
Li
[2, 5]
a=3
Li
[2, 5]
Ok, a change in a or b doesn't impact Li. This works as expected
Is there a way to define a container object able to store some variables
so that a change of a variable make a change in this object content ?
I dont need this feature
On Mon, Feb 23, 2015 at 11:13 PM, Robert Clove wrote:
> proc1=subprocess.Popen("/root/Desktop/abc.py","64","abc",shell=True,stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
As others have said, you need to use either a single command or a list
of strings. But why are you using shell=True here? Y
> Hi, the parameter list should be a list of strings, not several unpacked
> strings :
>
> command = ["/root/Desktop/abc.py","64","abc"]
> proc1 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
> stderr=subprocess.PIPE)
>
The first argument is list of string only when `shell
On 23/02/2015 13:13, Robert Clove wrote:
Hi All,
I am using the Linux system with python, i am running the following script
#!/usr/bin/python
import threading
import time
import sys
import subprocess
import datetime
import os
import time
import logging
proc1=subprocess.Popen("/root/Des
"Cem Karan" wrote in message
news:a3c11a70-5846-4915-bb26-b23793b65...@gmail.com...
>
>
> Good questions! That was why I was asking about 'gotchas' with WeakSets
> originally. Honestly, the only way to know for sure would be to write two
> APIs for doing similar things, and then see how peop
When `shell=True`, the first argument should be string passed to shell.
So you should:
proc1=subprocess.Popen("/root/Desktop/abc.py 64 abc",
shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
On Mon, Feb 23, 2015 at 9:13 PM, Robert Clove wrote:
> Hi All,
>
> I am using the Linux sys
Hi All,
I am using the Linux system with python, i am running the following script
#!/usr/bin/python
import threading
import time
import sys
import subprocess
import datetime
import os
import time
import logging
proc1=subprocess.Popen("/root/Desktop/abc.py","64","abc",shell=True,stdout=su
On Feb 22, 2015, at 5:29 PM, Laura Creighton wrote:
> In a message of Sun, 22 Feb 2015 17:09:01 -0500, Cem Karan writes:
>
>> Documentation is a given; it MUST be there. That said, documenting
>> something, but still making it surprising, is a bad idea. For
>> example, several people have bee
On 2015-02-22, Dave Farrance wrote:
> It's still quicker to do a re-write in the more cumbersome C
You should try Cython.
Dave
--
https://mail.python.org/mailman/listinfo/python-list
On 23.02.15 04:55, Chris Angelico wrote:
I agree, the fault is primarily with Windows. But I've seen similar
issues when people use /-\| for box drawing and framing and such;
Windows paths are by far the most common case of this, but not the
sole.
There is also issues with regular expressions.
Hello Marko!
Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa:
> In asyncio, you typically ignore the value returned by yield. While
> generators use yield to communicate results to the calling program,
> coroutines use yield only as a "trick" to implement cooperative
> multitask
On Mon, Feb 23, 2015 at 6:41 PM, Steven D'Aprano
wrote:
>>> - and you must be using libraries and tools which prevent you moving to
>>> Jython or IronPython or some other alternative.
>>
>> I don't get this at all. Why should I not want Python to have the same
>> capabilities?
>
> Python does hav
Ben Finney wrote:
> Chris Angelico writes:
>
>> That said, though, there's probably a lot of code out there that
>> depends on backslashes being non-special, so it's quite probably
>> something that can't be changed. But it'd be nice to be able to turn
>> on a warning for it.
>
> If you're moti
Steven D'Aprano :
> Yes, but my point is that if some other way solves the problem, then
> you should *use that other technique* rather than complain about the
> GIL. The GIL is not a bottleneck if you can bypass it.
>
> I can sympathize with somebody who says "I have this problem that can
> only
55 matches
Mail list logo