On Tue, Nov 6, 2012 at 4:51 PM, Andrew Robinson
wrote:
> I really don't think doing a shallow copy of lists would break anyone's
> program.
Well, it's a change, a semantic change. It's almost certainly going to
break _something_. But for the sake of argument, we can suppose that
the change could
On 11/05/2012 06:30 PM, Oscar Benjamin wrote:
On 6 November 2012 02:01, Chris Angelico wrote:
On Tue, Nov 6, 2012 at 12:32 PM, Oscar Benjamin
wrote:
I was just thinking to myself that it would be a hard thing to change
because the list would need to know how to instantiate copies of all
the
On Tue, Nov 6, 2012 at 4:19 PM, iMath wrote:
> How to only get a list of the names of the non-directory files in current
> directory ('.')?
> (Note excluding its subdirectories ).
>
> I need the code : )
Start by getting a list of names of everything in the current directory.
Then filter that l
How to only get a list of the names of the non-directory files in current
directory ('.')?
(Note excluding its subdirectories ).
I need the code : )
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 05 Nov 2012 17:39:35 +1100, Chris Angelico wrote:
> On Mon, Nov 5, 2012 at 5:10 PM, rusi wrote:
>> Among people who know me, I am a linux nerd: My sister scolded me
>> yesterday because I put files on her computer without spaces:
>> DoesAnyoneWriteLikeThis?!?!
>
> My filenames seldom hav
On Mon, 05 Nov 2012 14:47:47 -0500, Dennis Lee Bieber wrote:
>> Don't most OSes allow non-printing characters in filenames? VMS and
>> Unix always have. AFAIK, there are only two characters that can't
>> appear in a Unix filename: '\x00' and '/'.
>
> But can you /enter/ them with common k
On 11/05/2012 11:29 PM, Wincent wrote:
(Please don't top-post. it messes everything up. And your use of
Google-groups is making everything double-spaced)
> Thanks.
>
> I fetch data from social networking sites and want to mark the time of
> access. I store all the information in a redis databa
On Tue, Nov 6, 2012 at 3:29 PM, Wincent wrote:
> Thanks.
>
> I fetch data from social networking sites and want to mark the time of
> access. I store all the information in a redis database, which converts
> everything into strings and I need to convert those strings back to original
> python o
On Mon, 05 Nov 2012 14:09:08 -0500, Terry Reedy wrote:
> On 11/1/2012 4:49 PM, Tengy Td wrote:
>> Hello,
>>
>>
>> I am a French student and I am currently realizing my final thesis in
>> the field of Free/libre open source software.
>
> If you really are what you claim, you should give more detai
Thanks.
I fetch data from social networking sites and want to mark the time of access.
I store all the information in a redis database, which converts everything into
strings and I need to convert those strings back to original python objects
when analyzing the data.
Best Regards
On Tuesday,
On Nov 6, 1:32 pm, Wincent wrote:
> Dear all, I would like to convert tstr to representation
> of time, but encounter the following error. Is there a
> simple way to get what I want? Thanks.
>
> >>> import time
> >>> tstr = str(time.localtime())
> >>> eval(tstr)
>
> Traceback (most recent call las
On 11/02/2012 12:11 PM, Michael Schwarz wrote:
… which doesn't work. Some of the modules reference other modules in
the same package. I'm not talking about cyclic references, but, for
example, the "dialog" module uses the "transaction" module. The
problem is that the "dialog" module uses the same
Dear all, I would like to convert tstr to representation of time, but encounter
the following error. Is there a simple way to get what I want? Thanks.
>>> import time
>>> tstr = str(time.localtime())
>>> eval(tstr)
Traceback (most recent call last):
File "", line 1, in
File "", line 1, in
T
On 6 November 2012 02:01, Chris Angelico wrote:
> On Tue, Nov 6, 2012 at 12:32 PM, Oscar Benjamin
> wrote:
>> I was just thinking to myself that it would be a hard thing to change
>> because the list would need to know how to instantiate copies of all
>> the different types of the elements in the
On Tue, Nov 6, 2012 at 12:32 PM, Oscar Benjamin
wrote:
> I was just thinking to myself that it would be a hard thing to change
> because the list would need to know how to instantiate copies of all
> the different types of the elements in the list. Then I realised it
> doesn't. It is simply a case
On 5 November 2012 09:13, Hans Mulder wrote:
> On 5/11/12 07:27:52, Demian Brecht wrote:
>> So, here I was thinking "oh, this is a nice, easy way to initialize a 4D
>> matrix"
>> (running 2.7.3, non-core libs not allowed):
>>
>> m = [[None] * 4] * 4
>>
>> The way to get what I was after was:
>>
>
On Fri, Nov 2, 2012 at 7:49 AM, Tengy Td wrote:
> It would be a great help for me if you could answer a short online survey
> (it should take approximately 5 minutes).
>
> This survey is designed to reach a better understanding of the cooperation
> and coordination between developers in Free/libre
On 05Nov2012 10:54, andrea crotti wrote:
| Quite often I find convenient to get a filename or a file object as
| argument of a function, and do something as below:
I tend to do this:
def f(fp):
if isinstance(fp, str):
with open(fp) as subfp:
return f(subfp)
... main code
On 5 November 2012 06:27, Demian Brecht wrote:
> >>> a = [None] * 4
> >>> a[0] = 'a'
> >>> a
> ['a', None, None, None]
>
> >>> m = [[None] * 4] * 4
> >>> m[0][0] = 'm'
> >>> m
> [['m', None, None, None], ['m', None, None, None], ['m', None, None,
> None], ['m', None, None, None]]
>
> Is this expe
On Tue, Nov 6, 2012 at 6:09 AM, Terry Reedy wrote:
>> I would like to remind you that the participation is absolutely
>> anonymous and voluntary, and you can quit it at any time. Your answers
>> will be strictly confidential and will be used only for research purpose
>> (no commercial use of any i
On 11/02/2012 04:12 PM, Steven D'Aprano wrote:
> On Fri, 02 Nov 2012 11:51:29 -0700, Jason Benjamin wrote:
>
>> On another note, it appears that Google (the only archive I can find for
>> this group) only has a little under 400 messages archived for this
>> group,
>
> Google Groups is poison. If
On 11/04/2012 04:13 AM, Jamie Paul Griffin wrote:
> / ru...@yahoo.com wrote on Fri 2.Nov'12 at 11:39:10 -0700 /
>
>> (I also hope I haven't just been suckered by a troll attempt,
>> windows/unix is better then unix/windows being an age-old means of
>> trolling.)
>
> No, i'm not a "troll". I was
On Mon, Nov 5, 2012 at 8:34 PM, Monkey wrote:
> Hi,
> i wonderd if there is a way to convert a py-file to a exe-file with version
> 3.x of python.
>
> I know that it was possible till version 2.7.x. But is there a way to do it
> in version 3.x?
>
> Yours sincerely,
> Monkey
> --
> http://mail.py
Hi,
i wonderd if there is a way to convert a py-file to a exe-file with version 3.x
of python.
I know that it was possible till version 2.7.x. But is there a way to do it in
version 3.x?
Yours sincerely,
Monkey
--
http://mail.python.org/mailman/listinfo/python-list
On 11/5/2012 9:23 AM, inshu chauhan wrote:
what is the difference between range and xrange.. both seem to work the
same. ?
>>> range(3)
[0, 1, 2]
>>> xrange(3)
xrange(3)
You should read the appropriate manual entries before asking trivial
questions. They say pretty clearly that range returns
On 11/5/2012 5:54 AM, andrea crotti wrote:
Quite often I find convenient to get a filename or a file object as
argument of a function, and do something as below:
def grep_file(regexp, filepath_obj):
"""Check if the given text is found in any of the file lines, take
a path to a file or
On 2012-11-05, Dennis Lee Bieber wrote:
> On Mon, 5 Nov 2012 17:39:35 +1100, Chris Angelico
> declaimed the following in gmane.comp.python.general:
>
>>
>> It's nothing to do with operating system. File names are names, and
>> spaces in them are seldom worth the hassle unless you manipulate thos
On 2012-11-05, andrea crotti wrote:
> Quite often I find convenient to get a filename or a file object as
> argument of a function, and do something as below:
>
> def grep_file(regexp, filepath_obj):
[...]
> if isinstance(filepath_obj, basestring):
> fobj = open(filepath_obj)
> el
On 2012-11-04, at 11:07 PM, Chris Rebert wrote:
> However, unlike a list object (as in your latter example), the object
> `None` is completely immutable (and what's more, a singleton value),
> so you just-so-happen *not to be able to* run into the same problem of
> mutating an object (assignment
On 2012-11-05, Roy Smith wrote:
> In article ,
> Chris Angelico wrote:
>
>> It's nothing to do with operating system. File names are names, and
>> spaces in them are seldom worth the hassle unless you manipulate those
>> files solely using a GUI.
>
> That's a very ascii-esqe attitude. In a full
On 2012-11-04, at 10:44 PM, Andrew Robinson wrote:
> but I think you meant:
>
> m = [[None] * 4, [None] * 4, [None] * 4, [None] *4 ]
> rather than:
> m = [[None] * 4, [None] * 4, [None] * 4, [None * 4]]
Yes, I meant the former, thanks for catching the typo.
Demian Brecht
@demianbrecht
http://d
in python 2.x xrange is a generator and range returns a list. In python
3.x xrange is renamed to range replacing the list function with the
generator
On Mon, Nov 5, 2012 at 9:23 AM, inshu chauhan wrote:
> what is the difference between range and xrange.. both seem to work the
> same. ? And whi
On 11/05/2012 09:23 AM, inshu chauhan wrote:
> what is the difference between range and xrange.. both seem to work the
> same. ? And which should be used where and in what situations.. ??
>
>
One difference is that from versions of Python 3.0 and later, xrange
doesn't exist, and range takes over
what is the difference between range and xrange.. both seem to work the
same. ? And which should be used where and in what situations.. ??
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Nov 5, 2012 at 11:56 PM, Roy Smith wrote:
> That's a very ascii-esqe attitude. In a fully unicode world, I could
> easily see using U+00A0 (NO-BREAK SPACE) in file names, and still have
> space-delimited CLI work just fine.
>
Oh, do you have a "U+00A0-bar" on your keyboard?
ChrisA
--
h
andrea crotti wrote:
> 2012/11/5 Peter Otten <__pete...@web.de>:
>> I sometimes do something like this:
>> @contextmanager
>> def xopen(file=None, mode="r"):
>> if hasattr(file, "read"):
>> yield file
elif file == "-" or file is None: # add file=None handling
>> if "w"
Am 05.11.2012 11:54, schrieb andrea crotti:
Quite often I find convenient to get a filename or a file object as
argument of a function, and do something as below:
def grep_file(regexp, filepath_obj):
"""Check if the given text is found in any of the file lines, take
a path to a file or
2012/11/5 Peter Otten <__pete...@web.de>:
> I sometimes do something like this:
>
> $ cat xopen.py
> import re
> import sys
> from contextlib import contextmanager
>
> @contextmanager
> def xopen(file=None, mode="r"):
> if hasattr(file, "read"):
> yield file
> elif file == "-":
>
In article ,
Chris Angelico wrote:
> It's nothing to do with operating system. File names are names, and
> spaces in them are seldom worth the hassle unless you manipulate those
> files solely using a GUI.
That's a very ascii-esqe attitude. In a fully unicode world, I could
easily see using U
andrea crotti wrote:
> Quite often I find convenient to get a filename or a file object as
> argument of a function, and do something as below:
>
> def grep_file(regexp, filepath_obj):
> """Check if the given text is found in any of the file lines, take
> a path to a file or an opened fil
Le lundi 5 novembre 2012 07:28:00 UTC+1, Demian Brecht a écrit :
> So, here I was thinking "oh, this is a nice, easy way to initialize a 4D
> matrix" (running 2.7.3, non-core libs not allowed):
>
>
>
> m = [[None] * 4] * 4
>
>
>
> The way to get what I was after was:
>
>
>
> m = [[None] *
On 5/11/12 07:27:52, Demian Brecht wrote:
> So, here I was thinking "oh, this is a nice, easy way to initialize a 4D
> matrix"
> (running 2.7.3, non-core libs not allowed):
>
> m = [[None] * 4] * 4
>
> The way to get what I was after was:
>
> m = [[None] * 4, [None] * 4, [None] * 4, [None * 4]]
On Monday, November 5, 2012 8:51:00 AM UTC+2, Ferencik Ioan wrote:
> Hello there folks,
>
>
>
> I have a bit of a special issue.
>
> I'll start by disclosing myself for what i am doing. I am a postgraduate
> student and I really have good reasons to do what I am doing. At least i
> think so.
On Mon, Nov 5, 2012 at 6:54 PM, Andrew Robinson
wrote:
> On 11/04/2012 11:27 PM, Chris Angelico wrote:
>>
>> On Mon, Nov 5, 2012 at 6:07 PM, Chris Rebert wrote:
>>
>> x = None
>> x.a = 42
>>>
>>> Traceback (most recent call last):
>>>File "", line 1, in
>>> AttributeError: 'NoneTy
44 matches
Mail list logo