Re: Quotation Ugliness

2014-11-25 Thread Chris Angelico
On Wed, Nov 26, 2014 at 5:04 PM, Tim Daneliuk wrote: > Here's a usecase - I want to know whether I need > to use a sudo password when the user passes a command on the command line > of a program: > > someprog.py uname && sudo cat /etc/sudoers > > vs. > > someprog.py uname && echo "sudo cat /etc/su

Using a password with ‘sudo’ (was: Quotation Ugliness)

2014-11-25 Thread Ben Finney
Tim Daneliuk writes: > Here's a usecase - I want to know whether I need to use a sudo > password when the user passes a command on the command line of a > program: […] > In the first instance, I need the sudo passoword, in the second I don't. I don't understand what “need a sudo password” mean

Re: PyPI auth issues (Server response (401): basic auth failed)

2014-11-25 Thread dieter
Ricardo Bánffy writes: > I must be doing something wrong, but I (and the clever folks at the #python > channel) can't figure what. > ... > Registering Appengine-Fixture-Loader to http://pypi.python.org/pypi > Server response (401): basic auth failed > > So, what am I doing wrong? I find it strang

Re: [ANN] PyUBL

2014-11-25 Thread dieter
Burak Arslan writes: > We've gone through the grunt work of researching and integrating > XMLDSIG, XAdES and UBL schemas and its various extensions and > dependencies and wrote a bunch of scripts that map these documents to > python objects. In this context, I would like to mention "PyXB" ("https

Re: Quotation Ugliness

2014-11-25 Thread Tim Daneliuk
On 11/25/2014 07:54 PM, Ben Finney wrote: Tim Daneliuk writes: Here's the problem: Determine is the string S appears *outside* or *inside* any such quotation. This is a problem for parsing text. There is no general, simple solution. If someone tries to convince you they have one, be highly

Re: Quotation Ugliness

2014-11-25 Thread Tim Daneliuk
On 11/25/2014 07:44 PM, Tim Chase wrote: On 2014-11-25 19:20, Tim Daneliuk wrote: hen you find any opener, you seek its corresponding closer, and then special-case /* to count any additional /* and look for a */ for each one */ . That's more or less where I was headed. I just wanted something

Re: Quotation Ugliness

2014-11-25 Thread Tim Daneliuk
On 11/25/2014 07:32 PM, Chris Angelico wrote: On Wed, Nov 26, 2014 at 12:18 PM, Tim Daneliuk wrote: And what should happen with mismatched quotes? do("th/*is", "and", "th*/at") Match pairs as usual, and let the remaining unterminated quote run on. Wait, what? Where's an unterminated q

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Michael Torrie
On 11/25/2014 02:36 PM, Juan Christian wrote: > So guys, I had to change to approach, I read that using Qt I can't do > multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, > QThred)'. I had to change the code a bit: > > So, let's see the problems: > > Traceback (most recent

Re: Quotation Ugliness

2014-11-25 Thread Ben Finney
Tim Daneliuk writes: > Here's the problem: Determine is the string S appears *outside* or > *inside* any such quotation. This is a problem for parsing text. There is no general, simple solution. If someone tries to convince you they have one, be highly suspicious: it will either be not general,

Re: Quotation Ugliness

2014-11-25 Thread Tim Chase
On 2014-11-25 19:20, Tim Daneliuk wrote: > > hen you find any opener, you seek its > corresponding closer, and then special-case /* to count any > additional /* and look for a */ for each one */ . > > That's more or less where I was headed. I just wanted something > less brute force :) This se

Re: Quotation Ugliness

2014-11-25 Thread Chris Angelico
On Wed, Nov 26, 2014 at 12:18 PM, Tim Daneliuk wrote: >> And what should happen with mismatched quotes? >> >>do("th/*is", "and", "th*/at") > > > Match pairs as usual, and let the remaining unterminated quote run on. Wait, what? Where's an unterminated quote? I can imagine two ways of reading

Re: Quotation Ugliness

2014-11-25 Thread Tim Daneliuk
On 11/25/2014 06:40 PM, Tim Chase wrote: On 2014-11-25 18:18, Tim Daneliuk wrote: A problem for your consideration: We are given a tuple of delimiter string pairs to quote or comment text, possibly over multiple lines. Something like this: delims = (('"', '"'), ("'", "'"), ('#', '\n'),

Re: Quotation Ugliness

2014-11-25 Thread Tim Daneliuk
On 11/25/2014 06:44 PM, Chris Angelico wrote: You may have issues with your definition of nesting, though. For instance, what's it mean if you have double-quotes, then a hash? It means that the hash is quoted as part of the literal string. then the only nesting you need worry about is /* and

Content-Type (was: Fwd: Python Signal/Slot + QThred code analysis)

2014-11-25 Thread Christoph M. Becker
Juan Christian wrote: > OFF-TOPIC: You guys said that my emails had some trash HTML and strange > stuffs, is it OK now? You're still sending: Content-Type: multipart/alternative Please configure your MUA to send Content-Type: text/plain only. -- Christoph M. Becker -- https://mail.pyt

Re: Challenge: optimizing isqrt

2014-11-25 Thread Dave Angel
On 11/25/2014 02:31 PM, Serhiy Storchaka wrote: п'ятниця, 21-лис-2014 08:15:57 ви написали: This looks very good indeed. As a matter of interest, is there any particular reason you have used 2*b instead of b+b? Might b+b be faster than b*2? Yes, it is slightly faster, but the effect is indisce

Re: Quotation Ugliness

2014-11-25 Thread Chris Angelico
On Wed, Nov 26, 2014 at 11:18 AM, Tim Daneliuk wrote: > A problem for your consideration: > > We are given a tuple of delimiter string pairs to quote or comment text, > possibly over multiple lines. Something like this: > > delims = (('"', '"'), ("'", "'"), ('#', '\n'), ("\*", "*\), ('\\', '

Re: Quotation Ugliness

2014-11-25 Thread Tim Chase
On 2014-11-25 18:18, Tim Daneliuk wrote: > A problem for your consideration: > > We are given a tuple of delimiter string pairs to quote or comment > text, possibly over multiple lines. Something like this: > > delims = (('"', '"'), ("'", "'"), ('#', '\n'), ("\*", "*\), > ('\\', '\n') ...)

Quotation Ugliness

2014-11-25 Thread Tim Daneliuk
A problem for your consideration: We are given a tuple of delimiter string pairs to quote or comment text, possibly over multiple lines. Something like this: delims = (('"', '"'), ("'", "'"), ('#', '\n'), ("\*", "*\), ('\\', '\n') ...) These may be nested. Here's the problem: Determine

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
So guys, I had to change to approach, I read that using Qt I can't do multiple inheritance. So my Outpost class can't be like 'Outpost(QObject, QThred)'. I had to change the code a bit: from PySide.QtCore import QObject, QThread, Signal import requests import bs4 class Worker(QThread): def __ini

PyPI auth issues (Server response (401): basic auth failed)

2014-11-25 Thread Ricardo Bánffy
Hi folks. I must be doing something wrong, but I (and the clever folks at the #python channel) can't figure what. I'm doing a: python setup.py register -r pypitest And getting the following in return running register running egg_info writing Appengine_Fixture_Loader.egg-info/PKG-INFO writing t

CFFI distribution questions

2014-11-25 Thread Israel Brewster
So I have a python module that I have written which uses CFFI to link against a C library I have compiled. Specifically, it is a Database driver for the 4th dimension database, using an open-source C library distributed by the 4D company. I have tested the module and C code on a couple of different

Re: Challenge: optimizing isqrt

2014-11-25 Thread Serhiy Storchaka
п'ятниця, 21-лис-2014 08:15:57 ви написали: This looks very good indeed. As a matter of interest, is there any particular reason you have used 2*b instead of b+b? Might b+b be faster than b*2? Yes, it is slightly faster, but the effect is indiscernible in total time. But there is not harm to

Re: Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread MRAB
On 2014-11-25 15:48, Juan Christian wrote: On Tue Nov 25 2014 at 1:42:24 PM MRAB mailto:pyt...@mrabarnett.plus.com>> wrote: I think that the problem there is that strings don't have an __exit__ method. I don't understand what you said, what you mean by that? =/ The traceback says: Traceback (

Re: Dictionary error

2014-11-25 Thread Dave Angel
On 11/25/2014 04:34 AM, Thuruv V wrote: Please Clarify the 'TypeError: zip argument #1 must support iteration' import openpyxl book = openpyxl.load_workbook('c:/users/c_thv/desktop/tax.xlsx') sheet = book.get_sheet_by_name('Thilip') cell = sheet.cell(row=2,column = 4) i = 2 x = [] y = []while

Re: Dictionary error

2014-11-25 Thread John Gordon
In Thuruv V writes: > Please Clarify the 'TypeError: zip argument #1 must support iteration' > import openpyxl > book = openpyxl.load_workbook('c:/users/c_thv/desktop/tax.xlsx') > sheet = book.get_sheet_by_name('Thilip') > cell = sheet.cell(row=2,column = 4) > i = 2 > x = [] > y = []while i

Call for notes about Eric IDE

2014-11-25 Thread Pietro Moras
In view of next edition of the Eric IDE Technical Report (forecast: 3rd quarter '15) we'll welcome your testimony of experiences and use of specific Eric IDE's features, such as: – Special features of your choice, such as: SQL Browser, Qt Forms Designer, Debug Remote Configurable, Eric API

Fwd: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
On Tue Nov 25 2014 at 1:42:24 PM MRAB wrote: I think that the problem there is that strings don't have an __exit__ method. I don't understand what you said, what you mean by that? =/ -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Signal/Slot + QThred code analysis

2014-11-25 Thread MRAB
On 2014-11-25 13:58, Juan Christian wrote: On Mon Nov 24 2014 at 11:56:31 PM Michael Torrie mailto:torr...@gmail.com>> wrote: Looks alright. Does it work? Well, no =/ First I had to remove the multiple inheritance, because Qt doesn't allow that, so I removed the QObject. Second, just for testi

Re: PYTHON LOGGING with StreamHandler and FileHandler

2014-11-25 Thread Peter Otten
Ganesh Pal wrote: > Thanks for the hint , I was able to get the error messages on the console > by setting the StreamHandler level to WARNING . > > It works for me know butone LAST question , it might sound simple, > but Iam not able to understand the difference between > > - (a) ch

Re: Python Documentation Improvement

2014-11-25 Thread Steven D'Aprano
Archana Pandey wrote: [...] > A = a + 1 and a += 1 both behave in same way for all data types except > python Lists I cannot think of any other mutable data type that supports + but there are mutable data types that support other augmented assignment operators: py> a = set("abcd") py> b = a #

Re: Most gratuitous comments

2014-11-25 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Marco Buttu : > >> To acknowledge the OP, the statistics module deserves to be taken as >> example for writing good comments and docstrings: >> >> https://hg.python.org/cpython/file/3.4/Lib/statistics.py > > True, it is done with good style. It concentrates on documenting

Re: Basic asyncio usage

2014-11-25 Thread Benjamin Risher
On Monday, November 24, 2014 10:26:42 AM UTC-6, Marko Rauhamaa wrote: > Benjamin Risher : > > > I was wondering if you ever made progress with your asyncio project. > > I'm currently digging around for examples and reference material and > > came across your post. > > > > I'd be interested in any

Re: Python Signal/Slot + QThred code analysis

2014-11-25 Thread Juan Christian
On Mon Nov 24 2014 at 11:56:31 PM Michael Torrie wrote: Looks alright. Does it work? Well, no =/ First I had to remove the multiple inheritance, because Qt doesn't allow that, so I removed the QObject. Second, just for testing I'm calling the module directly using: timer = QTimer() timer.start

Re: PYTHON LOGGING with StreamHandler and FileHandler

2014-11-25 Thread Ganesh Pal
Thanks for the hint , I was able to get the error messages on the console by setting the StreamHandler level to WARNING . It works for me know butone LAST question , it might sound simple, but Iam not able to understand the difference between - (a) ch.setLevel(logging.WARNING) and c

Re: FW: Unexpexted behaviot of python operators on list

2014-11-25 Thread Denis McMahon
On Tue, 25 Nov 2014 12:20:26 +, Mark Lawrence wrote: > a=[1,2,3] binds a to the list [1,2,3] > b=a binds b to a > b+=[4,5] Changes existing b, which is also a > x=[1,2,3] binds x to the list [1,2,3] > y=x binds y to x > y=y+[4,5] Binds y to a new list which comprises previous y plus

Re: python 2.7 and unicode (one more time)

2014-11-25 Thread Chris Angelico
On Tue, Nov 25, 2014 at 10:56 PM, Steven D'Aprano wrote: > I think this conversation is going nowhere, so it's probably best to end it. \0 ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: Most gratuitous comments

2014-11-25 Thread Marko Rauhamaa
Marco Buttu : > To acknowledge the OP, the statistics module deserves to be taken as > example for writing good comments and docstrings: > > https://hg.python.org/cpython/file/3.4/Lib/statistics.py True, it is done with good style. It concentrates on documenting use and lets the implementation do

Re: Most gratuitous comments

2014-11-25 Thread Marco Buttu
On 21/11/2014 07:52, Marko Rauhamaa wrote: sohcahto...@gmail.com: >My point was that I was making fun of CS professors that demand a >comment on every line of code, regardless of how clear the line of >code is. Unfortunately, a lot of software houses do a similar thing. Not quite every line, b

[ANN] PyUBL

2014-11-25 Thread Burak Arslan
All, We've gone through the grunt work of researching and integrating XMLDSIG, XAdES and UBL schemas and its various extensions and dependencies and wrote a bunch of scripts that map these documents to python objects. UBL stands for Universal Business Language. It's an OASIS standard that defines

Re: FW: Unexpexted behaviot of python operators on list

2014-11-25 Thread Dave Angel
On 11/25/2014 04:23 AM, PANDEY2 Archana (MORPHO) wrote: Hello Welcome. This is apparently your first post, or at least first for quite a while. Note that this is a text forum (usenet, mailing list), and doesn't properly support either html messages nor attachments. Just tell your mailer

Re: Python Documentation Improvement

2014-11-25 Thread Mark Lawrence
On 25/11/2014 11:44, Archana Pandey wrote: Hello I hereby would like to share the problem I have faced regarding python list implementation :- As per python documentation python list is mutable data object. The problem I found with the list is that is behaves differently when we use ‘+=’ and ‘

Re: FW: Unexpexted behaviot of python operators on list

2014-11-25 Thread Mark Lawrence
On 25/11/2014 11:40, Steven D'Aprano wrote: PANDEY2 Archana (MORPHO) wrote: Hello I hereby would like to share the problem I have found regarding python list implementation:- As per python documentation python list is mutable data object. That problem I found with the list is that is behaves

Re: python 2.7 and unicode (one more time)

2014-11-25 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Steven D'Aprano : > >> Marko Rauhamaa wrote: >> Py3's byte strings are still strings, though. >>> >>> Hm. I don't think so. In a plain English sense, maybe, but that kind of >>> usage can lead to confusion. >> >> Only if you are determined to confuse yourself. >> >>

Re: FW: Unexpexted behaviot of python operators on list

2014-11-25 Thread Steven D'Aprano
PANDEY2 Archana (MORPHO) wrote: > Hello > > I hereby would like to share the problem I have found regarding python > list implementation:- > > As per python documentation python list is mutable data object. > > That problem I found with the list is that is behaves differently when we > use '+='

Python Documentation Improvement

2014-11-25 Thread Archana Pandey
Hello I hereby would like to share the problem I have faced regarding python list implementation :- As per python documentation python list is mutable data object. The problem I found with the list is that is behaves differently when we use ‘+=’ and ‘+’ ‘=’ operators separately. For example-

Re: Dictionary error

2014-11-25 Thread Steven D'Aprano
Thuruv V wrote: > Please Clarify the 'TypeError: zip argument #1 must support iteration' Try it at the interactive interpreter: py> zip('abc', [1, 2, 3]) # works fine [('a', 1), ('b', 2), ('c', 3)] But: py> zip(1000, [1, 2, 3]) # fails Traceback (most recent call last): File "", line 1, i

Dictionary error

2014-11-25 Thread Thuruv V
Please Clarify the 'TypeError: zip argument #1 must support iteration' import openpyxl book = openpyxl.load_workbook('c:/users/c_thv/desktop/tax.xlsx') sheet = book.get_sheet_by_name('Thilip') cell = sheet.cell(row=2,column = 4) i = 2 x = [] y = []while i < 10: keys = sheet.cell(row=i,column

FW: Unexpexted behaviot of python operators on list

2014-11-25 Thread PANDEY2 Archana (MORPHO)
Hello I hereby would like to share the problem I have found regarding python list implementation:- As per python documentation python list is mutable data object. That problem I found with the list is that is behaves differently when we use '+=' and '+' '=' operators separately. For example-