Re: list comparison vs integer comparison, which is more efficient?

2015-01-03 Thread Chris Angelico
On Sun, Jan 4, 2015 at 10:19 AM, austin aigbe eshik...@gmail.com wrote:
 I would like to know which is more efficient to use, between an integer 
 comparison and a list comparison:

You can test them with the timeit module, but my personal suspicion is
that any difference between them will be utterly and completely
dwarfed by all your sqrt(2) calls in the complex constructors. If you
break those out, and use a tuple instead of a list, you could write
this very simply and tidily:

bits = {
(0,0): complex(1/math.sqrt(2),1/math.sqrt(2)),
(0,1): complex(1/math.sqrt(2),-1/math.sqrt(2)),
(1,0): complex(-1/math.sqrt(2),1/math.sqrt(2)),
(1,1): complex(-1/math.sqrt(2),-1/math.sqrt(2)),
}
# QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
def mp_qpsk(self):
r = []
for i in range(self.nbits/2):
bit_pair = self.sbits[i*2:i*2+2]
r.append(bits[tuple(bit_pair)])
return r

At this point, your loop looks very much like a list comprehension in
full form, so you can make a simple conversion:

# From itertools recipes
# https://docs.python.org/3/library/itertools.html
def pairwise(iterable):
s - (s0,s1), (s1,s2), (s2, s3), ...
a, b = tee(iterable)
next(b, None)
return zip(a, b)
# Replace zip() with izip() for the Python 2 equivalent.

def mp_qpsk(self):
return [bits[pair] for pair in pairwise(self.sbits)]

How's that look? I don't care if it's faster or not, I prefer this form :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: apostrophe not considered with tkinter's wordstart and wordend

2015-01-03 Thread Peter Otten
ravas wrote:

 When I place my mouse over a word (and I press something)
 I want the program to analyze the word.
 Tkinter almost provides the perfect option:
 self.text.get('current wordstart', 'current wordend')
 
 Unfortunately apostrophes are not considered using wordstart and wordend.
 http://infohost.nmt.edu/tcc/help/pubs/tkinter/
 Says:
 For the purposes of this operation, a word is either
 a string of consecutive letter, digit, or underbar (_) characters,
 or a single character that is none of these types.
 
 The easy work around is to highlight the word and use:
 self.text.get('sel.first', 'sel.last')
 
 However, it seems like it could be an easy improvement
 if we could include the apostrophe in the list of word characters.
 Is it possible that this could be added in an upcoming version of Python
 -- or is this a Tk issue?

I think it is.

http://www.tcl.tk/man/tcl8.6/TkCmd/text.htm#M41 does not mention a way to 
configure the set of word chars either:


?submodifier? wordstart
Adjust the index to refer to the first character of the word containing the 
current index. A word consists of any number of adjacent characters that are 
letters, digits, or underscores, or a single character that is not one of 
these. If the display submodifier is given, this only examines non-elided 
characters, otherwise all characters (elided or not) are examined.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ANN] EasyGUI_Qt version 0.9

2015-01-03 Thread Michael Torrie
On 01/03/2015 10:11 AM, André Roberge wrote:
 Would you care to elaborate?  All the code I have written works
 correctly on all the tests I have done.  I do have reports from a
 user using a Mac with Python 2.7 for which some widgets did not quite
 work properly ... but that's all I have heard about problems with it.
 
 
 I would like to hear about the problems you know about either here,
 on by filing an issue at
 https://github.com/aroberge/easygui_qt/issues

It's not clear to me that jmf even understands what easygui is intended
to do.  So I wouldn't worry too much about what he says.  So I'd just
ignore what he has to say.  If someone needs a full event-driven GUI,
they can use an appropriate toolkit.  For quick and dirty little
utilities I can see how easygui fits the bill, and being Qt-based is
good news.

By the way, I'm not seeing jmf's emails; I think they are being filtered
at the mailing list level.  I think enough people got tired of his
trolling that they banned him, though on USENET he's still getting through.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Enumerating loggers iin logging module

2015-01-03 Thread John Pote
Thanks for the replies, thought there'd be a simple answer. Much 
appreciated.

John

On 30/12/2014 22:40, Chris Angelico wrote:

On Wed, Dec 31, 2014 at 8:24 AM, Tim Chase
python.l...@tim.thechases.com wrote:

While it may involve reaching into the objects may or may not be
blessed, the following seems to work for me in Py2.7:

import logging
# add a bunch of loggers and sub-loggers
print logging.Logger.manager.loggerDict.keys()

Works in 3.5, too, aside from trivialities:

$ python3
Python 3.5.0a0 (default:1c51f1650c42+, Dec 29 2014, 02:29:06)
[GCC 4.7.2] on linux
Type help, copyright, credits or license for more information.

import logging
logging.getLogger(Name)

logging.Logger object at 0x7f8dcc339be0

logging.getLogger(name.sublogger)

logging.Logger object at 0x7f8dcc339ba8

logging.Logger.manager.loggerDict

{'name.sublogger': logging.Logger object at 0x7f8dcc339ba8, 'Name':
logging.Logger object at 0x7f8dcc339be0, 'name':
logging.PlaceHolder object at 0x7f8dcc33ebe0}

I'd say this is fine for debugging with.

ChrisA


--
https://mail.python.org/mailman/listinfo/python-list


Re: Put float number in message.

2015-01-03 Thread Mark Lawrence

On 03/01/2015 19:23, John Culleton wrote:

Here is my last line in a simple program that is a scribus script.
end = scribus.messageBox('Book Spine Width', 'dummy', ICON_WARNING, BUTTON_OK)

This works. Now I want to put a float number called S instead of 'dummy'.
If I just put S in the command I get an error. If I convert S to a string with
SS = str(S)
first and then
and substitute SS for 'dummy' I get what appears to be the ASCII numbers 
representing the characters, not the characters I want.

I am a total newbie with Python. Anyone have a suggestion? Can I use a print 
command instead?

John Culleton



I think you just want some string formatting so (untested) either

end = scribus.messageBox('Book Spine Width', '{}'.format(S), 
ICON_WARNING, BUTTON_OK)


or

end = scribus.messageBox('Book Spine Width', '%f' % S, ICON_WARNING, 
BUTTON_OK)


For all the formatting options see 
https://docs.python.org/3/library/string.html#string-formatting or 
https://docs.python.org/3/library/stdtypes.html#old-string-formatting 
respectively.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


apostrophe not considered with tkinter's wordstart and wordend

2015-01-03 Thread ravas
When I place my mouse over a word (and I press something) 
I want the program to analyze the word.
Tkinter almost provides the perfect option:
self.text.get('current wordstart', 'current wordend')

Unfortunately apostrophes are not considered using wordstart and wordend.
http://infohost.nmt.edu/tcc/help/pubs/tkinter/
Says: 
For the purposes of this operation, a word is either 
a string of consecutive letter, digit, or underbar (_) characters, 
or a single character that is none of these types.

The easy work around is to highlight the word and use:
self.text.get('sel.first', 'sel.last')

However, it seems like it could be an easy improvement 
if we could include the apostrophe in the list of word characters.
Is it possible that this could be added in an upcoming version of Python -- 
or is this a Tk issue?


Windows 7  Python 3.4
-- 
https://mail.python.org/mailman/listinfo/python-list


list comparison vs integer comparison, which is more efficient?

2015-01-03 Thread austin aigbe
Hi,

I am currently implementing the LTE physical layer in Python (ver 2.7.7).
For the qpsk, 16qam and 64qam modulation I would like to know which is more 
efficient to use, between an integer comparison and a list comparison:

Integer comparison: bit_pair as an integer value before comparison

# QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
def mp_qpsk(self):
r = []
for i in range(self.nbits/2):
bit_pair = (self.sbits[i*2]  1) | self.sbits[i*2+1] 
if bit_pair == 0:
r.append(complex(1/math.sqrt(2),1/math.sqrt(2)))
elif bit_pair == 1:
r.append(complex(1/math.sqrt(2),-1/math.sqrt(2)))
elif bit_pair == 2:
r.append(complex(-1/math.sqrt(2),1/math.sqrt(2)))
elif bit_pair == 3:
r.append(complex(-1/math.sqrt(2),-1/math.sqrt(2)))
return r

List comparison: bit_pair as a list before comparison

# QPSK - TS 36.211 V12.2.0, section 7.1.2, Table 7.1.2-1
def mp_qpsk(self):
r = []
for i in range(self.nbits/2):
bit_pair = self.sbits[i*2:i*2+2] 
if bit_pair == [0,0]:
r.append(complex(1/math.sqrt(2),1/math.sqrt(2)))
elif bit_pair == [0,1]:
r.append(complex(1/math.sqrt(2),-1/math.sqrt(2)))
elif bit_pair == [1,0]:
r.append(complex(-1/math.sqrt(2),1/math.sqrt(2)))
elif bit_pair == [1,1]:
r.append(complex(-1/math.sqrt(2),-1/math.sqrt(2)))
return r

Thanks
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Tk Tix GUI documentation builder overview and tips

2015-01-03 Thread Terry Reedy

On 1/3/2015 1:30 PM, aba...@gmail.com wrote:

Hi,

I have had issues running Tix on python 2.7.6 and 3.4.2:

More details on the issue here.

http://stackoverflow.com/questions/27751923/tix-widgets-installation-issue

