I need to extend the PATH environment variable on Windows.
So far, I use:
system('setx PATH "%PATH%;'+bindir+'"')
The problem: In a new process (cmd.exe) PATH contains a lot of double
elements. As far as I have understood, Windows builds the PATH
environment variable from a system component a
On 16 Feb 2016 05:57, "Ben Finney" wrote:
>
> Cameron Simpson writes:
>
> > I've been watching this for a few days, and am struggling to
> > understand your use case.
>
> Yes, you're not alone. This surprises me, which is why I'm persisting.
>
> > Can you elaborate with a concrete example and its
I know
with open('foo.txt') as f:
...do something...
will close the file automatically when the "with" block ends.
I also saw codes in a book:
for line in open('foo.txt'):
...do something...
but it didn't mention if the file will be closed automatically or not when the
On Tue, Feb 16, 2016 at 7:39 PM, wrote:
> I know
>
> with open('foo.txt') as f:
> ...do something...
>
> will close the file automatically when the "with" block ends.
>
> I also saw codes in a book:
>
> for line in open('foo.txt'):
> ...do something...
>
> but it didn't me
On 16Feb2016 00:39, jf...@ms4.hinet.net wrote:
I know
with open('foo.txt') as f:
...do something...
will close the file automatically when the "with" block ends.
Yes, because open is a context manager - they're great for reliably tidying up
in the face of exceptions or "direct" de
On 2/16/2016 3:39 AM, jf...@ms4.hinet.net wrote:
I know
with open('foo.txt') as f:
...do something...
will close the file automatically when the "with" block ends.
I also saw codes in a book:
for line in open('foo.txt'):
...do something...
Some books were original
* Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC))
> I need to extend the PATH environment variable on Windows.
>
> So far, I use:
>
>system('setx PATH "%PATH%;'+bindir+'"')
>
> The problem: In a new process (cmd.exe) PATH contains a lot of double
> elements. As far as I have understoo
Thorsten Kampe wrote:
> * Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC))
> > I need to extend the PATH environment variable on Windows.
>
> 1. Add the path component yourself into HKEY_CURRENT_USER and make
> sure it's not there already (pure Python).
Preferred!
What is HKEY_CURRENT_USE
Thanks a lot. Will implement that. Although I am able to do using just 2
scripts as well.
On Monday, February 15, 2016 at 5:34:08 PM UTC+1, Peter Otten wrote:
> Arjun Srivatsa wrote:
>
> > Hi Peter.
> >
> > Thank you for the reply.
> >
> > This is the read_server code:
> >
> > import socket
Hi,
a = b = c
as an assignment doesn't return anything, i ruled out a = b = c as
chained assignment, like a = (b = c)
SO i thought, a = b = c is resolved as
a, b = [c, c]
at-least i fixed in my mind that every assignment like operation in
python is done with references and then the references a
I'm installing an app that requires Carbon and some other Python 2.7 features.
The version of Oracle Linux we're using comes with 2.6.
I've read that it is not a good idea to directly update the O/S as it "may
break things" so I'm doing make altinstall.
I've downloaded Python-2.7.11
Downloaded
Hi Srinivas,
On 16.02.2016 13:46, srinivas devaki wrote:
Hi,
a = b = c
as an assignment doesn't return anything, i ruled out a = b = c as
chained assignment, like a = (b = c)
SO i thought, a = b = c is resolved as
a, b = [c, c]
at-least i fixed in my mind that every assignment like operation
On 16.02.2016 14:05, Sven R. Kunze wrote:
Hi Srinivas,
I think the tuple assignment you showed basically nails it.
First, the rhs is evaluated.
Second, the lhs is evaluated from left to right.
Completely wrong?
Best,
Sven
As you mentioned swapping. The following two statements do the same (
On Tue, Feb 16, 2016 at 2:30 AM, Ulli Horlacher
wrote:
>
> So far, I use:
>
>system('setx PATH "%PATH%;'+bindir+'"')
>
> The problem: In a new process (cmd.exe) PATH contains a lot of double
> elements. As far as I have understood, Windows builds the PATH
> environment variable from a system c
If you're handling coroutines there is an asyncio facility for "background
tasks". The ensure_future [1] will take a coroutine, attach it to a Task,
and return a future to you that resolves when the coroutine is complete.
The coroutine you schedule with that function will not cause your current
cor
* Ulli Horlacher (Tue, 16 Feb 2016 12:38:44 + (UTC))
>
> Thorsten Kampe wrote:
> > * Ulli Horlacher (Tue, 16 Feb 2016 08:30:59 + (UTC))
> > > I need to extend the PATH environment variable on Windows.
> >
> > 1. Add the path component yourself into HKEY_CURRENT_USER and make
> > sure it
* Ulli Horlacher (Tue, 16 Feb 2016 12:38:44 + (UTC))
By the way: there is a script called `win_add2path.py` in your Python
distribution which "is a simple script to add Python to the Windows
search path. It modifies the current user (HKCU) tree of the
registry.". That should do most of what
"Kevin Conway" wrote in message
news:CAKF=+dim8wzprvm86_v2w5-xsopcchvgm0hy8r4xehdyzy_...@mail.gmail.com...
If you're handling coroutines there is an asyncio facility for "background
tasks". The ensure_future [1] will take a coroutine, attach it to a Task,
and return a future to you that resolve
Kevin Conway :
> If you're handling coroutines there is an asyncio facility for
> "background tasks". The ensure_future [1] will take a coroutine,
> attach it to a Task, and return a future to you that resolves when the
> coroutine is complete.
Ok, yes, but those "background tasks" monopolize the
"Marko Rauhamaa" wrote in message news:87d1rwpwo2@elektro.pacujo.net...
Kevin Conway :
> If you're handling coroutines there is an asyncio facility for
> "background tasks". The ensure_future [1] will take a coroutine,
> attach it to a Task, and return a future to you that resolves when th
> Ok, yes, but those "background tasks" monopolize the CPU once they are
scheduled to run.
This is true if the coroutines are cpu bound. If that is the case then a
coroutine is likely the wrong choice for that code to begin with.
Coroutines, in asyncio land, are primarily designed for io bound wor
On Tue, 16 Feb 2016 11:46 pm, srinivas devaki wrote:
> Hi,
>
> a = b = c
>
> as an assignment doesn't return anything, i ruled out a = b = c as
> chained assignment, like a = (b = c)
> SO i thought, a = b = c is resolved as
> a, b = [c, c]
That is one way of thinking of it. A better way would b
"Kevin Conway" wrote in message
news:CAKF=+dhXZ=yax8stawr_gjx3tg8yujprjg-7ym2_brv2kxm...@mail.gmail.com...
> My background task does take a long time to run - about 10 seconds - but
> most of that time is spent waiting for database responses, which is
> handled
> in another thread.
Something
On Wed, 17 Feb 2016 01:17 am, Marko Rauhamaa wrote:
> Ok, yes, but those "background tasks" monopolize the CPU once they are
> scheduled to run.
Can you show some code demonstrating this?
--
Steven
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Feb 17, 2016 at 2:21 AM, Frank Millman wrote:
> I would love to drive the database asynchronously, but of the three
> databases I use, only psycopg2 seems to have asyncio support. As my
> home-grown solution (using queues) seems to be working well so far, I am
> sticking with that until I
"Chris Angelico" wrote in message
news:captjjmqmie4groqnyvhwahcn2mwqeyqxt5kvfivotrhqy-s...@mail.gmail.com...
On Wed, Feb 17, 2016 at 2:21 AM, Frank Millman wrote:
> I would love to drive the database asynchronously, but of the three
> databases I use, only psycopg2 seems to have asyncio suppor
On Tue, Feb 16, 2016 at 6:35 PM, Sven R. Kunze wrote:
>
> First, the rhs is evaluated.
> Second, the lhs is evaluated from left to right.
Great, I will remember these two lines :)
On Tue, Feb 16, 2016 at 8:46 PM, Steven D'Aprano wrote:
> _temp = c
> a = _temp
> b = _temp
> del _temp
>
>
> except
Steven D'Aprano :
> On Wed, 17 Feb 2016 01:17 am, Marko Rauhamaa wrote:
>
>> Ok, yes, but those "background tasks" monopolize the CPU once they
>> are scheduled to run.
>
> Can you show some code demonstrating this?
Sure:
#
Steven D'Aprano :
> On Wed, 17 Feb 2016 01:17 am, Marko Rauhamaa wrote:
>
>> Ok, yes, but those "background tasks" monopolize the CPU once they are
>> scheduled to run.
>
> Can you show some code demonstrating this?
Sure:
#
Steven D'Aprano :
> On Wed, 17 Feb 2016 01:17 am, Marko Rauhamaa wrote:
>
>> Ok, yes, but those "background tasks" monopolize the CPU once they are
>> scheduled to run.
>
> Can you show some code demonstrating this?
Sure:
#
Marko Rauhamaa :
> Sure:
Sorry for the multiple copies.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano :
> On Wed, 17 Feb 2016 01:17 am, Marko Rauhamaa wrote:
>
>> Ok, yes, but those "background tasks" monopolize the CPU once they are
>> scheduled to run.
>
> Can you show some code demonstrating this?
Sure:
#
"Frank Millman" :
> I would love to drive the database asynchronously, but of the three
> databases I use, only psycopg2 seems to have asyncio support.
Yes, asyncio is at its infancy. There needs to be a moratorium on
blocking I/O.
Marko
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, 16 Feb 2016 04:56 pm, Ben Finney wrote:
> An example::
>
> import io
> import tempfile
> names = tempfile._get_candidate_names()
I'm not sure that calling a private function of the tempfile module is
better than calling a deprecated function.
> def test_frobnicates_con
On 16/02/2016 17:15, Marko Rauhamaa wrote:
Marko Rauhamaa :
Sure:
Sorry for the multiple copies.
Marko
I thought perhaps background jobs were sending them :)
--
Robin Becker
--
https://mail.python.org/mailman/listinfo/python-list
On 2/16/2016 7:46 AM, srinivas devaki wrote:
Hi,
a = b = c
as an assignment doesn't return anything, i ruled out a = b = c as
chained assignment, like a = (b = c)
SO i thought, a = b = c is resolved as
a, b = [c, c]
https://docs.python.org/3/reference/simple_stmts.html#assignment-statements
"
Oscar Benjamin writes:
> If you're going to patch open to return a fake file when asked to open
> fake_file_path why do you care whether there is a real file of that
> name?
I don't, and have been saying explicitly many times in this thread that
I do not care whether the file exists. Somehow tha
Steven D'Aprano writes:
> On Tue, 16 Feb 2016 04:56 pm, Ben Finney wrote:
>
> > names = tempfile._get_candidate_names()
>
> I'm not sure that calling a private function of the tempfile module is
> better than calling a deprecated function.
Agreed, which is why I'm seeking a public API that i
Please guide me.
#Chinmay
Sent from Mail for Windows 10
--
https://mail.python.org/mailman/listinfo/python-list
I woke up two days ago to find out that python literally won't work any
more. I have looked everywhere, asked multiple Stack Overflow questions,
and am ready to give up. Whenever I run python (3.5), I get the following
message:
Fatal Python error: Py_initialize: unable to load the file system code
Am 16.02.16 um 17:19 schrieb Theo Hamilton:
I woke up two days ago to find out that python literally won't work any
more. I have looked everywhere, asked multiple Stack Overflow questions,
and am ready to give up. Whenever I run python (3.5), I get the following
message:
Fatal Python error: Py_i
On 16/02/2016 19:55, Chinmaya Choudhury wrote:
Please guide me.
#Chinmay
Sent from Mail for Windows 10
Please read http://catb.org/~esr/faqs/smart-questions.html and possibly
http://www.sscce.org/, then try asking again.
--
My fellow Pythonistas, ask not what our language can do for you, a
On Wed, 17 Feb 2016 01:25:52 +0530, Chinmaya Choudhury wrote:
> Please guide me.
> #Chinmay
>
> Sent from Mail for Windows 10
open it correctly
--
The temperature of the aqueous content of an unremittingly ogled
culinary vessel will not achieve 100 degrees on the Celsius scale.
--
https:/
On Tue, Feb 16, 2016 at 2:55 PM, Chinmaya Choudhury
wrote:
> Please guide me.
> #Chinmay
Dear Cousin Muscle,
I have a serious trouble with Tom.
Need you help at once,
Jerry.
(C)
>
> Sent from Mail for Windows 10
>
> --
> https://mail.python.org/mailman/listinfo/python-list
--
https://mail.py
On Tue, Feb 16, 2016 at 10:19 AM, Theo Hamilton wrote:
> Whenever I run python (3.5), I get the following message:
>
> Fatal Python error: Py_initialize: unable to load the file system codec
> ImportError: No module named 'encodings'
>
> Current thread 0x2168 (most recent call first):
The int
What is the pattern for chaining execution of tasks with ThreadPoolExecutor?
Callbacks is not an adequate facility as each task I have will generate new
output.
Thanks,
jlc
--
https://mail.python.org/mailman/listinfo/python-list
I'm trying to install the latest version of python . First time it didn't
install successfully ,i tried again now it have installed but not working.
I'm sending screenshot and log file. I tried reinstallation again and again
but result is same.
--
https://mail.python.org/mailman/listinfo/python-li
SoNu KuMaR writes:
> I'm trying to install the latest version of python . First time it
> didn't install successfully ,i tried again now it have installed but
> not working.
What exactly did you try? What details about the host can you describe
so we know what may be peculiar to the problem?
>
Ben Finney writes:
> Cameron Simpson writes:
>
>> I've been watching this for a few days, and am struggling to
>> understand your use case.
>
> Yes, you're not alone. This surprises me, which is why I'm persisting.
>
>> Can you elaborate with a concrete example and its purpose which would
>> wor
Thanks for these detailed explanation. Both statements will close file
automatically sooner or later and, when considering the exceptions, "with" is
better. Hope my understanding is right.
But, just curious, how do you know the "for" will do it? I can't find any
document about it from every sou
On Wed, Feb 17, 2016 at 3:04 PM, wrote:
> Thanks for these detailed explanation. Both statements will close file
> automatically sooner or later and, when considering the exceptions, "with" is
> better. Hope my understanding is right.
>
> But, just curious, how do you know the "for" will do it?
On 02/16/2016 11:04 PM, jf...@ms4.hinet.net wrote:
> Thanks for these detailed explanation. Both statements will close file
> automatically sooner or later and, when considering the exceptions, "with" is
> better. Hope my understanding is right.
>
> But, just curious, how do you know the "for" w
In Doug Hellman's book on the stdlib, he does:
import threading
import logging
logging.basicConfig(level=logging.DEBUG,
format=ā(%(threadName)-10s) %(message)sā,
)
class MyThreadWithArgs(threading.Thread):
def __init__(self, group=None, target=None, name=None,
args=(), kwargs=None
On Wednesday 17 February 2016 06:55, Chinmaya Choudhury wrote:
> Please guide me.
> #Chinmay
>
> Sent from Mail for Windows 10
How can we help you when we don't know what problem you have?
Is the computer turned on? Is the mouse plugged in? Are you double-clicking
the icon on the desktop? Wh
On Wednesday 17 February 2016 15:04, jf...@ms4.hinet.net wrote:
> Thanks for these detailed explanation. Both statements will close file
> automatically sooner or later and, when considering the exceptions, "with"
> is better. Hope my understanding is right.
>
> But, just curious, how do you know
55 matches
Mail list logo