On Sunday, August 19, 2012 7:57:46 PM UTC-6, kj wrote:
This means that no library code can ever count on, for example,
being able to reliably find the path to the file that contains the
definition of __main__.
If you want to find that, look up __main__ in sys.modules and then look at the
On 20/08/2012 02:57, kj wrote:
In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com writes:
In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post
wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory
On 20/08/2012 04:04, alex23 wrote:
My apologies for any double-ups and bad formatting. The new Google Groups
interface seems to have effectively shat away decades of UX for something that
I can only guess was generated randomly.
It's very useful for reporting spam. Otherwise Thunderbird is
2012/8/20 kj no.em...@please.post:
In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com
writes This means that no library code can ever count on, for example,
being able to reliably find the path to the file that contains the
definition of __main__. That's a weakness, IMO.
On Mon, 20 Aug 2012 12:56:42 +0100, andrea crotti wrote:
In the specific case there is absolutely no use of os.chdir, since you
can:
- use absolute paths
- things like subprocess.Popen accept a cwd argument - at worst you can
chdir back to the previous position right after the broken thing
On Mon, 20 Aug 2012 13:14:02 +, Steven D'Aprano wrote:
On Mon, 20 Aug 2012 12:56:42 +0100, andrea crotti wrote:
In the specific case there is absolutely no use of os.chdir, since you
can:
- use absolute paths - things like subprocess.Popen accept a cwd
argument - at worst you can chdir
In article k0tf8g$adc$1...@news.albasani.net,
Walter Hurry walterhu...@lavabit.com wrote:
It is difficult to think of a sensible use for os.chdir, IMHO.
It is true that you can mostly avoid chdir() by building absolute
pathnames, but it's often more convenient to just cd somewhere and use
2012/8/20 Roy Smith r...@panix.com:
In article k0tf8g$adc$1...@news.albasani.net,
Walter Hurry walterhu...@lavabit.com wrote:
It is difficult to think of a sensible use for os.chdir, IMHO.
It is true that you can mostly avoid chdir() by building absolute
pathnames, but it's often more
kj wrote:
99.99% of Python programmers
will find that there's nothing wrong with behavior
[snip]
Pardon my cynicism, but the general vibe from the replies I've
gotten to my post (i.e. if Python ain't got it, it means you don't
need it)
[snip]
Don't you find there's something wrong in
On 2012-08-20, kj no.em...@please.post wrote:
In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com
writes:
In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post
wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the
kj no.em...@please.post writes:
This means that no library code can ever count on, for example,
being able to reliably find the path to the file that contains the
definition of __main__. That's a weakness, IMO.
On Unix based systems there is no reliable way to find out this
information. So
Nobody:
Maybe. On Unix, it's possible that the current directory no longer
has a pathname.
Its also possible that you do not have permission to successfully
call getcwd. One example of this I have experienced is the OS X sandbox
where you can run Python starting in a directory where you
alex23 wuwe...@gmail.com writes:
Oh my god, how DARE people with EXPERIENCE in a language challenge the
PRECONCEPTIONS of an AMATEUR!!! HOW DARE THEY?!?!
+1 QOTW :)
--
http://mail.python.org/mailman/listinfo/python-list
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Does anyone know why this is? Is there a PEP stating the rationale
for it?
Thanks!
--
Il giorno domenica 19 agosto 2012 22:42:16 UTC+2, kj ha scritto:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Does anyone know why
In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post
wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Why would you
On 19/08/2012 21:42, kj wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Does anyone know why this is? Is there a PEP stating the
On 2012-08-19 22:42, kj wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Does anyone know why this is? Is there a PEP stating the
On Sun, 19 Aug 2012 14:01:15 -0700, Giacomo Alzetta wrote:
You can obtain the working directory with os.getcwd().
Maybe. On Unix, it's possible that the current directory no longer
has a pathname. As with files, directories can be deleted (i.e.
unlinked) even while they're still in use.
On Monday, August 20, 2012 4:42:16 AM UTC+8, kj wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or, if it does, it does not officially expose this information.
Does anyone know why this is?
In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com writes:
In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post
wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the working directory at the program's start-up,
or,
On Sun, Aug 19, 2012 at 9:57 PM, kj no.em...@please.post wrote:
By now I have learned to expect that 99.99% of Python programmers
will find that there's nothing wrong with behavior like the one
described above, that it is in fact exactly As It Should Be, because,
you see, since Python is the
On Monday, 20 August 2012 11:57:46 UTC+10, kj wrote:
This means that no library code can ever count on, for example,
being able to reliably find the path to the file that contains the
definition of __main__. That's a weakness, IMO.
No, it's not. It's a _strength_. If you've written a
My apologies for any double-ups and bad formatting. The new Google Groups
interface seems to have effectively shat away decades of UX for something that
I can only guess was generated randomly.
--
http://mail.python.org/mailman/listinfo/python-list
On Monday, 20 August 2012 12:57:44 UTC+10, alex23 wrote:
a library that requires absolute knowledge of its
installed location in order for its internals to work
That should read: a library that requires derivation of its installed location
from the current working directory in order etc
--
On Mon, 20 Aug 2012 01:57:46 +, kj wrote:
In roy-ca6d77.17031119082...@news.panix.com Roy Smith r...@panix.com
writes:
In article k0rj38$2gc$1...@reader1.panix.com, kj no.em...@please.post
wrote:
As far as I've been able to determine, Python does not remember
(immutably, that is) the
On Monday, 20 August 2012 13:38:03 UTC+10, Steven D'Aprano wrote:
Not so much. More of, yes, that's a bug, but it's not an important bug.
If you have a patch for fixing it, we'll consider it, but if you don't,
we've got about two thousand more important bugs and features to get
through
On Monday, 20 August 2012 12:57:44 UTC+10, alex23 wrote:
If you've written a library that requires absolute
knowledge of its installed location in order for its
internals to work, then I'm not installing your library.
That should read: requires the ability to derive absolute knowledge of
28 matches
Mail list logo