Has anyone had similar issues with Tix?


The current doc is wrong in any case.  I opened
http://bugs.python.org/issue23156

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: surprise - byte in set

2015-01-03 Thread patrick vrijlandt

Dear all,

Many thanks for your responses. I never realised this difference between 
'bytes' and 'string'.


Thanks,

Patrick

---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
http://www.avast.com

--
https://mail.python.org/mailman/listinfo/python-list


Re: How do I remove/unlink wildcarded files

2015-01-03 Thread Steven D'Aprano
Chris Angelico wrote:

 On Sat, Jan 3, 2015 at 4:54 AM, Rustom Mody rustompm...@gmail.com wrote:
 And how does this strange language called English fits into your rules
 and (no) special cases scheme?


http://www.omgfacts.com/lists/3989/Did-you-know-that-ough-can-be-pronounced-TEN-DIFFERENT-WAYS
 
 I learned six, which is no more than there are for the simple vowel
 'a' (at least, in British English; American English has a few less
 sounds for 'a'). 

What is this thing you call American English? :-) 

I wouldn't want to put an exact number of distinct accents in the USA, but
it's probably in three figures. And it used to be said that a sufficiently
skilled linguist could tell what side of the street an English person was
born on, that's how fine-grained English accents used to be.


 Consider cat, bay, car (that's the three most 
 common sounds), watch, water, parent (these three are less
 common, and American English often folds them into the other three).

There's a joke about how people from certain parts of the US suffer
from hat attacks (heart attacks).


 Now have a look at Norwegian, where the fifth of those sounds
 (water) is spelled with a ring above, eg La den gå - and the sixth
 is (I think) more often spelled with a slashed O - Den kraften jeg
 skjulte før. Similarly in Swedish: Slå dig loss, slå dig fri is
 pronounced Slaw di loss, slaw di free. Or let's look at another of
 English's oddities. Put a t and an h together, and you get a
 completely different sound... two different sounds, in fact, voiced or
 unvoiced. Icelandic uses thorn instead: Þetta er nóg is pronounced
 (roughly) Thetta air know.

English used to include the letter Thorn too. Among others. Little known
fact: at one time, ampersand  (as in and) used to be included as a
letter of the alphabet

http://mentalfloss.com/article/31904/12-letters-didnt-make-alphabet


 And the whole notion of putting a dot on 
 a lower-case i and not putting one on upper-case I is pretty
 illogical, but Turkish, as I mentioned in the previous post, uses the
 dots to distinguish between two pronunciations of the vowel, hence
 aldırma which would sound somewhat different with a dot on the i.
 
 (You may be able to see a theme in my example texts, but I figured
 it's time to see what I can do with full Unicode support. The cold
 looks of disapproval never bothered me, anyway.)
 
 ChrisA

-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Command Line Inputs from Windows

2015-01-03 Thread Mark Lawrence

On 02/01/2015 19:44, Ken Stewart wrote:

Court of King Arthur,


Court of BDFL actually.



I’d appreciate any help you can provide.  I’m having problems passing
command line parameters from Windows 7 into a Python script (using
Python 3.4.2).  It works correctly when I call the interpreter
explicitly from the Windows command prompt, but it doesn’t work when I
enter the script name without calling the Python interpreter.

This works:
python myScript.py arg1 arg2 arg3

This doesn’t work:
myScript.py arg1 arg2 arg3

The Windows PATH environment variable contains the path to Python, as
well as the path to the Script directory.  The PATHEXT environment
variable contains the Python extension (.py).

There are other anomalies too between the two methods of invoking the
script depending on whether I include the extension (.py) along with the
script name.  For now I’m only interested in passing the arguments
without explicitly calling the Python interpreter.


Here is the script:

#! python

import sys

def getargs():
sys.stdout.write(\nHello from Python %s\n\n % (sys.version,))
print ('Number of arguments =', len(sys.argv))
print ('Argument List =', str(sys.argv))

if __name__ == '__main__':
getargs()


Result_1 (working correctly):

C:\Python34\Scripts python myScript.py arg1 arg2 arg3

Hello from Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05)
[MSC v.1600 32 bit (Intel)]

Number of arguments = 4
Argument List = ['myScript.py', 'arg1', 'arg2', 'arg3']


Result_ 2 (Fail)

C:\Python34\Scripts myScript.py arg1 arg2 arg3

Hello from Python 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05)
[MSC v.1600 32 bit (Intel)]

Number of arguments = 1
Argument List = ['C:\\Python34\\Scripts\\myScript.py']

As a beginner I’m probably making a mistake somewhere but I can’t find
it. I don’t think the shebang does anything in Windows but I’ve tried
several variations without success.  I’ve tried writing the script using
only commands, without the accouterments of a full program (without the
def statement and without the if __name__ == ‘__main__’ …) to no avail.
I’m out of ideas.  Any suggestions?

Ken Stewart



Works fine for me with this:-

c:\Users\Mark\Documents\MyPythonassoc .py
.py=Python.File

c:\Users\Mark\Documents\MyPythonassoc .pyw
.pyw=Python.NoConFile

c:\Users\Mark\Documents\MyPythonftype Python.File
Python.File=C:\Windows\py.exe %1 %*

c:\Users\Mark\Documents\MyPythonftype Python.NoConFile
Python.NoConFile=C:\Windows\pyw.exe %1 %*

c:\Users\Mark\Documents\MyPythonset pathext
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY

This is set up by the Python Launcher for Windows, introduced in 3.3, 
see https://docs.python.org/3/using/windows.html#launcher, noting that 
shebang lines also work.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: Command Line Inputs from Windows

2015-01-03 Thread Ken Stewart

Chris, Dennis, James, and Mark:

SUCCESS!  Thanks for your suggestions.  It was the registry.  Kudos to 
Dennis.  The data strings for a lot of different command keys in the 
registry were missing the %* (percent star) characters.  Thanks Chris for 
the explanation on why the %* string is needed.


Here is a sample key:
S1-5-21-1560217580-722697556-320042093-1000-Classes
   py_auto_file
   shell
   open
   command

The corrected data for the key looks like this:

C:\Python34\python.exe %1 %*

I used the 'find' tool in regedit to search for python in the registry. 
There were many hits on the word python but only a handful had data fields 
similar to the one above.  Every instance was missing the %* string.  I 
modified them all.  My script didn't start working until after I'd modified 
the very last one.  Happily, my computer still boots after mucking around in 
the registry.


I haven't yet investigated the launcher suggested by Chris and Mark.  That 
may well be the proper solution.  At the moment it looks like the Python 
installer didn't create these registry entries properly in Windows 7.


Thanks again

Ken Stewart

--
https://mail.python.org/mailman/listinfo/python-list


Re: Command Line Inputs from Windows

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 7:03 PM, Ken Stewart gordon_ken_stew...@msn.com wrote:
 I used the 'find' tool in regedit to search for python in the registry.
 There were many hits on the word python but only a handful had data fields
 similar to the one above.  Every instance was missing the %* string.  I
 modified them all.  My script didn't start working until after I'd modified
 the very last one.  Happily, my computer still boots after mucking around in
 the registry.

Excellent!

Fiddling with Python's setup under Windows is unlikely ever to stop
your computer from booting. Unlike on most Linux and Mac OS systems,
there's no system Python that's used internally; Windows itself
doesn't make use of Python. So you should have no problems playing
around with things.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Command Line Inputs from Windows

2015-01-03 Thread Mark Lawrence

On 03/01/2015 08:03, Ken Stewart wrote:

At the moment it looks like the
Python installer didn't create these registry entries properly in
Windows 7.



If that is actally the case please raise an issue on the bug tracker at 
bugs.python.org if one doesn't already exist.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: How do I remove/unlink wildcarded files

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 9:01 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 Chris Angelico wrote:

 On Sat, Jan 3, 2015 at 4:54 AM, Rustom Mody rustompm...@gmail.com wrote:
 And how does this strange language called English fits into your rules
 and (no) special cases scheme?


 http://www.omgfacts.com/lists/3989/Did-you-know-that-ough-can-be-pronounced-TEN-DIFFERENT-WAYS

 I learned six, which is no more than there are for the simple vowel
 'a' (at least, in British English; American English has a few less
 sounds for 'a').

 What is this thing you call American English? :-)

 I wouldn't want to put an exact number of distinct accents in the USA, but
 it's probably in three figures. And it used to be said that a sufficiently
 skilled linguist could tell what side of the street an English person was
 born on, that's how fine-grained English accents used to be.

American English is the category compassing all of those accents
common to the USA. There are certain broad similarities between it and
British English, just as there are similarities between Dutch and
German; and there are certain commonalities across all accents of
American English, allowing generalizations about the number of sounds
made by the vowel a. :)

 Now have a look at Norwegian, where the fifth of those sounds
 (water) is spelled with a ring above, eg La den gå - and the sixth
 is (I think) more often spelled with a slashed O - Den kraften jeg
 skjulte før. Similarly in Swedish: Slå dig loss, slå dig fri is
 pronounced Slaw di loss, slaw di free. Or let's look at another of
 English's oddities. Put a t and an h together, and you get a
 completely different sound... two different sounds, in fact, voiced or
 unvoiced. Icelandic uses thorn instead: Þetta er nóg is pronounced
 (roughly) Thetta air know.

 English used to include the letter Thorn too. Among others.

