Re: does the order in which the modules are placed in a file matters ?

2015-12-22 Thread Ganesh Pal
Thanks to Don , Chris and Carl for sharing your view on this topic . -- https://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't os.remove work on directories?

2015-12-22 Thread Ben Finney
Random832 writes: > This is surprising to anyone accustomed to the POSIX C remove > function, which can remove either files or directories. Is there > any known rationale for this decision? No, I don't know a rationale for implementing it this way. I expect the explanation will be “mere histor

Why doesn't os.remove work on directories?

2015-12-22 Thread Random832
This is surprising to anyone accustomed to the POSIX C remove function, which can remove either files or directories. Is there any known rationale for this decision? -- https://mail.python.org/mailman/listinfo/python-list

Re: convert to python code

2015-12-22 Thread Ben Finney
Rodrick Brown writes: > Tried a few things but can't seem to get it right any help ? To convert it to Python code, you'll need to actually write some code. Please show here in this forum the actual Python code which is not behaving how you want, and say *exactly* what it's doing different from

OT: citizens and countries - was Re: v3.5.1 - msi download

2015-12-22 Thread Michael Torrie
On 12/22/2015 07:06 PM, jf...@ms4.hinet.net wrote: > Mark Lawrence at 2015/12/21 UTC+8 8:50:00PM wrote: >> My fellow Pythonistas, ask not what our language can do for you, ask >> what you can do for our language. > > When I saw this sentence, I can't resist to think of the famous lie created > by

convert to python code

2015-12-22 Thread Rodrick Brown
Tried a few things but can't seem to get it right any help ? let times = (...matrices) => matrices.reduce( ([a,b,c], [d,e,f]) => [a*d + b*e, a*e + b*f, b*e + c*f] ); -- https://mail.python.org/mailman/listinfo/python-list

Re: v3.5.1 - msi download

2015-12-22 Thread jfong
Mark Lawrence at 2015/12/21 UTC+8 8:50:00PM wrote: > My fellow Pythonistas, ask not what our language can do for you, ask > what you can do for our language. When I saw this sentence, I can't resist to think of the famous lie created by president John kennedy: "Ask not what your country can do fo

Re: Newbie: Convert strings in nested dict to tuples

