On Sunday, January 8, 2017 at 1:17:56 AM UTC-5, Steven D'Aprano wrote:
> On Sunday 08 January 2017 15:33, CM wrote:
>
> > On Saturday, January 7, 2017 at 7:59:01 PM UTC-5, Steve D'Aprano wrote:
> [...]
> >> Start by printing repr(candidate_text) and see what you really have.
> >
> > Yes, that did
Grumpy, an experimental project from Google, transpiles Python code into Go,
allowing Python programs to be compiled and run as static binaries using the Go
toolchain.
http://www.infoworld.com/article/3154624/application-development/google-boosts-python-by-turning-it-into-go.html
--
Steven
"E
Pablo Lucena writes:
> How about using the second usage of builtin iter()?
>
> In [92]: iter?
> Docstring:
> iter(iterable) -> iterator
> iter(callable, sentinel) -> iterator
Nice to learn about that. But it has the same problem as
itertools.takewhile:
> In [88]: numbers
> Out[88]: [1, 9, 8, 11,
On 07Jan2017 22:26, jim wrote:
You've convinced me. I will have to buckle down and figure out to use
virtualenv/venv. I see Chris recommends venv. I read through PEP405 and this
link https://docs.python.org/3.5/library/venv.html. I don't pretend to fully
understand it all but it does seem to
On Sunday 08 January 2017 16:39, Deborah Swanson wrote:
> What I've done so far:
>
> with open('E:\\Coding projects\\Pycharm\\Moving\\Moving 2017 in.csv',
> 'r') as infile:
> ls = list(csv.reader(infile))
> lst = namedtuple('lst', ls[0])
>
> where 'ls[0]' is the header row of the csv, an
On Sunday 08 January 2017 15:33, CM wrote:
> On Saturday, January 7, 2017 at 7:59:01 PM UTC-5, Steve D'Aprano wrote:
[...]
>> Start by printing repr(candidate_text) and see what you really have.
>
> Yes, that did it. The repr of that one was, in fact:
>
> u'match /r'
Are you sure it is a forwar
Paul Rubin writes:
> Jussi Piitulainen writes:
>>> Use itertools.takewhile
>> How? It consumes the crucial stop element:
>
> Oh yucch, you're right, it takes it from both sides. How about this:
>
> from itertools import takewhile, islice
> def minabs(xs):
> a = iter(xs)
> m =
What I've done so far:
with open('E:\\Coding projects\\Pycharm\\Moving\\Moving 2017 in.csv',
'r') as infile:
ls = list(csv.reader(infile))
lst = namedtuple('lst', ls[0])
where 'ls[0]' is the header row of the csv, and it works perfectly well.
'lst' is a namedtuple instance with each of th
On Sun, Jan 8, 2017 at 3:31 PM, CM wrote:
> On Saturday, January 7, 2017 at 6:42:25 PM UTC-5, Chris Angelico wrote:
>
>> What happens if you print the repr of each string? Or, if one of them
>> truly is a literal, just print the repr of the one you got from
>> win32com.
>>
>> ChrisA
>
> Yes, that
Trying to manipulate z-order for MSOffice with win32com and wasn't sure what
argument was needed. Using help on that ZOrder method gives:
>>>
Help on method ZOrder in module win32com.client.dynamic:
ZOrder(self, ZOrderCmd=) method of
win32com.client.CDispatch instance
So, what does " mean in
On Saturday, January 7, 2017 at 7:59:01 PM UTC-5, Steve D'Aprano wrote:
> On Sun, 8 Jan 2017 08:40 am, CM wrote:
>
> > So what's going on here? Why isn't a string with the content 'match' equal
> > to another string with the content 'match'?
>
> You don't know that the content is 'match'. All you
On Saturday, January 7, 2017 at 6:42:25 PM UTC-5, Chris Angelico wrote:
> What happens if you print the repr of each string? Or, if one of them
> truly is a literal, just print the repr of the one you got from
> win32com.
>
> ChrisA
Yes, that did it. The repr of that one was, in fact:
u'match /
On 01/07/2017 08:42 PM, Cameron Simpson wrote:
On 07Jan2017 19:45, jim wrote:
On 01/07/2017 05:58 PM, Clint Moyer wrote:
So to minimize your issues with installing Python packages, take the
path of least resistance and install through your system repo. And use
Python2 or Python3 explicitly to
Jussi Piitulainen writes:
>> Use itertools.takewhile
> How? It consumes the crucial stop element:
Oh yucch, you're right, it takes it from both sides. How about this:
from itertools import takewhile, islice
def minabs(xs):
a = iter(xs)
m = min(map(abs,takewhile(lambda x:
I would lightly advise against, assuming both Pip and your package
manager are trying to accomplish nearly the same thing. Stick with
updating through the repo.
If you find that the version your OS provides is out-of-date compared
to what's on PyPi or Github, then you might want to remove from you
On 07Jan2017 19:45, jim wrote:
On 01/07/2017 05:58 PM, Clint Moyer wrote:
So to minimize your issues with installing Python packages, take the
path of least resistance and install through your system repo. And use
Python2 or Python3 explicitly to avoid conflicts.
As I mentioned in another pos
On 07Jan2017 19:02, jim wrote:
On 01/07/2017 03:17 PM, Dennis Lee Bieber wrote:
On Sat, 7 Jan 2017 12:22:45 -0600, jim declaimed
the following:
What is "system python"? If I do $ which python I get /usr/bin/python
which points to python 2.7xx. So if everything I added was for python 3
either
How about using the second usage of builtin iter()?
In [92]: iter?
Docstring:
iter(iterable) -> iterator
iter(callable, sentinel) -> iterator
Get an iterator from an object. In the first form, the argument must
supply its own iterator, or be a sequence.
*In the second form, the callable is calle
On 01/07/2017 05:58 PM, Clint Moyer wrote:
Not sure how you guys got this thread so far off topic, but I think it
is valuable to present the current situation in the context of Jim's
sudo question. Staying on topic, the emphasis should be on taking the
path of least resistance with your current O
On Sun, 8 Jan 2017 08:40 am, CM wrote:
> So what's going on here? Why isn't a string with the content 'match' equal
> to another string with the content 'match'?
You don't know that the content is 'match'. All you know is that when
printed, it *looks like* 'match'.
Hint:
s = 'match '
print 'mat
On 01/07/2017 03:17 PM, Dennis Lee Bieber wrote:
On Sat, 7 Jan 2017 12:22:45 -0600, jim declaimed
the following:
What is "system python"? If I do $ which python I get /usr/bin/python
which points to python 2.7xx. So if everything I added was for python 3
either using pip3 or apt-get would I b
Not sure how you guys got this thread so far off topic, but I think it
is valuable to present the current situation in the context of Jim's
sudo question. Staying on topic, the emphasis should be on taking the
path of least resistance with your current OS. The only thing to be
gleaned from PEP394 i
On Sun, 8 Jan 2017 08:48 am, Ethan Furman wrote:
> In Python 2 we have:
>
>dict().keys() \
>dict().items() --> separate list() of the results
>dict().values() /
>
> and
>
>dict().iter_keys() \
>dict().iter_items() --> integrated iter() of the results
>dict().it
On 08Jan2017 11:22, Chris Angelico wrote:
On Sun, Jan 8, 2017 at 10:51 AM, Cameron Simpson wrote:
Here's an example:
$ mkdir ~/var ~/var/venv # where I keep my virtualenvs
$ virtualenv -p /usr/bin/python3 --system-site-packages ~/var/venv/3
$ ~/var/venv/3/bin/python3# invokes the virt
On Sun, Jan 8, 2017 at 11:15 AM, Jack Harvey wrote:
> I'm starting out with Python 3.5. My current frustration is with:
>
>
math.sqrt(25)
> Traceback (most recent call last):
> File "", line 1, in
> math.sqrt(25)
> NameError: name 'math' is not defined
>
>
> Advice?
A lot of Pyt
On Sun, Jan 8, 2017 at 10:51 AM, Cameron Simpson wrote:
> Here's an example:
>
> $ mkdir ~/var ~/var/venv # where I keep my virtualenvs
> $ virtualenv -p /usr/bin/python3 --system-site-packages ~/var/venv/3
> $ ~/var/venv/3/bin/python3# invokes the virtualenv python3
> $ ~/var/venv/3/bin/
I'm starting out with Python 3.5. My current frustration is with:
>>> math.sqrt(25)
Traceback (most recent call last):
File "", line 1, in
math.sqrt(25)
NameError: name 'math' is not defined
>>>
Advice?
Jack
--
https://mail.python.org/mailman/listinfo/python-list
On 07Jan2017 12:22, jim wrote:
On 01/06/2017 08:24 PM, Cameron Simpson wrote:
On 06Jan2017 23:03, Clint Moyer wrote:
Packages supplied by your distribution can be trusted more than packages
from PyPi. Just my two cents.
Most distros offer nearly all the useful Python modules directly from the
On Sun, Jan 8, 2017 at 8:40 AM, CM wrote:
>
> This is candidate_text: match
>
>
> False
>
> and, of course, doesn't enter that "do something" loop since apparently
> candidate_text != 'match'...even though it seems like it does.
>
> So what's going on here? Why isn't a string with the content '
On Sun, Jan 8, 2017 at 9:34 AM, Michael Torrie wrote:
> On 01/07/2017 11:39 AM, Clint Moyer wrote:
>> All Linux operating systems come with Python installed, with more
>> recent systems such as Arch defaulting /usr/bin/python to Python3,
>> since Python2 discontinued some 7-9 years ago.
>
> Poor c
On 01/07/2017 03:04 PM, Peter Otten wrote:
Ethan Furman wrote:
In Python 2 we have:
dict().keys() \
dict().items() --> separate list() of the results
dict().values() /
and
dict().iter_keys() \
dict().iter_items() --> integrated iter() of the results
dict().i
Ethan Furman wrote:
> In Python 2 we have:
>
>dict().keys() \
>dict().items() --> separate list() of the results
>dict().values() /
>
> and
>
>dict().iter_keys() \
>dict().iter_items() --> integrated iter() of the results
>dict().iter_values() /
I guess you di
On 01/07/2017 11:39 AM, Clint Moyer wrote:
> All Linux operating systems come with Python installed, with more
> recent systems such as Arch defaulting /usr/bin/python to Python3,
> since Python2 discontinued some 7-9 years ago.
Poor choice of words, in my opinion. Python 2 has not received new
All Linux operating systems come with Python installed, with more
recent systems such as Arch defaulting /usr/bin/python to Python3,
since Python2 discontinued some 7-9 years ago. I believe Ubuntu still
defaults that to Python2, however.
So when you run pip3 you are attempting to download and inst
In Python 2 we have:
dict().keys() \
dict().items() --> separate list() of the results
dict().values() /
and
dict().iter_keys() \
dict().iter_items() --> integrated iter() of the results
dict().iter_values() /
By "separate list" I mean a snapshot of the dict at the time,
This is probably very simple but I get confused when it comes to encoding and
am generally rusty. (What follows is in Python 2.7; I know.).
I'm scraping a Word docx using win32com and am just trying to do some matching
rules to find certain paragraphs that, for testing purposes, equal the word
On 01/06/2017 11:34 PM, Steve D'Aprano wrote:
On Sat, 7 Jan 2017 12:03 am, Steve D'Aprano wrote:
The second hardest problem in computer science is cache invalidation.
The *hardest* problem is naming things.
After puzzling over this for three days, it suddenly hit me:
Theme = namedtuple("The
On 01/06/2017 08:24 PM, Cameron Simpson wrote:
On 06Jan2017 23:03, Clint Moyer wrote:
Thanks everyone for the advice. Please note in my following comments I
am not arguing with anyone, merely trying to understand. I am not a
professional programmer, just someone who enjoys programing for my
Rustom Mody writes:
> On a Saturday, Jussi Piitulainen wrote:
[snip]
>> You switched to a simpler operator. Would Haskell notice that
>>
>>def minabs(x, y): return min(x, y, key = abs)
>>
>> has a meaningful zero? Surely it has its limits somewhere and then
>> the programmer needs to supply
On Fri, 06 Jan 2017 12:00:32 +1200, Iranna Mathapati wrote:
> Hi Team,
>
> How to match latter(caps and small) ,numbers and # symbol in python
> pexpect.
>
>
> Thanks,
> Iranna M
Simple
just write a small program
--
New screensaver released: Curtains for Windows.
--
https://mail.python.
On Saturday, January 7, 2017 at 1:42:47 PM UTC+5:30, Jussi Piitulainen wrote:
> Rustom Mody writes:
>
> > On Saturday, Jussi Piitulainen wrote:
> >> Paul Rubin writes:
> >>
> >> > Peter Otten writes:
> >> >> How would you implement stopmin()?
> >> >
> >> > Use itertools.takewhile
> >>
> >> How?
Peter Otten wrote:
> Example: you are looking for the minimum absolute value in a series of
> integers. As soon as you encounter the first 0 it's unnecessary extra work
> to check the remaining values, but the builtin min() will continue.
>
> The solution is a minimum function that allows the use
Steve D'Aprano wrote:
> On Sat, 7 Jan 2017 01:04 am, Peter Otten wrote:
>
>> Example: you are looking for the minimum absolute value in a series of
>> integers. As soon as you encounter the first 0 it's unnecessary extra
>> work to check the remaining values, but the builtin min() will continue.
Paul Rubin wrote:
> Peter Otten <__pete...@web.de> writes:
>> How would you implement stopmin()?
>
> Use itertools.takewhile
I should have mentioned that I had already run into that -- let's call it --
off-by-one bug.
--
https://mail.python.org/mailman/listinfo/python-list
Wolfgang Maier wrote:
> On 1/6/2017 15:04, Peter Otten wrote:
>> Example: you are looking for the minimum absolute value in a series of
>> integers. As soon as you encounter the first 0 it's unnecessary extra
>> work to check the remaining values, but the builtin min() will continue.
>>
>> The sol
Jussi Piitulainen wrote:
> Peter Otten writes:
>
>> Example: you are looking for the minimum absolute value in a series of
>> integers. As soon as you encounter the first 0 it's unnecessary extra
>> work to check the remaining values, but the builtin min() will continue.
>>
>> The solution is a m
On Sat, 7 Jan 2017 07:06 am, Wolfgang Maier wrote:
> On 1/6/2017 15:04, Peter Otten wrote:
[...]
>> How would you implement stopmin()?
>>
>
> How about:
>
> def stopmin (iterable, key, stop):
> def take_until ():
> for e in iterable:
> yield e
> if key(e)
Gregory Ewing wrote, on January 07, 2017 1:13 AM
>
> Deborah Swanson wrote:
> > File "E:/Coding projects/Pycharm/Moving/moving_numberedtuples.py",
> > line 139, in moving()
> > for lst in map(listings._make, csv.reader(open('E:\\Coding
> > projects\\Pycharm\\Moving\\Moving 2017 in.csv',"r")
> On 2017-01-07, at 03:24, Cameron Simpson wrote:
>
> Having your on virtualenv is good for: [...] having an isolated environment
> for packages (you can make more than one virtual environment).
Yes, indeed. For example, if you have to maintain two different codebases, one
using Django 1.8 an
Deborah Swanson wrote:
File "E:/Coding projects/Pycharm/Moving/moving_numberedtuples.py",
line 139, in moving()
for lst in map(listings._make, csv.reader(open('E:\\Coding
projects\\Pycharm\\Moving\\Moving 2017 in.csv',"r"))):
TypeError: 'str' object is not callable
I know you've found the
Chris Angelico writes:
> On Sat, Jan 7, 2017 at 7:12 PM, Jussi Piitulainen wrote:
>> You switched to a simpler operator. Would Haskell notice that
>>
>>def minabs(x, y): return min(x, y, key = abs)
>>
>> has a meaningful zero? Surely it has its limits somewhere and then
>> the programmer need
On Sat, Jan 7, 2017 at 7:12 PM, Jussi Piitulainen
wrote:
> You switched to a simpler operator. Would Haskell notice that
>
>def minabs(x, y): return min(x, y, key = abs)
>
> has a meaningful zero? Surely it has its limits somewhere and then the
> programmer needs to supply the information.
If
Rustom Mody writes:
> On Saturday, Jussi Piitulainen wrote:
>> Paul Rubin writes:
>>
>> > Peter Otten writes:
>> >> How would you implement stopmin()?
>> >
>> > Use itertools.takewhile
>>
>> How? It consumes the crucial stop element:
>>
>>it = iter('what?')
>>list(takewhile(str.isalpha,
On Sat, 7 Jan 2017 01:04 am, Peter Otten wrote:
> Example: you are looking for the minimum absolute value in a series of
> integers. As soon as you encounter the first 0 it's unnecessary extra work
> to check the remaining values, but the builtin min() will continue.
>
> The solution is a minimum
54 matches
Mail list logo