Yes, but it doesn't any more. Icelandic is the only modern language
I'm aware of that retains thorn and eth (eg in það).

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How do I remove/unlink wildcarded files

2015-01-03 Thread Mark Lawrence

On 03/01/2015 10:16, Chris Angelico wrote:

On Sat, Jan 3, 2015 at 9:01 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:

Chris Angelico wrote:


On Sat, Jan 3, 2015 at 4:54 AM, Rustom Mody rustompm...@gmail.com wrote:

And how does this strange language called English fits into your rules
and (no) special cases scheme?



http://www.omgfacts.com/lists/3989/Did-you-know-that-ough-can-be-pronounced-TEN-DIFFERENT-WAYS


I learned six, which is no more than there are for the simple vowel
'a' (at least, in British English; American English has a few less
sounds for 'a').


What is this thing you call American English? :-)

I wouldn't want to put an exact number of distinct accents in the USA, but
it's probably in three figures. And it used to be said that a sufficiently
skilled linguist could tell what side of the street an English person was
born on, that's how fine-grained English accents used to be.


American English is the category compassing all of those accents
common to the USA. There are certain broad similarities between it and
British English, just as there are similarities between Dutch and
German; and there are certain commonalities across all accents of
American English, allowing generalizations about the number of sounds
made by the vowel a. :)



I used to get very confused watching the old westerns.  The child when 
talking about more and paw wasn't referring to possibly an 
adjective, noun or adverb and a part of an animal, but what we would 
refer to in the UK as mum and dad :)


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: pathlib type error

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 10:55 PM, Georg Grafendorfer
georg.grafendor...@gmail.com wrote:
 I'm using Debian 8 Jessie on an AMD64 machine.
 Getting this error:

 ~$ python3
 Python 3.4.2 (default, Oct  8 2014, 10:45:20)
 [GCC 4.9.1] on linux
 Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'


Unable to reproduce:

rosuav@dewey:~$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
 q
PosixPath('/etc/init.d')
 pathlib.__file__
'/usr/lib/python3.4/pathlib.py'

Is it possible you have another pathlib installed? It's available on
PyPI, maybe you got it with pip - check 'pip freeze|grep pathlib' on
the off-chance. Is your pathlib.__file__ the same as mine?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


pathlib type error

2015-01-03 Thread Georg Grafendorfer
Hi

I'm using Debian 8 Jessie on an AMD64 machine.
Getting this error:

~$ python3
Python 3.4.2 (default, Oct  8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'



This also happens if I compile python3.4.2 from scratch:

.../data/Python-3.4.2$ ./python
Python 3.4.2 (default, Jan  3 2015, 12:42:09)
[GCC 4.9.1] on linux
Type help, copyright, credits or license for more information.
 from pathlib import Path
 p = Path(/etc)
 q = p / init.d
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'str'



On the same computer, using rescuecd 4.4.1 (Nov 2014) which ships python
3.4.1 it works as expected.

thanks for help, Georg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 5:26:27 PM UTC+5:30, Chris Angelico wrote:
 On Sat, Jan 3, 2015 at 10:43 PM, pramod gowda pramod.s...@gmail.com wrote:
  I am not getting the output, i am using windows 7 OS..
  please  check and give me the solution.
 
 Windows 7 - that's part of the story. What version of Python are you
 using? Is 192.168.2.2 the correct IP address? What happens when you
 run these? Do you get exceptions?
 
 ChrisA

Hi chris.


I am using python 3.4.2
I don get any exceptions,
but wn i run the code,i don see any connections, IP address is given as my 
system IP.

 c,address=server_socket.accept() in server.py..if am trying to print 
something,it fails
-- 
https://mail.python.org/mailman/listinfo/python-list


DjangoCon Europe 2015, in Cardiff, Wales

2015-01-03 Thread D.M. Procida
In 2015, DjangoCon Europe is coming to Cardiff:
http://2015.djangocon.eu/ - the first-ever six-day DjangoCon.

The conference will begin with an open day (as in, open to anyone who
feels like coming) of free talks and tutorials, aimed at introducing new
people to Python and Django and the communities around them.

Registration's now open:
http://2015.djangocon.eu/news/registration-opens/

Hope to see you there. Maybe someone can even do a lightning talk about
comp.lang.python to introduce all the young whippersnappers to Usenet...

Daniele
-- 
DjangoCon Europe 2015 in Cardiff, 2nd to 7th June. 
Six days of talks, tutorials and code.

http://2015.djangocon.eu/
-- 
https://mail.python.org/mailman/listinfo/python-list


Socket programming

2015-01-03 Thread pramod gowda
Hi i am learning socket programming,

client code:

import socket

client_socket=socket.socket()
server_address='192.168.2.2'
server_port= 80
print(hello)
client_socket.connect((server_address,server_port))
print(hello)
data=client_socket.recv(1024)
print(data)
client_socket.close()

server code:
import socket

server_socket=socket.socket()
server_name='192.168.2.2'
server_port= 80
server_socket.bind((server_name,server_port))
server_socket.listen(1)

while True:
print(hello)
c,address=server_socket.accept()
print(we got connection from:,address)
c.send(hello,hw ru)
c.close()




I am not getting the output, i am using windows 7 OS..
please  check and give me the solution.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pathlib type error

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 11:06 PM, Chris Angelico ros...@gmail.com wrote:
 On Sat, Jan 3, 2015 at 10:55 PM, Georg Grafendorfer
 georg.grafendor...@gmail.com wrote:
 I'm using Debian 8 Jessie on an AMD64 machine.
 Getting this error:

 ~$ python3
 Python 3.4.2 (default, Oct  8 2014, 10:45:20)
 [GCC 4.9.1] on linux

 Unable to reproduce:

 rosuav@dewey:~$ python3
 Python 3.4.2 (default, Oct  8 2014, 10:45:20)
 [GCC 4.9.1] on linux

Should have clarified: Dewey is also running Debian Jessie.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 10:43 PM, pramod gowda pramod.s...@gmail.com wrote:
 I am not getting the output, i am using windows 7 OS..
 please  check and give me the solution.

Windows 7 - that's part of the story. What version of Python are you
using? Is 192.168.2.2 the correct IP address? What happens when you
run these? Do you get exceptions?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Tk Tix GUI documentation builder overview and tips

2015-01-03 Thread abaskm
Hi,

I have had issues running Tix on python 2.7.6 and 3.4.2:

More details on the issue here.

http://stackoverflow.com/questions/27751923/tix-widgets-installation-issue

Has anyone had similar issues with Tix?

Thanks and Happy New Year.


On Friday, March 27, 2009 5:19:42 PM UTC-4, bal...@googlemail.com wrote:
 I have recently started development for a small video conversion
 project using a GUI. After some research I decided to use Tkinter/Tix
 (Tk/Tix). The reasons are mainly:
 
 1. the GUI is rather simple, and
 
 2. the end-user is not necessarily technically inclined so I want to
 keep
   a) required libraries as few as possible, and
   b) installation as painless as possible.
 
 3. Tk/Tix is included with Python. Thus only a Python installation is
 needed. Nothing else.
 
 4. Tk itsself misses some rudimentary widgets like meters, multi/colum
 lists, grid and scrolled widgets. Tix provides those. Good enough for
 my little application (more advanced and more modern widgets are
 available in frameworks like Qt, Gtk, or wxWindows).
 
 
 Before starting I spent some effort to find
 a) relevant documentation,
 b) GUI Builders which might help me,
 c) answers to non-obvious questions.
 
 The process took some time and effort so I want to share my findings:
 
 a) Documentation resources
 
 Python Docs
 http://docs.python.org/library/tkinter.html
 Tk Commands
 http://www.tcl.tk/man/tcl8.5/TkCmd/contents.htm
 Tix Reference
 http://tix.sourceforge.net/man/html/contents.htm
 Tix demo application
   You want to extract the Tix demo application coming with the Tix
 8.4.3 source distribution. It containsexamples for many widgets -
 unfortunately none for multi-column HList or the Grid (see below).
   
 https://sourceforge.net/project/showfiles.php?group_id=5649package_id=5704
   Tix8.4.3-src.tar.gz, then look in /Tix8.4.3/Python/Demo/tix
 Thinking in Tkinter
   I recommend the Individual programs online
   http://www.ferg.org/thinking_in_tkinter/index.html
 
 
 b) GUI development tools
 
 ActiveState GUI Builder (using grid layout)
   SpecTcl is the predecessor of GUI Builder (by ActivaState).
 http://spectcl.sourceforge.net/
 FAQ (where to get source)
 http://aspn.activestate.com/ASPN/Mail/Message/komodo-announce/3355346
 
 PAGE v3.0 by Stewart Allen (using placer layout)
 http://page.sourceforge.net/
 
 There are many more for other GUI toolkits mentioned in this post:
   http://mail.python.org/pipermail/python-list/2004-February/250727.html
 
 Finally I decided to use the packer layout and create the widgets
 manually. Just the simplest and quickest way for me.
 
 
 c) How do I ...?
 
 How do I use all methods available in the Tix Grid?
 
 Tix Grid with full implementation of all methods
 http://klappnase.bubble.org/TixGrid/index.html
 
 
 How do I create a multi-column Tix.HList?
 
   import Tkinter as Tk
   import Tix
 
   root = Tix.Tk()
   # setup HList
 hl = Tix.HList(root, columns = 5, header = True)
 hl.header_create(0, text = File)
 hl.header_create(1, text = Date)
 hl.header_create(1, text = Size)
   # create a multi-column row
   hl.add(row1, text = filename.txt)
   hl.item_create(entry_path, 1, text = 2009-03-26 21:07:03)
   hl.item_create(entry_path, 2, text = 200MiB)
 
 I haven't found out how to right-justify individual columns? Anyone?
 
 
 How to implement Tk GUI with multiple threads?
 
 Usually there are two options to make threads wait for an event:
 
   * gui thread polling (lame)
 see here how to use Tk.after() (actually a Tcl command) to poll
   http://uucode.com/texts/pylongopgui/pyguiapp.html
 
 see here how to imitate the Tk event loop to poll for non-Tk
 events (a socket, for example)
   
 https://sourceforge.net/project/showfiles.php?group_id=5649package_id=5704
   Tix8.4.3-src.tar.gz, then look in /Tix8.4.3/Python/Demo/tix/
 tixwidgets.py, find loop()
 
 
   * multithreaded with events (the option to choose)
 Basically this uses bind and event_generate to send Notify
 messages to the Tk instance.
 I suspect the following example failed due to not synchronising
 the event_generate call
 
 http://coding.derkeiler.com/Archive/Python/comp.lang.python/2006-07/msg01479.html
 
 For multithreading Python Tk GUI applications the following rules
 apply:
 1. same thread calling Tk must do all subsequent GUI calls,
 2. other threads may send events with send_event to the root Tk
 instance,
 3. with threading problems you might try to synchonise access to
 event_generate(). Using event_generate() with one non-GUI thread seems
 to be safe.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How do I remove/unlink wildcarded files

