I would suggest using virtual environment (virtualenv, for example) for
installing such packages.
Dealing with directory permissions on MacOS is complicated, and using "sudo" is
not the right way. Moreover, during the next OS upgrade the permissions will be
updated as well, and chances are tha
DFS wrote:
>dts= ['10-Mar-1998',
> '20-Aug-1997',
> '06-Sep-2009',
> '23-Jan-2010',
> '12-Feb-2010',
> '05-Nov-2010',
> '03-Sep-2009',
> '07-Nov-2014',
> '08-Mar-2013']
>Of course, the naive:
>min(dates) = '03-Sep-2009'
>max(dates) = '23-Jan-2010'
Hi fellow Pythonistas,
Let me show you my project - an introductory Python online course:
https://snakify.org/ . Our key features are 100+ exercises with deep
mathematical approach and a neat website to solve them online using a
step-by-step debugger. We already have thousands of happy users ea
On 08/12/2016 07:24, Gregory Ewing wrote:
BartC wrote:
(I'm in the middle of porting my console editor to Linux. But one
problem is that on one Linux, half the key combinations (eg.
Shift+Ctrl+B) are not recognised.
If you're reading characters from a tty device in raw
mode (which I assume i
BartC wrote:
Run the code below and start pressing keys. On both of my Linuxes, I get
escape sequences shown when I Insert, Delete, Home, End, Page Up, Page
Down, Up, Down, Left, Right and most of the function keys; not just
single ASCII codes.
That's probably because your terminal window is
Sometimes the Python name resolution is explained using a LEGB rule.
For instance, in [1] (I think also the Learning Python book gives the same):
"if a particular name:object mapping cannot be found in the local
namespaces, the namespaces of the enclosed scope are being searched
next. If the se
On Thu, Dec 8, 2016, at 01:20, Gregory Ewing wrote:
> BartC wrote:
> > And globbing doesn't take care of all of it: a Linux program still has
> > to iterate over a loop of filenames. The same as on Windows, except the
> > latter will need to call a function to deliver the next filename.
>
> Actu
On Wed, Dec 7, 2016, at 00:15, Steven D'Aprano wrote:
> and the shell expands the metacharacters ? {...} * [...] regardless of
> how much
> smarts the command itself has.
>
> There are thousands of programs I might use, and they may implement who
> knows
> how many different globbing rules:
>
>
On Wed, Dec 7, 2016, at 03:50, Peter Otten wrote:
> Is there an equivalent to
>
> # touch -- -r
>
> on Windows?
Doesn't need one - options conventionally start with /, and filenames
can't contain /.
--
https://mail.python.org/mailman/listinfo/python-list
Am Donnerstag, 8. Dezember 2016 14:47:31 UTC+1 schrieb DFS:
> On 12/8/2016 12:16 AM, Steven D'Aprano wrote:
> > On Thursday 08 December 2016 03:15, DFS wrote:
> >
> >> dts= ['10-Mar-1998',
> >> '20-Aug-1997',
> >> '06-Sep-2009',
> >> '23-Jan-2010',
> >> '12-Feb-2010
On 2016-12-08, Random832 wrote:
> On Wed, Dec 7, 2016, at 03:50, Peter Otten wrote:
>> Is there an equivalent to
>>
>> # touch -- -r
>>
>> on Windows?
>
> Doesn't need one - options conventionally start with /, and filenames
> can't contain /.
But _paths_ can, and Windows command-line apps and
On 12/08/2016 05:43 AM, BartC wrote:
> (Neither will see Shift+Ctrl+B, which means go to start of the file,
> same as Ctrl+Home. Ubuntu sees Ctrl+Home, but not Debian, although it
> will report Alt+Home. And some laptop keyboards already have Home on an
> Alternate-Function shift! It's a mess.)
On Wednesday, 7 December 2016 18:23:23 UTC, Michael Torrie wrote:
> Does Pexpect work on Windows?
Apparently yes:
https://pexpect.readthedocs.io/en/stable/overview.html#pexpect-on-windows
"New in version 4.0: Windows support"
> In the OP's case it looks like the standard in pipe is sufficient
On Wed, Dec 7, 2016, at 15:29, Lew Pitcher wrote:
> But, point of fact is that the feature to disable globbing is not often
> needed. Most Unix programs that accept filenames are happy to accept a
> list of filenames. There is not much call for a program to perform it's own
> globbing, like is requ
On Wed, Dec 7, 2016, at 22:41, Steven D'Aprano wrote:
> Python's fnmatch lib is a good example. It has, or at least had, no
> support for escaping metacharacters. Anyone relying on Python's fnmatch and
> glob
> modules alone for globbing will be unable to handle legitimate file names.
That's not
On Thursday December 8 2016 11:48, in comp.lang.python, "Random832"
wrote:
> On Wed, Dec 7, 2016, at 15:29, Lew Pitcher wrote:
>> But, point of fact is that the feature to disable globbing is not often
>> needed. Most Unix programs that accept filenames are happy to accept a
>> list of filenames.
On 12/08/2016 09:35 AM, Michael Torrie wrote:
> Yes Control codes are, well control codes. Any ascii value under 32.
> They are more or less common across terminal types. I don't know of any
> way around that with terminals.
That is to say that on all terminal types that I'm aware of, the ENTER
On 2016-12-08, Michael Torrie wrote:
> Now we mostly just use one terminal type, "xterm."
Or various other terminal emulators tha are mostly ANSI and Unicode
aware...
And the Linux console...
It's interesting to note that the "real" xterm terminal emulator will
still emulate a Tektronix storag
On Thu, Dec 8, 2016 at 4:34 PM, Grant Edwards wrote:
>
> So, to avoid _that_ problem, Windows command line apps and the cmd.exe
> shell only allow "\" as a path separator.
In cmd you can usually clarify the intent with quotes, e.g. `dir
C:/Windows` fails because it parses "Windows" as a parameter
On 2016-12-08, eryk sun wrote:
> On Thu, Dec 8, 2016 at 4:34 PM, Grant Edwards
> wrote:
>>
>> So, to avoid _that_ problem, Windows command line apps and the cmd.exe
>> shell only allow "\" as a path separator.
>
> In cmd you can usually clarify the intent with quotes, e.g. `dir
> C:/Windows` fai
On 12/08/2016 07:26 AM, Alex Kaye wrote:
> Can you describe some uses or example for using ORM for a Newbie ?
Simply put, ORM is a method for making objects that represent records in
a database. It's usually done in such a way that the objects are
"live." In other words if the object has an attr
On Fri, Dec 9, 2016 at 1:51 AM, Marco Buttu wrote:
> "if a particular name:object mapping cannot be found in the local
> namespaces, the namespaces of the enclosed scope are being searched next. If
> the search in the enclosed scope is unsuccessful, too, Python moves on to
> the global namespace,
On 12/08/2016 10:05 AM, Grant Edwards wrote:
> Or various other terminal emulators tha are mostly ANSI and Unicode
> aware...
>
> And the Linux console...
True.
>
> It's interesting to note that the "real" xterm terminal emulator will
> still emulate a Tektronix storage-scope graphics terminal
On 2016-12-07 07:30, Marko Rauhamaa wrote:
> Tim Chase :
> > On 2016-12-07 00:29, Marko Rauhamaa wrote:
> >> A word a warning: your code doesn't lock /var/run/utmp before
> >> access, which is a race condition. The file may be updated at any
> >> time, and ordinary file reads may yield corrupted re
Datetime has greater range I believe. I can't paste from my work computer,
but try this:
min(datetime.datetime.strptime(s, "%d-%b-%Y") for s in dts)
You should get the 1908 date instead of the 1969 date.
In general, you should always use datetime instead of time for doing date
manipulation and d
Chris Angelico wrote:
> On Fri, Dec 9, 2016 at 1:51 AM, Marco Buttu wrote:
>> "if a particular name:object mapping cannot be found in the local
>> namespaces, the namespaces of the enclosed scope are being searched next.
>> If the search in the enclosed scope is unsuccessful, too, Python moves on
Tim Chase :
> Interesting. I read up on os.open() and os.read()
> https://docs.python.org/2/library/os.html#os.read
> but didn't notice anything there clarifying that it was unbuffered
> compared to the __builtins__.open() and fp.read() functions.
>
> Could you point me to resources where I can
On Fri, Dec 9, 2016 at 5:03 AM, Peter Otten <__pete...@web.de> wrote:
>> The "usual optimization" is exactly what you describe: that different
>> bytecodes represent Local, Enclosing, and Global/Built-in scope
>> lookups. (Globals can be created or removed at run-time, so there's no
>> optimization
Anton, Thanks for the detailed response. I will look into virtualenv and
others. Please excuse beginner's question, but is Xcode of any use in this type
of situation?
--
https://mail.python.org/mailman/listinfo/python-list
On 12/08/2016 11:23 AM, 3dB wrote:
> Anton, Thanks for the detailed response. I will look into virtualenv
> and others. Please excuse beginner's question, but is Xcode of any
> use in this type of situation?
Not directly, but it does provide a C compiler, which some Python
modules require when you
Chris Angelico wrote:
> On Fri, Dec 9, 2016 at 5:03 AM, Peter Otten <__pete...@web.de> wrote:
>>> The "usual optimization" is exactly what you describe: that different
>>> bytecodes represent Local, Enclosing, and Global/Built-in scope
>>> lookups. (Globals can be created or removed at run-time, s
ter and
meta-expression stuff that you're on about?
If so, please tell me how to define '$base="thefile"' from inside
LibreOffice, and how to make use of it in the file dialog entry box.
If not, then what you're arguing about is meaningless.
For example, a
On Fri, Dec 9, 2016 at 6:15 AM, BartC wrote:
> On 08/12/2016 03:41, Steven D'Aprano wrote:
>>
>> On Thursday 08 December 2016 12:15, BartC wrote:
>>
>
>>> That's all. I know the value of keeping things straightforward instead
>>> of throwing in everything you can think of. The file-matching is don
DFS wrote:
>
> Not wanting to use any date parsing libraries,
>
If you happen reconsider date parsing libraries
the strptime function from the datetime module
might be useful
#!/usr/bin/env python3
from datetime import datetime
dates = [ '10-Mar-1998' ,
'20
Thanks Michael,
I think I was confusing Virtual Environment (VE) with IDE.
Probably best if I get to grips with virtualenv to start with since I can't
complete installations at present and VE appears to offer best solution.
--
https://mail.python.org/mailman/listinfo/python-list
Michael,
I tried installing virtual env but got similar permissions error:
IOError: [Errno 13] Permission denied:
'/Library/Python/2.7/site-packages/virtualenv.py'
--
https://mail.python.org/mailman/listinfo/python-list
On 12/08/2016 01:26 PM, 3dB wrote:
> Thanks Michael,
>
> I think I was confusing Virtual Environment (VE) with IDE.
>
> Probably best if I get to grips with virtualenv to start with since I
> can't complete installations at present and VE appears to offer best
> solution.
Despite Anton's warning
On 12/08/2016 01:48 PM, 3dB wrote:
> Michael,
>
> I tried installing virtual env but got similar permissions error:
>
> IOError: [Errno 13] Permission denied:
> '/Library/Python/2.7/site-packages/virtualenv.py'
Just to get virtual environment support you definitely have to install
this package,
Random832 wrote:
Just to point out, brace expansion isn't globbing. The most important
difference is that brace expansion doesn't care what files exist.
However, it's something that the shell expands into multiple
arguments, giving it similar characteristics for the purposes
of this discussion.
On Fri, Dec 9, 2016 at 8:15 AM, Gregory Ewing
wrote:
> The main difference is that you're unlikely to accidentally
> get a million file names or 131072 bytes of arguments that
> way. :-)
python3 argcount.py
{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}{a,b}
65537
Ch
Sorry, I haven't been following this thread carefully. Michael's use of
"sudo" caught my eye though. I know virtualenv might be "special", but
shouldn't this work?
pip install --user virtualenv
It will wind up in $HOME/.local/lib/python2.7/site-packages (or similar) I
believe.
Skip
On Thu, Dec
Grant Edwards wrote:
But _paths_ can, and Windows command-line apps and shells choke on
paths when written with "/" separators because way-back when the
MS-DOS "designers" decided to use "/" as the default option character.
To be fair to them, the use of "/" for options can be traced
back to ea
On 12/08/2016 02:27 PM, Skip Montanaro wrote:
> Sorry, I haven't been following this thread carefully. Michael's use of
> "sudo" caught my eye though. I know virtualenv might be "special", but
> shouldn't this work?
>
> pip install --user virtualenv
>
> It will wind up in $HOME/.local/lib/python2
Michael Torrie wrote:
Interesting. I wouldn't have thought ENTER would return a line feed.
Possibly you have the terminal in "cbreak" mode, which
provides a character at a time but still does things
like translate CR->LF.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 08/12/2016 19:36, Chris Angelico wrote:
On Fri, Dec 9, 2016 at 6:15 AM, BartC wrote:
On 08/12/2016 03:41, Steven D'Aprano wrote:
On Thursday 08 December 2016 12:15, BartC wrote:
That's all. I know the value of keeping things straightforward instead
of throwing in everything you can thi
Michael Torrie wrote:
For example, on Macs,
control-key is not normally used, but rather the Command-key (the apple
key) which happens to be where the Alt key is on our PC keyboards.
Actually, Alt is usually mapped to Option on a Mac. The Mac
Command key corresponds the "Windows" or "Meta" key
On Fri, Dec 9, 2016 at 8:42 AM, BartC wrote:
> Python3 tells me that original, lower-case and upper-case versions are:
>
> ßẞıİiIÅσςσ
> ßßıi̇iiåσςσ
> SSẞIİIIÅΣΣΣ
Now lower-case the upper-case version and see what you get. And
upper-case the lower-case version. Because x.upper().lower() should be
Gregory Ewing :
> Grant Edwards wrote:
>> But _paths_ can, and Windows command-line apps and shells choke on
>> paths when written with "/" separators because way-back when the
>> MS-DOS "designers" decided to use "/" as the default option
>> character.
>
> To be fair to them, the use of "/" for o
On 08/12/2016 22:31, Chris Angelico wrote:
On Fri, Dec 9, 2016 at 8:42 AM, BartC wrote:
Python3 tells me that original, lower-case and upper-case versions are:
ßẞıİiIÅσςσ
ßßıi̇iiåσςσ
SSẞIİIIÅΣΣΣ
Now lower-case the upper-case version and see what you get. And
upper-case the lower-case version
On Fri, Dec 9, 2016 at 10:03 AM, Marko Rauhamaa wrote:
> I find it a bit annoying that "/" cannot be used in Linux filenames.
> Slashes have very common everyday uses and it's a pity they are
> reserved. Instead, ASCII control characters are allowed, which is of no
> use.
How would you do otherwi
On 12/08/2016 02:46 PM, Gregory Ewing wrote:
> Michael Torrie wrote:
>> For example, on Macs,
>> control-key is not normally used, but rather the Command-key (the apple
>> key) which happens to be where the Alt key is on our PC keyboards.
>
> Actually, Alt is usually mapped to Option on a Mac. The
On Fri, 9 Dec 2016 01:51 am, Marco Buttu wrote:
> Sometimes the Python name resolution is explained using a LEGB rule.
> For instance, in [1] (I think also the Learning Python book gives the
> same):
>
> "if a particular name:object mapping cannot be found in the local
> namespaces, the namespace
> > pip install --user virtualenv
> >
> > It will wind up in $HOME/.local/lib/python2.7/site-packages (or similar) I
> > believe.
Michael, Skip,
I've noticed that Python is in the highest level of the drive,
HDD/Library/Python as opposed to usr/Library. Does that present a problem?
Also noti
On 12/08/2016 04:19 PM, BartC wrote:
> What were we talking about again? Oh yes, belittling me because I work
> with Windows!
Yes it's kind of getting that way, which means this conversation is at
an end. I don't think Chris or Steven or anyone else who has gone round
and round with you has mean
> pip install --user virtualenv
>
> It will wind up in $HOME/.local/lib/python2.7/site-packages (or similar) I
> believe.
Skip, thanks, that worked for virtualenv.
I'll now try sudo for Speechrecognition.
--
https://mail.python.org/mailman/listinfo/python-list
On 12/08/2016 05:19 PM, 3dB wrote:
>>> pip install --user virtualenv
>>>
>>> It will wind up in $HOME/.local/lib/python2.7/site-packages (or
>>> similar) I believe.
>
> Michael, Skip,
>
> I've noticed that Python is in the highest level of the drive,
> HDD/Library/Python as opposed to usr/Librar
On 12/08/2016 05:22 PM, 3dB wrote:
>> pip install --user virtualenv
>>
>> It will wind up in $HOME/.local/lib/python2.7/site-packages (or similar) I
>> believe.
>
> Skip, thanks, that worked for virtualenv.
>
> I'll now try sudo for Speechrecognition.
You should be able to install speach recogni
On Fri, Dec 9, 2016 at 10:19 AM, BartC wrote:
> I get this (although I suspect Thunderbird will screw up the tabs); the code
> I used follows at the end:
Actually it came through just fine. Although, point of note: the case
conversions of individual characters are not the same as the case
conver
On 09/12/2016 00:55, Chris Angelico wrote:
On Fri, Dec 9, 2016 at 10:19 AM, BartC wrote:
So it it perfectly possible to have case conversion defined for English,
while other alphabets can do what they like.
And there we have it. Not only do you assume that English is the
only thing that
With a case-sensitive file system, how do you search only for 'harry', not
knowing what combinations of upper and lower case have been used? (It's a
good thing Google search isn't case sensitive!)
On Linux, I'd do "find . -iname harry". A lot, but not all, of the tools
usually have options to igno
On Fri, Dec 9, 2016 at 12:34 PM, BartC wrote:
> With a case-sensitive file system, how do you search only for 'harry', not
> knowing what combinations of upper and lower case have been used? (It's a
> good thing Google search isn't case sensitive!)
This is handled by "case correlations", which ar
Emile van Sebille wrote:
> On 11/21/2016 11:27 AM, subhabangal...@gmail.com wrote:
>> I have a python script where I am trying to read from a list of files
>> in a folder and trying to process something. As I try to take out the
>> output I am presently appending to a list.
>>
>> But I am trying t
g thakuri wrote:
> Dear Python friends,
>
> I have a simple question , need your suggestion the same
>
> I would want to avoid using multiple split in the below code , what
> options do we have before tokenising the line?, may be validate the
> first line any other ideas
>
> cmd = 'utility %
On Fri, 9 Dec 2016 12:32 pm, Dennis Lee Bieber wrote:
> There is always VMS:
>
> volume:[dir.sub.subsub]fn.ext;ver
>
> (where volume could be a hardware device or a logical name -- which is NOT
> the same as an environment variable; only other place I've seen something
> similar is the Amiga --
On Thu, Dec 8, 2016, at 20:38, Dennis Lee Bieber wrote:
> On Thu, 08 Dec 2016 10:37:27 -0500, Random832
> declaimed the following:
> >There are other issues, like needing a way to do Windows' version of
> >wildcard parsing with all its quirks, or at least some of its quirks -
> >"*.*" for all file
Chris Angelico :
> On Fri, Dec 9, 2016 at 10:03 AM, Marko Rauhamaa wrote:
>> I find it a bit annoying that "/" cannot be used in Linux filenames.
>> Slashes have very common everyday uses and it's a pity they are
>> reserved. Instead, ASCII control characters are allowed, which is of
>> no use.
>
Random832 :
> On Thu, Dec 8, 2016, at 20:38, Dennis Lee Bieber wrote:
>> In the original 8.3 scheme -- no files "contained" a dot
>
> Yes, but they do now, and the compatibility quirks persist.
When porting a Python program to Windows, I noticed the filename "aux"
is not allowed in Windows.
67 matches
Mail list logo