2015-12-22 Thread KP
Beautiful - thanks! On Tuesday, 22 December 2015 15:23:25 UTC-8, Peter Otten wrote: > KP wrote: > > > I now know how to convert a string cont. coordinates to a tuple, but hwo > > can I do this? > > > > Given > > > > cfg = {'canvas': ('3840', '1024'), > > 'panel1': {'gpio': '1', 'id': '4'

Re: Newbie: Convert strings in nested dict to tuples

2015-12-22 Thread Peter Otten
KP wrote: > I now know how to convert a string cont. coordinates to a tuple, but hwo > can I do this? > > Given > > cfg = {'canvas': ('3840', '1024'), > 'panel1': {'gpio': '1', 'id': '4', 'co': '0,0,1280,1024'}, > 'panel2': {'gpio': '2', 'id': '5', 'co': '1280,0,2560,1024'}, >

Newbie: Convert strings in nested dict to tuples

2015-12-22 Thread KP
I now know how to convert a string cont. coordinates to a tuple, but hwo can I do this? Given cfg = {'canvas': ('3840', '1024'), 'panel1': {'gpio': '1', 'id': '4', 'co': '0,0,1280,1024'}, 'panel2': {'gpio': '2', 'id': '5', 'co': '1280,0,2560,1024'}, 'panel3': {'gpio': '3', 'id

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Grant Edwards
On 2015-12-22, Ian Kelly wrote: > On Tue, Dec 22, 2015 at 8:17 AM, Grant Edwards > wrote: >> On 2015-12-21, Steven D'Aprano wrote: >> >>> So as far as I am concerned, if changes of subject line breaks threading for >>> you, so sad, too bad. Go without threading or use a better mail client. >> >

Re: unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-22 Thread Terry Reedy
On 12/22/2015 3:27 PM, Nicky Mac wrote: I have run the install (and repair) which explicitly includes Tcl/Tk and l have this problem: First, I would download and install the final 3.5.1. I believe there was a change to the installer that might, possibly, make a difference. Write down exactl

Re: How to use a variable to act as @rule in a Sopel IRC bot module?

2015-12-22 Thread arresteddevlopment
Apologies for the terrible formatting, let me try that again: A: from sopel.module import commands, rule import random q_and_as = [('Why?', 'because'), ('Can I kick it?', 'nope')] @commands("quizme") def ask_q(bot, trigger): q = random.choice(q_and_as) bot.say(q[0])  @rule(q[1])

Re: Newbie: String to Tuple

2015-12-22 Thread KP
On Tuesday, 22 December 2015 12:59:59 UTC-8, Mark Lawrence wrote: > On 22/12/2015 20:53, KP wrote: > > How do I convert > > > > '1280,1024' > > > > to > > > > (1280,1024) ? > > > > Thanks for all help! > > > > Start with this https://docs.python.org/3/library/stdtypes.html#str.split > > -- > My

Re: Newbie: String to Tuple

2015-12-22 Thread Peter Otten
KP wrote: > How do I convert > > '1280,1024' > > to > > (1280,1024) ? >>> import ast >>> ast.literal_eval('1280,1024') (1280, 1024) -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie: String to Tuple

2015-12-22 Thread Mark Lawrence
On 22/12/2015 20:53, KP wrote: How do I convert '1280,1024' to (1280,1024) ? Thanks for all help! Start with this https://docs.python.org/3/library/stdtypes.html#str.split -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawre

Newbie: String to Tuple

2015-12-22 Thread KP
How do I convert '1280,1024' to (1280,1024) ? Thanks for all help! -- https://mail.python.org/mailman/listinfo/python-list

unable to open IDLE for Python3.50rc1 on windows10 64bit AMD

2015-12-22 Thread Nicky Mac
I have run the install (and repair) which explicitly includes Tcl/Tk and l have this problem: Microsoft Windows [Version 10.0.10586] (c) 2015 Microsoft Corporation. All rights reserved. >C:\Python\Python35\python.exe -m idlelib ** IDLE can't import Tkinter. Your Python may not be configured f

How to use a variable to act as @rule in a Sopel IRC bot module?

2015-12-22 Thread arresteddevlopment
Hi everyone. I'm working with the Sopel (previously Willie and before that, Jenni/Phenny) python IRC bot as I'd like to set up a trivia quiz for our IRC channel. With Sopel, the @rule decorator lets you set a string that the bot will listen out for and which triggers a corresponding function w

Re: imshow keeps crashhing

2015-12-22 Thread John Gordon
In norou...@gmail.com writes: > Can anyone please help me with "imshow"? I have tried "imshow" on different > computers and different Python consoles but it does not work. Here are the > code and the error message: > import scipy.misc as mi > img = mi.imread('C:\images\circles.png') > mi.imsh

imshow keeps crashhing

2015-12-22 Thread norouzey
Hello everyone, Can anyone please help me with "imshow"? I have tried "imshow" on different computers and different Python consoles but it does not work. Here are the code and the error message: import scipy.misc as mi img = mi.imread('C:\images\circles.png') mi.imshow(img) 'see' is not recogn

Re: Newbie XML problem

2015-12-22 Thread KP
Thank you both - your help is much appreciated! -- https://mail.python.org/mailman/listinfo/python-list

Re: 0x80070570-The file or directory is corrupted and unreadable

2015-12-22 Thread eryk sun
On Tue, Dec 22, 2015 at 11:51 AM, Dennis Lee Bieber wrote: > > http://www.tech-faq.com/how-to-fix-error-0x80070570.html > suggests a registry cleaner (my preference over downloading some > unknown/unvetted "repair" tool) > > Most of the links on Google are for getting the error when installing > W

Re: match point

2015-12-22 Thread Thierry Closen
I found the story behind the creation of re.fullmatch(). I had no luck before because I was searching under "www.python.org/dev", while in reality it sprang out of a bug report: https://bugs.python.org/issue16203 In summary, there were repeated bugs where during maintenance of code the $ symbol

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Tim Chase
On 2015-12-21 23:24, Jon Ribbens wrote: > That sounds a bit confused - if the *intention* of changing the > subject line is to create a new thread, then breaking the thread > is not "breaking threading" ;-) I'm pretty sure that the purpose is not to *break* the thread, but to suggest that the sub-

Re: 0x80070570-The file or directory is corrupted and unreadable

2015-12-22 Thread eryk sun
On Tue, Dec 22, 2015 at 8:02 AM, muizz hasan wrote: > Hi there! I've been recently trying to install Python for Windows 10 > and I've been encountering some issues. Every time i try to install > the program it just says"0x80070570-The file or directory is corrupted > and unreadable". I have attach

Re: (Execution) Termination bit, Alternation bit.

2015-12-22 Thread Chris Angelico
On Wed, Dec 23, 2015 at 2:46 AM, Skybuck Flying wrote: > One idea which immediatly comes to mind to fix this problem is to offer a > "PushTerminationFlag" onto stack and then a "ClearTerminationFlag" > instruction. > > Then a code section can be executed without breaking or terminating. > > Once t

Re: (Execution) Termination bit, Alternation bit.

2015-12-22 Thread Skybuck Flying
"Richard Damon" wrote in message news:QXSdy.6634$qg6.5...@fx31.iad... On 12/21/15 7:40 AM, Skybuck Flying wrote: The original idea I posted is less about sending a signal to another processor. It is more about how to break out of an instruction sequence. Example of problem: [snip] Bye,

Re: unicodedata with chr() not the same between python 3.4 and 3.5

2015-12-22 Thread Chris Angelico
On Wed, Dec 23, 2015 at 2:27 AM, Vincent Davis wrote: > I was expecting the code below to be the same between python3.4 and 3.5. I > need a mapping between the integers and unicode that is consistant between > 3.4 and 3.5 > > import unicodedata > u = ''.join(chr(i) for i in range(65536)

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Ian Kelly
On Tue, Dec 22, 2015 at 8:17 AM, Grant Edwards wrote: > On 2015-12-21, Steven D'Aprano wrote: > >> So as far as I am concerned, if changes of subject line breaks threading for >> you, so sad, too bad. Go without threading or use a better mail client. > > Same here. After getting what is effectiv

unicodedata with chr() not the same between python 3.4 and 3.5

2015-12-22 Thread Vincent Davis
​I was expecting the code below to be the same between python3.4 and 3.5. I need a mapping between the integers and unicode that is consistant between 3.4 and 3.5 >>> import unicodedata >>> u = ''.join(chr(i) for i in range(65536) if (unicodedata.category(chr(i)) in ('Lu', 'Ll')))[945:965] >>> u '

Re: Library function to encode data to multipart/form-data format?

2015-12-22 Thread Grant Edwards
On 2015-12-21, Laura Creighton wrote: > In a message of Mon, 21 Dec 2015 17:51:00 +, Grant Edwards writes: >>Is there a standard library function that can be used to encode data >>into multipart/form-data format? IIRC, I looked for this once before >>and didn't find anything in the library.

Re: Meaning and purpose of the Subject field (was: Ignore error with non-zero exit status)

2015-12-22 Thread Grant Edwards
On 2015-12-21, Steven D'Aprano wrote: > So as far as I am concerned, if changes of subject line breaks threading for > you, so sad, too bad. Go without threading or use a better mail client. Same here. After getting what is effectively a "F*&# Y*& I'm too lazy to do things right" from multiple

Re: return from function

2015-12-22 Thread Denis McMahon
On Sun, 20 Dec 2015 12:34:40 +, Emil Natan wrote: > I'm completely new to Python. > parent_domain = domainname.partition('.')[2] > try: > print('Test for parent domain %s' % parent_domain) > z = dns.resolver.query(parent_domain, 'SOA') > print('the parent domai

Re: What could cause a plot fail in my code?

2015-12-22 Thread Denis McMahon
On Mon, 21 Dec 2015 09:15:38 -0800, Robert wrote: > Hi, > > I find a useful code snippet on link: > > http://stackoverflow.com/questions/25126444/logistic-regression-in- pymc/34400966#34400966 > > but it has error on plot function. The error message is as following: >6192

0x80070570-The file or directory is corrupted and unreadable

2015-12-22 Thread muizz hasan
Hi there! I've been recently trying to install Python for Windows 10 and I've been encountering some issues. Every time i try to install the program it just says"0x80070570-The file or directory is corrupted and unreadable". I have attached my log file and i hope that you guys might enlighten me on

Re: Meaning and purpose of the Subject field

2015-12-22 Thread Thomas 'PointedEars' Lahn
Random832 wrote: > This makes sense for the change from "old" to "new (was: old)", > which nobody was advocating against (after all, there's semantic > content - they wouldn't have changed the subject line if they > didn't consider it a new discussion topic), but I think there is > a reasonable ar

Re: Newbie XML problem

2015-12-22 Thread jmp
On 12/22/2015 05:29 AM, KP wrote: From my first foray into XML with Python: I would like to retrieve this list from the XML upon searching for the 'config' with id attribute = 'B' config = {id: 1, canvas: (3840, 1024), comment: "a comment", {id: 4, gate: 3, (0,0, 1280, 102

Re: Ignore error with non-zero exit status

2015-12-22 Thread Thomas 'PointedEars' Lahn
Terry Reedy wrote: > On 12/21/2015 9:05 AM, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >>> On Tue, Dec 22, 2015 at 12:19 AM, Thomas 'PointedEars' Lahn >>> wrote: Mark Lawrence wrote: > On 21/12/2015 07:51, Thomas 'PointedEars' Lahn wrote: >> Chris Angelico wrote: >

Re: match point

2015-12-22 Thread Thomas 'PointedEars' Lahn
Thierry wrote: > Reading the docs about regular expressions, I am under the impression > that calling > re.match(pattern, string) > is exactly the same as > re.search(r'\A'+pattern, string) Correct. > Same for fullmatch, that amounts to > re.search(r'\A'+pattern+r'\Z', string) Correct. > The

Re: In Python 3, how to append a nested dictionary to a shelve file with the added difficulty of using a for loop?

2015-12-22 Thread Peter Otten
Aaron Christensen wrote: > Thanks for the response! Several things you stated definitely got me > thinking. I really appreciate the response. I used what you said and I > am able to accomplish what I needed. Perhaps it becomes clearer when you write two helper functions def read_record(key):

Re: match point

2015-12-22 Thread Chris Angelico
On Tue, Dec 22, 2015 at 9:56 PM, Thierry wrote: > Maybe re.match has an implementation that makes it more efficient? But > then why would I ever use r'\A', since that anchor makes a pattern match > in only a single position, and is therefore useless in functions like > re.findall, re.finditer or r

match point

2015-12-22 Thread Thierry
Hi, Reading the docs about regular expressions, I am under the impression that calling re.match(pattern, string) is exactly the same as re.search(r'\A'+pattern, string) Same for fullmatch, that amounts to re.search(r'\A'+pattern+r'\Z', string) The docs devote a chapter t