2015-01-03 Thread Mark Lawrence

On 03/01/2015 17:53, Rick Johnson wrote:

On Saturday, January 3, 2015 4:39:25 AM UTC-6, Mark Lawrence wrote:


I used to get very confused watching the old westerns.  The child when
talking about more and paw wasn't referring to possibly an
adjective, noun or adverb and a part of an animal, but what we would
refer to in the UK as mum and dad :)


Early Americans are easy to satirize since most were
schooled at home by illiterate parents. I believe the
redneck vernacular substituted mother and father for
maw and paw respectively. Which is not surprising since
most uneducated folks tend to favor single syllable
simplifications of words over their multi-syllable
counterparts.

Widespread centralized free schooling did not exists until
almost the 1900's. Heck, looking back at American history,
the world *SHOULD* be in awe. To go from a rag-tag
illiterate bunch of cowboys, to the worlds most powerful and
technically advanced society (in roughly one hundred years!)
has to be the most amazing transformation in the history of
the human society.


I suspect that the engineers who pushed the railways across North 
America were hardly a rag-tag illiterate bunch of cowboys.  I won't 
mention that the transformation involved wiping out 99% of the 
indigenous population.




Of course with all success stories, timing and luck had a
little to do with it, but it was undoubtedly the rebellious
and self reliant nature of Americans that made them so
successful. So before you go and spouting off about how dumb
Americans are/were, ask yourself, what greatness has *MY*
country achieved in the span of a century?


I'm not entirely sure how a little bit of gentle teasing about accents 
in fictional films translates into spouting off about how dumb 
Americans are/were but there you go.  Hardly a century but I believe 
that the British Empire covered 25% of the land surface on the planet. 
Quite an achievement for a tiny patch of islands sitting off the coast 
of Europe.  However I suspect that a large number of people were glad to 
see the back of us, although I still think it audacious for those people 
to actually want to run their own countries.




*school bell rings*

PS: I've recently developed an industrial grade scraper
specially designed for removing dried egg residue from the
human face with a minimal amount of collateral damage. If
any of you are interested in volunteering your egg covered
faces for testing i would be thankful! Please send me a
private message as the alpha phase begins soon!



I believe that this has already been done.  Should I ever need one I'll 
probably get a cheap one, complete with its Made in China sticker, 
from one of the many £ stores that are springing up in the UK.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: How do I remove/unlink wildcarded files

2015-01-03 Thread Rick Johnson
On Saturday, January 3, 2015 4:39:25 AM UTC-6, Mark Lawrence wrote:

 I used to get very confused watching the old westerns.  The child when 
 talking about more and paw wasn't referring to possibly an 
 adjective, noun or adverb and a part of an animal, but what we would 
 refer to in the UK as mum and dad :)

Early Americans are easy to satirize since most were
schooled at home by illiterate parents. I believe the
redneck vernacular substituted mother and father for
maw and paw respectively. Which is not surprising since
most uneducated folks tend to favor single syllable
simplifications of words over their multi-syllable
counterparts.

Widespread centralized free schooling did not exists until
almost the 1900's. Heck, looking back at American history,
the world *SHOULD* be in awe. To go from a rag-tag
illiterate bunch of cowboys, to the worlds most powerful and
technically advanced society (in roughly one hundred years!)
has to be the most amazing transformation in the history of
the human society.

Of course with all success stories, timing and luck had a
little to do with it, but it was undoubtedly the rebellious
and self reliant nature of Americans that made them so
successful. So before you go and spouting off about how dumb
Americans are/were, ask yourself, what greatness has *MY*
country achieved in the span of a century?

*school bell rings*

PS: I've recently developed an industrial grade scraper
specially designed for removing dried egg residue from the
human face with a minimal amount of collateral damage. If
any of you are interested in volunteering your egg covered
faces for testing i would be thankful! Please send me a
private message as the alpha phase begins soon!


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ANN] EasyGUI_Qt version 0.9

2015-01-03 Thread Mark Lawrence

On 03/01/2015 17:11, André Roberge wrote:

On Saturday, 3 January 2015 04:52:21 UTC-4, wxjm...@gmail.com  wrote:

Le vendredi 2 janvier 2015 20:11:25 UTC+1, André Roberge a écrit :

On Friday, 2 January 2015 06:29:37 UTC-4, wxjm...@gmail.com  wrote:

Le mercredi 31 décembre 2014 23:24:50 UTC+1, André Roberge a écrit :

EasyGUI_Qt version 0.9 has been released.  This is the first announcement about 
EasyGUI_Qt on this list.

snip

I toyed and I spent a couple of hours with it.
I do not know to much what to say.

Well, this is more positive than your previous comment expressing doubt that it 
would work. ;-)   So, thank you!


Do not get me wrong, I do not wish to be rude.
You are building a tool upon a toolkit which
simply does not work properly.

If for some reason you are not aware of this,
you are not aware of this, it is unfortunately
a simple as this.

(Not only I know why, I'm able to explain the
cause).


Would you care to elaborate?  All the code I have written works correctly on 
all the tests I have done.  I do have reports from a user using a Mac with 
Python 2.7 for which some widgets did not quite work properly ... but that's 
all I have heard about problems with it.

I would like to hear about the problems you know about either here, on by 
filing an issue at https://github.com/aroberge/easygui_qt/issues


jmf


I hope you know that you're engaging with a person who makes statements 
about the inadequacies of various tools, but when challenged to provide 
evidence to support his claims he can never do so.  He is our Resident 
Unicode Expert, in other words when it comes to Unicode he hasn't got 
the faintest idea what he's talking about, at least with respect to PEP 
393 and the Flexible String Representation.  Please ignore him as he's 
just not worth the effort.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

--
https://mail.python.org/mailman/listinfo/python-list


Re: surprise - byte in set

2015-01-03 Thread Gary Herron

On 01/03/2015 10:50 AM, patrick vrijlandt wrote:

Hello list,

Let me first wish you all the best in 2015!

Today I was trying to test for occurrence of a byte in a set ...

 sys.version
'3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit 
(Intel)]'

 'b' in 'abc'
True
 b'b' in b'abc'
True
 'b' in set('abc')
True
 b'b' in set(b'abc')
False

I was surprised by the last result. What happened?
(Examples simplified; I was planning to manipulate the set)


The surprise is really that the 3rd test is True not that the fourth is 
False.


First, as should be expected, a byte string is a sequence of (small) 
ints.  So b'b' is a (short) byte string and the set set(b'abc') is 
composed of three ints.  You should not expect your inclusion test to 
return True when testing for a bytes-type object in a set of int-type 
objects.  And that explains your False result in the 4th test.


 type(b'abc')
class 'bytes'
 type(b'abc'[0])
class 'int'


But things are different for strings.  You might think a string is a 
sequence of characters, but Python does not have a character type. In 
fact the elements of a string are just 1 char long strings:


 type('abc')
class 'str'
 type('abc'[0])
class 'str'

You would not logically expect to find a string 'b' in a set of 
characters in, say C++,  where the two types are different.  But that's 
not the Python way.  In Python a set of characters set('abc') is really 
a set of (short) strings, and the character 'b' is really a (short) 
string, so the inclusion test works.


Python's way of returning a 1-byte string when indexing a string 
(instead of returning an element of type character) allows this 
surprising result.


 'abc'[0]
'a'
 'abc'[0][0]
'a'
 'abc'[0][0][0]
'a'
 'abc'[0][0][0][0]
'a'
...


I've never considered this a problem, but a infinitely indexable object 
*is* a bit of an oddity.







Patrick

---
Dit e-mailbericht is gecontroleerd op virussen met Avast 
antivirussoftware.

http://www.avast.com




--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418

--
https://mail.python.org/mailman/listinfo/python-list


surprise - byte in set

2015-01-03 Thread patrick vrijlandt

Hello list,

Let me first wish you all the best in 2015!

Today I was trying to test for occurrence of a byte in a set ...

 sys.version
'3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit 
(Intel)]'

 'b' in 'abc'
True
 b'b' in b'abc'
True
 'b' in set('abc')
True
 b'b' in set(b'abc')
False

I was surprised by the last result. What happened?
(Examples simplified; I was planning to manipulate the set)

Patrick

---
Dit e-mailbericht is gecontroleerd op virussen met Avast antivirussoftware.
http://www.avast.com

--
https://mail.python.org/mailman/listinfo/python-list


Put float number in message.

2015-01-03 Thread John Culleton
Here is my last line in a simple program that is a scribus script.
end = scribus.messageBox('Book Spine Width', 'dummy', ICON_WARNING, BUTTON_OK)

This works. Now I want to put a float number called S instead of 'dummy'.
If I just put S in the command I get an error. If I convert S to a string with
SS = str(S)
first and then 
and substitute SS for 'dummy' I get what appears to be the ASCII numbers 
representing the characters, not the characters I want. 

I am a total newbie with Python. Anyone have a suggestion? Can I use a print 
command instead?

John Culleton 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: surprise - byte in set

2015-01-03 Thread Jason Friedman
 sys.version
 '3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit
 (Intel)]'
 'b' in 'abc'
 True
 b'b' in b'abc'
 True
 'b' in set('abc')
 True
 b'b' in set(b'abc')
 False

 I was surprised by the last result. What happened?
 (Examples simplified; I was planning to manipulate the set)

I'm no expert, but I see:

 for i in set(b'abc'):
... print(type(i))
...
class 'int'
class 'int'
class 'int'
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: surprise - byte in set

2015-01-03 Thread Dan Stromberg
On Sat, Jan 3, 2015 at 10:50 AM, patrick vrijlandt pvrijla...@gmail.com wrote:
 Hello list,

 Let me first wish you all the best in 2015!

 Today I was trying to test for occurrence of a byte in a set ...


In the last case, the set has integers in it.

Try:
b'b'[0] in set(b'abc')
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [ANN] EasyGUI_Qt version 0.9

2015-01-03 Thread André Roberge
On Saturday, 3 January 2015 04:52:21 UTC-4, wxjm...@gmail.com  wrote:
 Le vendredi 2 janvier 2015 20:11:25 UTC+1, André Roberge a écrit :
  On Friday, 2 January 2015 06:29:37 UTC-4, wxjm...@gmail.com  wrote:
   Le mercredi 31 décembre 2014 23:24:50 UTC+1, André Roberge a écrit :
EasyGUI_Qt version 0.9 has been released.  This is the first 
announcement about EasyGUI_Qt on this list.
  snip
   I toyed and I spent a couple of hours with it.
   I do not know to much what to say.
  Well, this is more positive than your previous comment expressing doubt 
  that it would work. ;-)   So, thank you!
 
 Do not get me wrong, I do not wish to be rude.
 You are building a tool upon a toolkit which
 simply does not work properly.
 
 If for some reason you are not aware of this,
 you are not aware of this, it is unfortunately
 a simple as this.
 
 (Not only I know why, I'm able to explain the
 cause).

Would you care to elaborate?  All the code I have written works correctly on 
all the tests I have done.  I do have reports from a user using a Mac with 
Python 2.7 for which some widgets did not quite work properly ... but that's 
all I have heard about problems with it. 

I would like to hear about the problems you know about either here, on by 
filing an issue at https://github.com/aroberge/easygui_qt/issues
 
 jmf
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread Dan Stromberg
On Sat, Jan 3, 2015 at 3:43 AM, pramod gowda pramod.s...@gmail.com wrote:
 Hi i am learning socket programming,

This works on Linux Mint 17.1.

Server:
#!/usr/local/cpython-3.4/bin/python

import socket

server_socket = socket.socket()
#server_name = '192.168.2.2'
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server_name = 'localhost'
server_port = 8080
server_socket.bind((server_name, server_port))
server_socket.listen(1)

while True:
print(hello)
c,address = server_socket.accept()
print(we got connection from:,address)
c.send(bhello,hw ru)
c.close()


client:
#!/usr/local/cpython-3.4/bin/python

import socket

client_socket = socket.socket()
#server_address='192.168.2.2'
server_address = 'localhost'
server_port = 8080
print(hello)
client_socket.connect((server_address,server_port))
print(hello)
data=client_socket.recv(1024)
print(data)
client_socket.close()


But note that if you send 10 bytes into a socket, it could be received
as two chunks of 5, or other strangeness. So you should frame your
data somehow - adding crlf to the end of your send's is one simple
way.  There are multiple ways of dealing with this.  Here's one:
http://stromberg.dnsalias.org/~strombrg/bufsock.html with links to
others.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 9:27:20 PM UTC+5:30, Steven D'Aprano wrote:
 pramod gowda wrote:
 
  HI, i m doing n personal laptop.
  so i think i ve rights to open a listening socket,could u pls tell me hw
  can i check it?
 
 Is your keyboard broken? There are a lot of missing characters in your
 sentences. You're going to have a lot of trouble programming with a broken
 keyboard.
 
 As far as sockets, this is a Python discussion group, not Windows experts.
 Try googling for more information and see if that helps:
 
 https://duckduckgo.com/?q=windows%20permission%20to%20open%20sockets
 
 
 
 
 -- 
 Steven

Hi Steven,


Sorry for using short words while posting,I am using python in windows7 with 
Python ver 3.4.2 for socket program,so i am asking for help.

Thanks
Pramod SP

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 8:39:26 PM UTC+5:30, mm0fmf wrote:
 On 03/01/2015 11:43, pramod gowda wrote:
  server_socket=socket.socket()
  server_name='192.168.2.2'
  server_port= 80
  server_socket.bind((server_name,server_port))
  server_socket.listen(1)
 
 I don't do much Python on Windows but do you have the necessary access 
 rights to open a listening socket on port 80? Don't you need to run this 
 with Administrator rights?

HI, i m doing n personal laptop.
so i think i ve rights to open a listening socket,could u pls tell me hw can i 
check it?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread Steven D'Aprano
pramod gowda wrote:

 HI, i m doing n personal laptop.
 so i think i ve rights to open a listening socket,could u pls tell me hw
 can i check it?

Is your keyboard broken? There are a lot of missing characters in your
sentences. You're going to have a lot of trouble programming with a broken
keyboard.

As far as sockets, this is a Python discussion group, not Windows experts.
Try googling for more information and see if that helps:

https://duckduckgo.com/?q=windows%20permission%20to%20open%20sockets




-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread pramod gowda
On Saturday, January 3, 2015 6:08:28 PM UTC+5:30, Chris Angelico wrote:
 On Sat, Jan 3, 2015 at 11:25 PM, pramod gowda pramod.s...@gmail.com wrote:
  I am using python 3.4.2
  I don get any exceptions,
  but wn i run the code,i don see any connections, IP address is given as my 
  system IP.
 
 What does the client say?
 
 ChrisA

After  c,address=server_socket.accept()  ,this line of code,nothing s being 
executed.

example i am just trying to print Hello
thts also not being printed
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Command Line Inputs from Windows

2015-01-03 Thread Gisle Vanem

Ken Stewart wrote:


Here is a sample key:
S1-5-21-1560217580-722697556-320042093-1000-Classes
py_auto_file
shell
open
command

The corrected data for the key looks like this:

C:\Python34\python.exe %1 %*



Yikes! You use the awful cmd.exe as the shell don't you?
An advice is to use something like TakeCommand or 4NT (from jpsoft.com)
and create an executable extension for .py/.pyw files. Like I've
done:
 set .py=C:\Python34\python.exe
 set .pyw=C:\Python34\pythonw.exe

No need to fiddle with registry settings.

--
--gv
--
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread Chris Angelico
On Sat, Jan 3, 2015 at 11:25 PM, pramod gowda pramod.s...@gmail.com wrote:
 I am using python 3.4.2
 I don get any exceptions,
 but wn i run the code,i don see any connections, IP address is given as my 
 system IP.

What does the client say?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Socket programming

2015-01-03 Thread mm0fmf

On 03/01/2015 11:43, pramod gowda wrote:

server_socket=socket.socket()
server_name='192.168.2.2'
server_port= 80
server_socket.bind((server_name,server_port))
server_socket.listen(1)


I don't do much Python on Windows but do you have the necessary access 
rights to open a listening socket on port 80? Don't you need to run this 
with Administrator rights?





--
https://mail.python.org/mailman/listinfo/python-list


[issue23116] Python Tutorial 4.7.1: Improve ask_ok() to cover more input values

2015-01-03 Thread Carol Willing

Carol Willing added the comment:

@amylou Thank you for submitting this documentation suggestion about the Python 
Tutorial.

This tutorial section, 4.7.1 Default Argument Values, tries to show that a 
function can have multiple input arguments which may be given default values.

While the suggestion to use lower() does offer more robust input handling, it 
also adds some complexity to the example by introducing another function to a 
possibly new user.

I do believe that the 'ask_ok' function could be improved by renaming the 
'complaint' argument to something more positive, perhaps 'reminder'. I would 
also recommend replacing the error message 'uncooperative user' to something 
with a softer tone, perhaps 'invalid user response'.

@amyluo If you are interested in working on documentation, section 6 of the 
Developer Guide is a handy resource 
(https://docs.python.org/devguide/docquality.html).

--
assignee:  - docs@python
components: +Documentation
nosy: +docs@python, willingc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23116
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1602] windows console doesn't print or input Unicode

2015-01-03 Thread Drekin

Drekin added the comment:

I tried the following code:

import pdb
pdb.set_trace()
print(1 + 2)
print(αβγ∫)

When run in vanilla Python it indeed ends with UnicodeEncodeError as soon as it 
hits the line with non-ASCII characters. However, the solution via 
win_unicode_console package seems to work correctly. There is just an issue 
when you keep calling 'next' even after the main program ended. It ends with a 
RuntimeError after a few iterations. I didn't know that pdb can continue 
debugging after the main program has ended.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1602
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23150] urllib parse incorrect handing of params

2015-01-03 Thread Julian Reschke

Julian Reschke added the comment:

An example URI for this issue is:

  http://example.com/;

The RFC 3986 path component for this URI is /;.

After using urllib's parse function, how would you know?

(I realize that changing behavior of the existing API may cause problems, but 
this is an information loss issue). One ugly, but workable way to fix this 
would be to also provide access to a RFC3986path component.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23150
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22256] pyvenv should display a progress indicator while creating an environment

2015-01-03 Thread Donald Stufft

Donald Stufft added the comment:

I just noticed this issue. I think all that really needs done here is changing 
the venv module to use subprocess.check_call instead of subprocess.check_output 
when calling ensurepip.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22256
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23121] pip.exe breaks if python 2.7.9 is installed under c:\Program Files\Python

2015-01-03 Thread Donald Stufft

Donald Stufft added the comment:

I do not know what setuptools plans on with regards to distlib sorry.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23121
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23010] unclosed file warning when defining unused logging FileHandler in dictConfig

2015-01-03 Thread Walter Doekes

Walter Doekes added the comment:

No worries. I know how it is ;)
Thanks for the update.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23010
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23153] Clarify Boolean Clause Results

2015-01-03 Thread R. David Murray

R. David Murray added the comment:

I mistyped 'josh' as 'joel', sorry.

Ethan covers it pretty well, but I'll add a few things.

Boolean operators are indeed not always used in a boolean context.  There is a 
long tradition in Python of using them to return values via the short-circuit 
mechanism.  Python is not the only language that does this.

That said, there are disadvantages to that use of boolean operators, and 
eventually the trinary expression 'x if y else z' was introduced, and is now 
the preferred way to compute such values.  The tutorial has not been updated to 
reflect that, and that is something that could be done, but probably requires a 
significant rewrite...someone on irc pointed out that the passage we are 
discussing is the first introduction of 'or' in the tutorial).  However, the 
short-circuit-and-value-returning behavior of the boolean operators will not 
change, since it is a long standing part of the language.

Your suggestion that this whole thing be discussed more is a valid point, but 
the question is, is this point in the tutorial the place to do it?  Again, a 
more extensive rewrite is probably needed in order to make a real improvement 
(a project that is being discussed, whose status I don't know).

Finally, the 4.1 text you quote is noting and/or as an exception is talking 
about the built-in functions and operators.  and and or are important 
exceptions both because their default is different from other logical 
operations and because, unlike the other python operators, a type cannot 
override them.  Thus they always return a value, whereas other *logical* 
operations will return a boolean *unless otherwise documented* in the 
documentation for the type.  (I'm not sure there are any exceptions to that in 
the sdtlib, but there are, for example, in numpy.)

Now, that all said, the tutorial section explicitly mentions the behavior of 
and and or, so I don't see how their being exceptional in this regard is an 
issue with the tutorial text.  If you assigned another logical expression to a 
variable, you'd get True or False, but in Python's philosophy that's just a 
special case of the fact that all values in python have a truth value, as 
discussed by Ethan.

So, in summary, I hear you that as an experienced programmer this tutorial 
section did not give you all the information you wanted.  However, it is a 
*tutorial*, and so it *can't* (and be a readable *tutorial*) cover all the 
issues.  Perhaps it could cover more if it were rewritten, but I don't think 
changing this section in any of the ways suggested so far would, as it is 
currently organized, be an improvement.  If anyone wants to take another stab 
at it, though, we'll definitely evaluate it.

willingc on IRC suggested adding links to other parts of the docs, for further 
reading, and that might be worthwhile if someone wants to take  a look at 
making a suggestion in that regard.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23156] Update tix install information in tkinter tix chapter of doc

2015-01-03 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Update tix install info in doc.  Using tix starts with 3 lines for testing 
one's tix install and continues 

'''If this fails, you have a Tk installation problem which must be resolved 
before proceeding. Use the environment variable TIX_LIBRARY to point to the 
installed Tix library directory, and make sure you have the dynamic object 
library (tix8183.dll or libtix8183.so) in the same directory that contains your 
Tk dynamic object library (tk8183.dll or libtk8183.so). The directory with the 
dynamic object library should also have a file called pkgIndex.tcl (case 
sensitive), which contains the line: package ifneeded Tix 8.1 [list load [file 
join $dir tix8183.dll] Tix]'''

Almost nothing above matches my working-with-tix 3.4.2 Win 7 install.  I do 
have a tix library directory: python34/tcl/tix8.4.3, but the version number is 
much newer.  Since it is in the right place, TIX_LIBRARY is not needed and 
there is none.  python34/DLLs contains tcl86t.dll and tk86t.dll and NO 
tix.dll.  Is the once separate tix dll now part of tk dll?  I cannot find 
pkgIndex.tcl; it is certainly not in the DLLs directory nor in the /tcl.

The current doc seems useless to people who do not have tix working.  See, for 
example,
https://stackoverflow.com/questions/27751923/tix-widgets-installation-issue
which is a semi-repeat question and which claims seeing similar reports 
elsewhere on the net.

--
assignee: docs@python
components: Documentation, Tkinter
messages: 233368
nosy: docs@python, serhiy.storchaka, terry.reedy, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Update tix install information in tkinter tix chapter of doc
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23156
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23157] Lib/test/time_hashlib.py doesn't work

2015-01-03 Thread Antoine Pitrou

New submission from Antoine Pitrou:

I suppose it was totally forgotten in the transition to 3.x, and nobody appears 
to have complained. Perhaps we should remove it.

--
components: Demos and Tools, Library (Lib)
messages: 233375
nosy: christian.heimes, gregory.p.smith, pitrou
priority: low
severity: normal
status: open
title: Lib/test/time_hashlib.py doesn't work
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23157
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23143] Remove some conditional code in _ssl.c

2015-01-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e9f05a4a5f16 by Antoine Pitrou in branch 'default':
Issue #23143: Remove compatibility with OpenSSLs older than 0.9.8.
https://hg.python.org/cpython/rev/e9f05a4a5f16

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23143
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23143] Remove some conditional code in _ssl.c

2015-01-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 37c6fd09f71f by Antoine Pitrou in branch 'default':
Issue #23143: Remove compatibility with OpenSSLs older than 0.9.8.
https://hg.python.org/cpython/rev/37c6fd09f71f

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23143
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23143] Remove some conditional code in _ssl.c

2015-01-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks! Now done.

--
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23143
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23156] Update tix install information in tkinter tix chapter of doc

2015-01-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Added Zach for Window build info, Ned for OSX info.

--
nosy: +ned.deily

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23156
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23143] Remove some conditional code in _ssl.c

2015-01-03 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23143
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23143] Remove some conditional code in _ssl.c

2015-01-03 Thread Donald Stufft

Donald Stufft added the comment:

+1, This sounds completely reasonable to do to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23143
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23153] Clarify Boolean Clause Results

2015-01-03 Thread John Potelle

John Potelle added the comment:

I'm learning Python and informing you this is confusing - and you close the 
ticket without hearing any response to your questions?

Re: Josh
1. To show how to return a Boolean result from a Boolean clause. If there's a 
better way, I'm all for it.
2. Most is a generalization. Perhaps Many is a better term? All traditional 
3GLs and some other scripting languages don't; e.g. REXX and Beanshell return 
Boolean. But it's not important here. 
3. As I said, or some better method. I've been programming 30 years but am 
only now learning Python. All I asking for is better clarification in the 
tutorial. If this were a wiki I would add one myself.

Re: Ethan; quote from the line above, same section in the Tutorial:
When used as a general value and not as a Boolean, the return value of a 
short-circuit operator is the last evaluated argument. If this isn't correct, 
please fix it. And this whole sentence is a bit weird to me - Boolean operators 
are *always* used in a Boolean context - unless the op is overloaded with some 
other functionality. Why would it return anything else? (well let's not go 
there...)

Re: R.David
Sorry I didn't see any input from Joel. But, yes, this is a tutorial.

I argue that using A = (B or C or D) construct is not good, intuitive 
programming style, anyway. To me this looks like A should hold a Boolean, even 
only from a pseduocode standpoint. Even so, one wouldn't need to cast a 
Boolean if a Boolean was returned, as old programmers like me would expect. 

But, OK, so don't use bool() - but what you said is basically what I'm looking 
for IN the tutorial - eduction about why a Boolean should NOT be expected. Or 
how to achieve a Boolean, since it's a valid data type since version 2.3. This 
is a tutorial, after all.

For example, the full documentation for v3.4 section 4.1: Operations and 
built-in functions that have a Boolean result always return 0 or False for 
false and 1 or True for true, unless otherwise stated. (Important exception: 
the Boolean operations or and and always return one of their operands.). Even 
here the docs says this is an exception.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Mark Lawrence

New submission from Mark Lawrence:

I've suspected that this is the case for some time but I've confirmed it this 
morning.  I ran synchronize and the highest revision was 94004 Changes %s to 
%ls in wprintf in launcher.c for C99 compatibility.  As expected MSVC rebuilt 
the launcher.  Later I reran synchronize and the highest revision was 94009 
Update bundled pip and setuptools to 6.0.6 and 11.0..  The output from the 64 
bit Release build concluded 31 succeeded, 0 failed, 5 up-to-date, 1 skipped.  
There also seems to be a toggle operating between the Release and Debug builds 
such that only one rebuilds at any one time.

--
components: Build, Windows
messages: 233355
nosy: BreamoreBoy, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: MSVC 2013 Express needlessly rebuilds code
versions: Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23153] Clarify Boolean Clause Results

2015-01-03 Thread R. David Murray

R. David Murray added the comment:

Indeed, the short circuit and value return behavior is described in that 
section just before the example.

I agree with Joel.  This is a tutorial, and part of the zen of Python is that 
all expressions have a boolean value.  There are very few places in python 
programs where it would be considered Pythonic to cast a value to one of the 
two uniquely boolean values via the Bool operator, so it is better that it 
*not* be mentioned in this context.

--
nosy: +r.david.murray
resolution:  - not a bug
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Zachary Ware

Zachary Ware added the comment:

To clarify a bit, there's very little re-compiling, but everything that 
references the pythoncore project (every extension) is re-linked. There's no 
way around that short of not including the hg revision (which I won't accept 
:), but the re-linking only takes a fraction of a second per project.

--
resolution:  - not a bug
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Steve Dower

Steve Dower added the comment:

This is because the hg id result has changed and we embed that into 
python35.dll. You'll see the same thing after an edit too (when the revision 
has + added).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20983] Python 3.4 'repair' Windows installation does not install pip setuptools packages

2015-01-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy: +steve.dower, tim.golden, zach.ware
versions: +Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20983
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11240] Running unit tests in a command line tool leads to infinite loop with multiprocessing on Windows

2015-01-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy: +sbt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11240
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14302] Rename Scripts directory to bin and move python.exe to bin

2015-01-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy: +steve.dower, zach.ware
versions: +Python 3.5 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14302
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17202] Add .bat line to .hgeol

2015-01-03 Thread Mark Lawrence

Mark Lawrence added the comment:

No objections so proceeding is in order here I take it?

--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17202
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23155] unittest: object has no attribute '_removed_tests'

2015-01-03 Thread Thomas Klausner

New submission from Thomas Klausner:

On NetBSD with python-3.4.2 I see the following issue when running the tests 
for py-flake8-2.2.5:

running build_ext
test_get_parser (flake8.tests.test_engine.TestEngine) ... ok
test_get_python_version (flake8.tests.test_engine.TestEngine) ... ok
test_get_style_guide (flake8.tests.test_engine.TestEngine) ... ok
test_get_style_guide_kwargs (flake8.tests.test_engine.TestEngine) ... ok
test_register_extensions (flake8.tests.test_engine.TestEngine) ... ok
test_stdin_disables_jobs (flake8.tests.test_engine.TestEngine) ... ok
test_windows_disables_jobs (flake8.tests.test_engine.TestEngine) ... ok
Traceback (most recent call last):
  File setup.py, line 74, in module
test_suite='nose.collector',
  File /usr/pkg/lib/python3.4/distutils/core.py, line 148, in setup
dist.run_commands()
  File /usr/pkg/lib/python3.4/distutils/dist.py, line 955, in run_commands
self.run_command(cmd)
  File /usr/pkg/lib/python3.4/distutils/dist.py, line 974, in run_command
cmd_obj.run()
  File /usr/pkg/lib/python3.4/site-packages/setuptools/command/test.py, line 
142, in run
self.with_project_on_sys_path(self.run_tests)
  File /usr/pkg/lib/python3.4/site-packages/setuptools/command/test.py, line 
122, in with_project_on_sys_path
func()
  File /usr/pkg/lib/python3.4/site-packages/setuptools/command/test.py, line 
163, in run_tests
testRunner=self._resolve_as_ep(self.test_runner),
  File /usr/pkg/lib/python3.4/unittest/main.py, line 93, in __init__
self.runTests()
  File /usr/pkg/lib/python3.4/unittest/main.py, line 244, in runTests
self.result = testRunner.run(self.test)
  File /usr/pkg/lib/python3.4/unittest/runner.py, line 168, in run
test(result)
  File /usr/pkg/lib/python3.4/unittest/suite.py, line 87, in __call__
return self.run(*args, **kwds)
  File /usr/pkg/lib/python3.4/unittest/suite.py, line 130, in run
self._removeTestAtIndex(index)
  File /usr/pkg/lib/python3.4/unittest/suite.py, line 83, in 
_removeTestAtIndex
self._removed_tests += test.countTestCases()
  File /usr/pkg/lib/python3.4/unittest/suite.py, line 41, in countTestCases
cases = self._removed_tests
AttributeError: 'FinalizingSuiteWrapper' object has no attribute 
'_removed_tests'
*** Error code 1


I have reported this

https://gitlab.com/pycqa/flake8/issues/19#note_712215

and Ian Cordasco said this looks like a bug in the unittest module, not 
py-flake8.

--
components: Extension Modules
messages: 233365
nosy: wiz
priority: normal
severity: normal
status: open
title: unittest: object has no attribute '_removed_tests'
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23155
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23153] Clarify Boolean Clause Results

2015-01-03 Thread Ethan Furman

Ethan Furman added the comment:

Apologies, my wording was poor -- the last item evaluated is the one returned, 
but all items may not be evaluated.  As soon as the answer is known Python 
stops evaluating any remaining items.

So in the example:

  -- string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'
  -- string1 or string2 or string3
  'Trondheim'

string2 is returned because it satifies the `or` conditions, and string3 is not 
evaluated.


Re: John

I appreciate you have many years of programming experience, but there are going 
to be differences between what is good practice in those languages and what is 
good practice in Python.  IMO, the big three differences are:

  - white space indentation
  - everything is an object (variables, functions, classes, instances,
any piece of data...)
  - everything has a truthy of falsey value -- e.g.

-- string1, string2, string3 = '', 'Trondheim', 'Hammer Dance'
-- if string2:
...print('string2 has a value!  It is %s' % string2)
...
'string2 has a value!  It is Trondheim'

notice there is no `if bool(string2)` or `if string2 == False` (which would 
be False).

As far as finding that bit of the tutorial confusing, there is no way to have a 
single document that is crystal clear to everyone who reads it.  This section 
is correct, as is section 4.1 -- `or` is being used, so the operand is 
returned, not True or False.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23150] urllib parse incorrect handing of params

2015-01-03 Thread Senthil Kumaran

Senthil Kumaran added the comment:

On Saturday, January 3, 2015 at 12:46 AM, Julian Reschke wrote:
 An example URI for this issue is:
 
 http://example.com/;
 
 The RFC 3986 path component for this URI is /;. 
I think, a stronger argument might be desirable (something like a real world 
scenario wherein a web app can construct such an entity) for a path that ends 
in a semi-colon for breaking backwards compatibility. 

OTOH, making it RFC 3986 compliant itself is a good enough argument, but it 
should be applied in total and the whole module should be made compatible 
instead of pieces of it. There is a bug to track it. You can mention this 
instance for the desired behavior in that ticket too (and close this ticket if 
this desired behavior is a subset).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23150
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Zachary Ware

Zachary Ware added the comment:

Hmmm, what are sections 3 and 4? Are you building from the VS GUI or
Command Prompt?

From Command Prompt in a clean checkout, running PCbuild\build.bat -d -e
(debug build) should take several minutes. The same again should be quick,
and then just PCbuild\build.bat (release build) should take a while, and
the same again should be quick.  If you then do another debug build (add
-d back), it will take a bit of time due to rebuilding (or at least
re-installing) Tcl/Tk. Otherwise, things should be pretty quick.

I haven't tested any of that this morning, though; how far off is that from
your experience, Mark?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Mark Lawrence

Mark Lawrence added the comment:

I build from the GUI.  I've just tried the Release build, it very quickly 
rebuilt the first four items and said the rest were up to date.  I switched to 
Debug and got the output in the attached file.  This is what I meant earlier by 
the effect toggling between the two builds.

I tried what you suggested from the command line.  I'll attach the end of the 
output from the final run of the debug build in a moment as I can't see how to 
put it in in one pass here.

--
Added file: http://bugs.python.org/file37587/MSVCEdebugbuildoutput.log

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21337] Add tests for Tix

2015-01-03 Thread Terry J. Reedy

Terry J. Reedy added the comment:

A minimal test would be that the one in the doc.

from tkinter import tix
root = tix.Tk()
root.tk.eval('package require Tix')

This passes on my 3.4.2 win7.  I believe the first line should work on any 
system with _tkinter, whereas 
https://stackoverflow.com/questions/27751923/tix-widgets-installation-issue

reports failure of the second line on his Mac with ...
  self.tk.eval('package require Tix')
_tkinter.TclError: can't find package Tix

--
nosy: +terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21337
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Mark Lawrence

Mark Lawrence added the comment:

Then we're not talking about the same thing.  Maybe my setup is wrong, but a 
load of files were recompiled (from memory I think from sections 3 and 4 of the 
Release build) so it took minutes rather than fractions of a second.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


Added file: http://bugs.python.org/file37588/CMDdebugbuildoutput.log

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Jeremy Kloth

Changes by Jeremy Kloth jeremy.kloth+python-trac...@gmail.com:


--
nosy: +jkloth

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1284316] Win32: Security problem with default installation directory

2015-01-03 Thread Steve Dower

Steve Dower added the comment:

I'll reassign this to me, as I'm looking into making Program Files the default 
location for 3.5.

I'd like to release at least some of the alphas with the change active by 
default (i.e. it's easy to select the old directory) to get broader feedback. 
So far I haven't encountered any trouble other than in pip (as is being 
discussed at https://github.com/pypa/pip/issues/1668).

If things don't work well in the early releases of 3.5 we can easily revert the 
change, though I suspect the main feedback is going to be about the amount of 
typing required. In that case, I'll look into hardening the permissions on the 
root directory as part of installation.

Unless some really bad scenarios arise, getting the legacy permissions will be 
opt-in. As 3.5 will be the first version with that change there shouldn't be 
any direct back-compat issues - we can't make a change like that in maintenance 
releases or even 3.4.

--
assignee: loewis - steve.dower
versions:  -Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1284316
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Zachary Ware

Zachary Ware added the comment:

On testing, you are correct, Mark.  Sorry for the premature close.

How does this patch look to you, Steve?

--
assignee:  - zach.ware
keywords: +patch
resolution: not a bug - 
stage: resolved - 
status: closed - open
type:  - behavior
Added file: http://bugs.python.org/file37589/issue23154.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20898] Missing 507 response description

2015-01-03 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee: rhettinger - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20898
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Steve Dower

Steve Dower added the comment:

Ah, I forgot to put Configuration in there. That patch is fine.

If it's only the OpenSSL projects doing this, that shouldn't cause 31 projects 
to rebuild (4 at most I'd have though), but it probably will cause more 
rebuilds than necessary.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23158] IDLE's help.txt corrent typo

2015-01-03 Thread Al Sweigart

New submission from Al Sweigart:

There is a typo in IDLE's help.txt file:

into the corrent number of spaces

--
messages: 233379
nosy: Al.Sweigart
priority: normal
severity: normal
status: open
title: IDLE's help.txt corrent typo
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23158
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23158] IDLE's help.txt corrent typo

2015-01-03 Thread Al Sweigart

Al Sweigart added the comment:

I've attached a simple typo fix for this issue.

--
keywords: +patch
Added file: http://bugs.python.org/file37590/patch.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23158
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Zachary Ware

Zachary Ware added the comment:

Our original explanation accounts for the 31 projects rebuilding.
I'll get the patch committed later tonight (hopefully).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23153] Clarify Boolean Clause Results

2015-01-03 Thread John Potelle

John Potelle added the comment:

Thank you for your reasoned responses. I'm beginning to see just how much 
Python is its own animal. This and/or thing has history; I get it. Links back 
to the reference documentation is a good idea.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23153
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23158] IDLE's help.txt corrent typo

2015-01-03 Thread Al Sweigart

Changes by Al Sweigart asweig...@gmail.com:


--
components: +IDLE

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23158
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17583] IDLE HOWTO

2015-01-03 Thread Al Sweigart

Changes by Al Sweigart asweig...@gmail.com:


--
nosy: +Al.Sweigart

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17583
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14944] Setup Usage documentation for pydoc, idle 2to3

2015-01-03 Thread Al Sweigart

Changes by Al Sweigart asweig...@gmail.com:


--
nosy: +Al.Sweigart

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14944
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23132] Faster total_ordering

2015-01-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Serhiy.  I really like this clean-up.  When there is an exception in the 
user's root comparison operation, the traceback is more intelligible now.

If you're interested, here are two additional optimizations:

_op_or_eq = ''' 
op_result = self.%s(other)
# Since bool(NotImplemented) is true, the usual special case test isn't 
needed here
return op_result or self == other   
'''

# setting NotImplemented as a local constant saves one or two global lookups 
per call
exec('def %s(self, other, NotImplemented=NotImplemented):%s' % (opname, opfunc 
% root), namespace)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23132
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22628] Idle: Tree lines are spaced too close together.

2015-01-03 Thread Al Sweigart

Changes by Al Sweigart asweig...@gmail.com:


--
nosy: +Al.Sweigart

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22628
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22956] Improved support for prepared SQL statements

2015-01-03 Thread Gerhard Häring

Gerhard Häring added the comment:

The low-hanging fruit of executemany() reusing the prepared statement is of 
course taken. Also, there is a statement cache that is being used transparently.

I am against exposing the statement directly via the API.

--
assignee:  - ghaering
nosy: +ghaering
priority: normal - low
resolution:  - rejected

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22956
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21718] sqlite3 cursor.description seems to rely on incomplete statement parsing for detection

2015-01-03 Thread Gerhard Häring

Gerhard Häring added the comment:

I have now committed a fix in the pysqlite project at github. 
https://github.com/ghaering/pysqlite/commit/f67fa9c898a4713850e16934046f0fe2cba8c44c

I'll eventually merge it into the Python tree.

--
assignee:  - ghaering
nosy: +ghaering

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21718
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22382] sqlite3 connection built from apsw connection should raise IntegrityError, not DatabaseError

2015-01-03 Thread Gerhard Häring

Gerhard Häring added the comment:

Reusing the apsw connection in the sqlite3 module was deprecated a long time 
ago. It is simply not supported, even if there is still code left in the module 
that supports this somewhat.

This code should then be removed.

This closing as wontfix.

--
assignee:  - ghaering
resolution: third party - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22382
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14076] sqlite3 module ignores placeholders in CREATE TRIGGER code

2015-01-03 Thread Gerhard Häring

Gerhard Häring added the comment:

The sqlite3 module is not at fault here. If it does not work, then is is a 
restriction of SQLite3 - at which places it accepts bind parameters.

This closing as not a bug.

--
assignee:  - ghaering
resolution:  - not a bug
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14076
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23154] MSVC 2013 Express needlessly rebuilds code

2015-01-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d53506fe31e1 by Zachary Ware in branch 'default':
Closes #23154: Fix unnecessary recompilation of OpenSSL on Windows
https://hg.python.org/cpython/rev/d53506fe31e1

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23154
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23132] Faster total_ordering

2015-01-03 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
Removed message: http://bugs.python.org/msg233383

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23132
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23132] Faster total_ordering

2015-01-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Serhiy, this is a really nice idea.  By removing the additional layer of 
indirection, the code is more intelligible, runs faster, and the tracebacks 
make more sense when the user's root comparison raises an exception.

Since there are only twelve functions involved, I don't think the function 
templates give us much of a payoff.  Instead, it would be better to just 
precompute the 12 functions rather than have 5 templates.

I've attached a patch relative to Python 3.4.  Ideally, I would like this 
backported to 3.4 to fix the regression in performance and intelligibility.

One further possible change is to localize the NotImplemented global variable.  
This will reduce the overhead of NotImplemented checking to almost nothing and 
almost completely restore the performance of earlier versions.

--
Added file: http://bugs.python.org/file37591/total_ordering.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23132
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2015-01-03 Thread Bob Chen

Bob Chen added the comment:

Is there any possibility that we encapsulate urllib.quote into httplib? Because 
many developers wouldn't know about this utility function. And as I mentioned 
above, they could have got an unicode url from anywhere inside python, like an 
API call, without being noticed that it is potentially wrong.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2015-01-03 Thread Bob Chen

Changes by Bob Chen 175818...@qq.com:


Removed file: http://bugs.python.org/file36492/httplib.py.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2015-01-03 Thread Bob Chen

Changes by Bob Chen 175818...@qq.com:


Added file: http://bugs.python.org/file37592/httplib.py.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2015-01-03 Thread Bob Chen

Bob Chen added the comment:

How about this patch?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22956] Improved support for prepared SQL statements

2015-01-03 Thread Markus Elfring

Markus Elfring added the comment:

Are you really against benefits from reusing of existing application 
programming interfaces for the explicit preparation and compilation of SQL 
statements?

It seems that other software contributors like Marc-Andre Lemburg and Tony 
Locke show more constructive opinions.
https://mail.python.org/pipermail/db-sig/2014-December/006133.html
https://www.mail-archive.com/db-sig@python.org/msg01829.html
http://article.gmane.org/gmane.comp.python.db/3784

--
resolution: rejected - later

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22956
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22231] httplib: unicode url will cause an ascii codec error when combined with a utf-8 string header

2015-01-03 Thread Demian Brecht

Demian Brecht added the comment:

utf-8 encoding is only one step in IRI encoding. Correct IRI encoding is non 
trivial and doesn't fall into the support policy for 2.7 (bug/security fixes). 
I think that the best that can be done for 2.7 is to enhance the documentation 
around HTTPConnection.__init__ (unicode hostnames should be IDNA-encoded with 
the built-in IDNA encoder) and HTTPConnection.request/putrequest noting that 
unicode paths should be IRI encoded, with a link to RFC 3987.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22231
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >