Re: More tkinter Madness

2015-11-12 Thread Christian Gollwitzer
Am 13.11.15 um 06:42 schrieb Tim Daneliuk: Curioser and curioser. Yes, xterm works fine. Dunno about any other tk apps. Hello world Tk is like this: Apfelkiste:Sources chris$ wish % pack [button .b -text Hello -command exit] % Apfelkiste:Sources chris$ Upon starting wish, an empty window s

Re: More tkinter Madness

2015-11-12 Thread Tim Daneliuk
On 11/12/2015 10:46 PM, Michael Torrie wrote: > On 11/12/2015 05:25 PM, Tim Daneliuk wrote: >> On 11/11/2015 08:25 PM, Chris Angelico wrote: >>> On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk >>> wrote: I am the author of twander (https://www.tundraware.com/Software/twander). This code h

Plotting timeseries from a csv file using matplotlib

2015-11-12 Thread Karthik Sharma
I have some csv data in the following format. Ln Dr Tag Lab 0:01 0:02 0:03 0:04 0:05 0:06 0:07 0:08 0:09 L0 St vT 4R 0 0 00 0 0 00 0 L2 Tx st 4R

Re: More tkinter Madness

2015-11-12 Thread Michael Torrie
On 11/12/2015 05:25 PM, Tim Daneliuk wrote: > On 11/11/2015 08:25 PM, Chris Angelico wrote: >> On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk >> wrote: >>> I am the author of twander (https://www.tundraware.com/Software/twander). >>> This code has run flawlessly for years on FreeBSD, Linux, MacOS

Re: Is it useful for re.M in this example?

2015-11-12 Thread Terry Reedy
On 11/12/2015 4:34 PM, fl wrote: I follow a web site on learning Python re. I have read the function description of re.m, as below. re.MMakes $ match the end of a line (not just the end of the string) and makes ^ match the start of any line (not just the start of the string). But I d

Matplotlib error: Value Error: x and y must have same first dimension

2015-11-12 Thread Abhishek
I am trying to run some Python code for the last few hours. How can I achieve the effect of "dot divide" from Matlab, in the following code? I am having trouble working with list comprehension and numpy arrays and getting the following error: Traceback (most recent call last): File "T

Re: More tkinter Madness

2015-11-12 Thread Tim Daneliuk
On 11/11/2015 08:12 PM, Paul Rubin wrote: > Tim Daneliuk writes: >> Some months ago, I put it on a couple of VPS servers (FreeBSD >> and Linux) and BOOM, it doesn't run. I asked around here and got some >> suggestions and then did some homework. > > I'd expect a VPS server to have no display--is

Re: More tkinter Madness

2015-11-12 Thread Tim Daneliuk
On 11/11/2015 08:25 PM, Chris Angelico wrote: > On Thu, Nov 12, 2015 at 12:52 PM, Tim Daneliuk > wrote: >> I am the author of twander (https://www.tundraware.com/Software/twander). >> This code has run flawlessly for years on FreeBSD, Linux, MacOS and >> Windows. Some months ago, I put it on a co

Re: What is wrong in this example code?

2015-11-12 Thread Larry Hudson via Python-list
On 11/12/2015 06:07 AM, fl wrote: On Thursday, November 12, 2015 at 8:58:33 AM UTC-5, fl wrote: Hi, def tick(self): """ Time will be advanced by one second """ if self.__seconds == 59: self.__seconds = 0 if (self.__minutes == 59):

Re: Question about math.pi is mutable

2015-11-12 Thread Chris Angelico
On Fri, Nov 13, 2015 at 9:19 AM, BartC wrote: > (FWIW, my real first name is Bart and C is the initial of my last name. Very > dull I know.) That's a common way of signing emails. I sign most of mine "ChrisA", which (as you'll see from my headers) is constructed the same way. So did the late Dave

Re: Question about math.pi is mutable

2015-11-12 Thread BartC
On 12/11/2015 20:40, Thomas 'PointedEars' Lahn wrote: Chris Angelico wrote: […] Ben Finney […] wrote: I recommend you ignore that request; “Bartc” is fine as a name here, IMO. Given that LARTC means Linux Advanced Routing and Traffic Control, I'm guessing Bartc is all about *BSD networking?

Re: Question about math.pi is mutable

2015-11-12 Thread Steven D'Aprano
On Fri, 13 Nov 2015 07:40 am, Thomas 'PointedEars' Lahn wrote: > And on GABELNs [1] it is considered polite to post using your real name. Falsehoods programmers believe about names: http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ > You have been warned. And you

Re: Is it useful for re.M in this example?

2015-11-12 Thread John Gordon
In fl writes: > re.M Makes $ match the end of a line (not just the end of the string) and > makes ^ match the start of any line (not just the start of the string). > But I don't see the reason to put re.M in the example project: That's because your sample string does not contain newline cha

Re: don't understand matrix-multiplication should be reversed in python?

2015-11-12 Thread Robert Kern
On 2015-11-12 15:57, PythonDude wrote: Hi all, I've come around a webpage with python-tutorial/description for obtaining something and I'll solve this: R = p^T w where R is a vector and p^T is the transpose of another vector. ... p is a Nx1 column vector, so p^T turns into a 1xN row vector w

Is it useful for re.M in this example?

2015-11-12 Thread fl
Hi, I follow a web site on learning Python re. I have read the function description of re.m, as below. re.MMakes $ match the end of a line (not just the end of the string) and makes ^ match the start of any line (not just the start of the string). But I don't see the reason to put re.M in

Re: new to python, help please !!

2015-11-12 Thread Denis McMahon
On Wed, 11 Nov 2015 08:34:30 -0800, Anas Belemlih wrote: > i am a beginning programmer, i am trying to write a simple code to > compare two character sets in 2 seperate files. ( 2 hash value files > basically) Why? If you simply wish to compare two files, most operating systems provide executa

Re: Question about math.pi is mutable

2015-11-12 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: > […] Ben Finney […] wrote: >> I recommend you ignore that request; “Bartc” is fine as a name here, >> IMO. > > Given that LARTC means Linux Advanced Routing and Traffic Control, I'm > guessing Bartc is all about *BSD networking? :) I thought LART were the Luser Attitude Re

Re: Hi

2015-11-12 Thread Michael Torrie
On 11/12/2015 02:32 AM, Mark Lawrence wrote: > On 11/11/2015 17:35, Cameron Houliston wrote: >> Can I have a link to use python >> >> Sent from Mail for Windows 10 >> > > I usually start with www.google.co.uk. I think Windows 10 blocks Google. :) And of course the official home of Python is http

Re: new to python, help please !!

2015-11-12 Thread Denis McMahon
On Thu, 12 Nov 2015 17:55:33 +, Quivis wrote: > On Thu, 12 Nov 2015 13:58:35 +1100, Steven D'Aprano wrote: > >> horribly inefficient > > Assuming it was md5 values, who cares? Those are small. A file of 160 million md5 hashes as 32 character hex strings is a huge file. Your method calculat

Re: can ConfigParser deal with repeating section header?

2015-11-12 Thread amorawski
On Thursday, November 12, 2015 at 10:48:11 AM UTC-5, John Zhao wrote: > I have a configuration file with repeating sections, for example, > > [INSTANCE] > Name=a > > [INSTANCE] > Name=b > > > I hope I can use ConfigParser to read the file and store the configuration > settings in arrays. >

Re: What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-12 Thread Jason Swails
On Thu, Nov 12, 2015 at 3:05 AM, Xiang Zhang <18518281...@126.com> wrote: > Recently I am learning Python C API. > > When I read the tutorial < > https://docs.python.org/3/extending/newtypes.html#the-basics>, defining > new types, I feel confused. After PyType_Ready(&noddy_NoddyType) comes > Py_IN

Re: Why does 'as' not recognized?

2015-11-12 Thread John Gordon
In <8ddbc8fd-ebdb-4cd2-8e3b-b0e1f5142...@googlegroups.com> fl writes: > >>> cats = ['Tom', 'Snappy', 'Kitty', 'Jessie', 'Chester'] > >>> > >>> type(cats) > > >>> cats[2] > 'Kitty' > >>> as=cats[2] > SyntaxError: invalid syntax > >>> as=cats > SyntaxError: invalid syntax > >>> as > SyntaxError:

Why does 'as' not recognized?

2015-11-12 Thread fl
Hi, When I try the following, python does not know 'as'. Why doesn't it? Thanks, >>> cats = ['Tom', 'Snappy', 'Kitty', 'Jessie', 'Chester'] >>> >>> type(cats) >>> cats[2] 'Kitty' >>> as=cats[2] SyntaxError: invalid syntax >>> as=cats SyntaxError: invalid syntax >>> as SyntaxError: invalid syn

Re: Python.exe is not a valid Win32 application error message

2015-11-12 Thread Michael Torrie
On 11/11/2015 09:43 PM, Steve Hayes wrote: > That is useful to know. > > I get messages (from Glary Utilities) that some of my programs > (including Python) need to be updated, but when I've downloaded and > updated them, the update hasn't worked. Such utilities seem to cause more trouble than

Re: can ConfigParser deal with repeating section header?

2015-11-12 Thread Tim Chase
On 2015-11-12 07:47, John Zhao wrote: > I have a configuration file with repeating sections, for example, > > [INSTANCE] > Name=a > > [INSTANCE] > Name=b > > I hope I can use ConfigParser to read the file and store the > configuration settings in arrays. > > Is that possible? Not with the s

Re: don't understand matrix-multiplication should be reversed in python?

2015-11-12 Thread Ian Kelly
On Thu, Nov 12, 2015 at 8:57 AM, PythonDude wrote: > Hi all, > > I've come around a webpage with python-tutorial/description for obtaining > something and I'll solve this: > > R = p^T w > > where R is a vector and p^T is the transpose of another vector. > > ... > p is a Nx1 column vector, so p^T

don't understand matrix-multiplication should be reversed in python?

2015-11-12 Thread PythonDude
Hi all, I've come around a webpage with python-tutorial/description for obtaining something and I'll solve this: R = p^T w where R is a vector and p^T is the transpose of another vector. ... p is a Nx1 column vector, so p^T turns into a 1xN row vector which can be multiplied with the Nx1 weig

can ConfigParser deal with repeating section header?

2015-11-12 Thread John Zhao
I have a configuration file with repeating sections, for example, [INSTANCE] Name=a [INSTANCE] Name=b I hope I can use ConfigParser to read the file and store the configuration settings in arrays. Is that possible? Thanks a lot. John -- https://mail.python.org/mailman/listinfo/python-li

Re: new to python, help please !!

2015-11-12 Thread Peter Otten
Tim Chase wrote: > On 2015-11-12 15:56, Peter Otten wrote: >> Tim Chase wrote: >> >> > with open("file1.md5") as a, open("file2.md5") as b: >> > for s1, s2 in zip(a, b): >> > if s1 != s2: >> > print("Files differ") >> >> Note that this will not detect extra lines in one of th

Re: What is wrong in this example code?

2015-11-12 Thread John Wong
If you are using Python 3 you will need to change xrange to range, but the error shouldn't be invalid syntax. I remember it should just name name not found/not defined. So if you are not using Python 3, range and xrange do still in Python 2 and they have different use case. So i am really curious

Re: new to python, help please !!

2015-11-12 Thread Tim Chase
On 2015-11-12 15:56, Peter Otten wrote: > Tim Chase wrote: > > > with open("file1.md5") as a, open("file2.md5") as b: > > for s1, s2 in zip(a, b): > > if s1 != s2: > > print("Files differ") > > Note that this will not detect extra lines in one of the files. > I recommend that

Re: new to python, help please !!

2015-11-12 Thread Peter Otten
Tim Chase wrote: > with open("file1.md5") as a, open("file2.md5") as b: > for s1, s2 in zip(a, b): > if s1 != s2: > print("Files differ") Note that this will not detect extra lines in one of the files. I recommend that you use itertools.zip_longest (izip_longest in Python 2)

Re: new to python, help please !!

2015-11-12 Thread paul.hermeneutic
Would some form of subprocess.Popen() on cmp or fc /b be easier? On Nov 12, 2015 7:13 AM, "Tim Chase" wrote: > On 2015-11-12 08:21, Marko Rauhamaa wrote: > > And if you really wanted to compare two files that are known to > > contain MD5 checksums, the simplest way is: > > > >with open('f1.md

Re: new to python, help please !!

2015-11-12 Thread Tim Chase
On 2015-11-12 08:21, Marko Rauhamaa wrote: > And if you really wanted to compare two files that are known to > contain MD5 checksums, the simplest way is: > >with open('f1.md5') as f1, open('f2.md5') as f2: >if f1.read() == f2.read(): >... >else: >... T

Re: What is wrong in this example code?

2015-11-12 Thread fl
On Thursday, November 12, 2015 at 8:58:33 AM UTC-5, fl wrote: > Hi, > > I run a code snippet from link: > http://www.python-course.eu/inheritance_example.php > > It is found that there is an error in this loop: > > for i in xrange(1): > x.tick() > print(x) > SyntaxError: invalid syntax >

Re: cross platform alternative for signal.SIGALRM?

2015-11-12 Thread Terry Reedy
On 11/12/2015 6:38 AM, Chris Angelico wrote: On Thu, Nov 12, 2015 at 9:15 PM, Terry Reedy wrote: On 11/12/2015 2:37 AM, Chris Angelico wrote: On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer wrote: My understanding of async is that it creates an event loop. In which case the loop has

What is wrong in this example code?

2015-11-12 Thread fl
Hi, I run a code snippet from link: http://www.python-course.eu/inheritance_example.php It is found that there is an error in this loop: for i in xrange(1): x.tick() print(x) SyntaxError: invalid syntax I have modified it to: for i in x range(1): x.tick() print(x) SyntaxError:

Re: cross platform alternative for signal.SIGALRM?

2015-11-12 Thread Chris Angelico
On Thu, Nov 12, 2015 at 9:15 PM, Terry Reedy wrote: > On 11/12/2015 2:37 AM, Chris Angelico wrote: >> >> On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer >> wrote: >>> >>> My understanding of async is that it creates an event loop. In which case >>> the loop has no chance to run within a blo

Re: Classic OOP in Python

2015-11-12 Thread jongiddy
On Thursday, 18 June 2015 12:21:29 UTC+1, Jason P. wrote: > > I'm aware of duck typing. The point in using interfaces is to be explicit > about the boundaries of a system. > > Quite a red "Growing Object-Oriented Software, Guided by Tests", by the way. > In fact interfaces are key components i

Re: cross platform alternative for signal.SIGALRM?

2015-11-12 Thread Terry Reedy
On 11/12/2015 2:37 AM, Chris Angelico wrote: On Thu, Nov 12, 2015 at 5:43 PM, Christian Gollwitzer wrote: My understanding of async is that it creates an event loop. In which case the loop has no chance to run within a block of code that computes anything, is that correct? This is correct. At

Re: Python Trouble

2015-11-12 Thread Laura Creighton
In a message of Wed, 11 Nov 2015 20:01:46 +, Kaif Mahmood writes: >I downloaded the recent version of Python and after it downloaded I tried IDLE. But when I tried to load it, it didn’t load and just acted as if nothing happened. All of the other features work fine, it’s just IDLE not worki

Re: Python Trouble

2015-11-12 Thread Terry Reedy
On 11/11/2015 3:01 PM, Kaif Mahmood wrote: I downloaded the recent version of Python and after it downloaded I tried IDLE. But when I tried to load it, it didn’t load and just acted as if nothing happened. All of the other features work fine, it’s just IDLE not working. I tried different versi

Re: Python.exe is not a valid Win32 application error message

2015-11-12 Thread Laura Creighton
In a message of Wed, 11 Nov 2015 08:28:11 -0700, Michael Torrie writes: >The Python website is looking very professional and polished these days. > But we still don't have a simple message on the download page telling >people Windows XP is no longer supported. Given the number of people >posting l

Re: Hi

2015-11-12 Thread Mark Lawrence
On 11/11/2015 17:35, Cameron Houliston wrote: Can I have a link to use python Sent from Mail for Windows 10 I usually start with www.google.co.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.

Re: Swig + Numpy.i with a const int16_t pointer

2015-11-12 Thread Christian Gollwitzer
Am 12.11.15 um 10:16 schrieb Christian Gollwitzer: Am 12.11.15 um 09:46 schrieb Christian Gollwitzer: Am 11.11.15 um 02:09 schrieb shripha...@gmail.com: I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst* handl

Re: Swig + Numpy.i with a const int16_t pointer

2015-11-12 Thread Christian Gollwitzer
Am 12.11.15 um 09:46 schrieb Christian Gollwitzer: Am 11.11.15 um 02:09 schrieb shripha...@gmail.com: I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame, size_t frame_

Re: Swig + Numpy.i with a const int16_t pointer

2015-11-12 Thread Christian Gollwitzer
Am 11.11.15 um 02:09 schrieb shripha...@gmail.com: I am trying to wrap the following function with SWIG so I can call it from Python. The signature is: ``` int WebRtcVad_Process(VadInst* handle, int fs, const int16_t* audio_frame, size_t frame_length); ``` This is thing is an array of 16 bit

Python Trouble

2015-11-12 Thread Kaif Mahmood
I downloaded the recent version of Python and after it downloaded I tried IDLE. But when I tried to load it, it didn’t load and just acted as if nothing happened. All of the other features work fine, it’s just IDLE not working. I tried different versions but I encounter the same problem. The onl

Hi

2015-11-12 Thread Cameron Houliston
Can I have a link to use python Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-12 Thread Xiang Zhang
Recently I am learning Python C API. When I read the tutorial , defining new types, I feel confused. After PyType_Ready(&noddy_NoddyType) comes Py_INCREF(&noddy_NoddyType). Actually noddy_NoddyType is a static struct so I don't und

Re: cross platform alternative for signal.SIGALRM?

2015-11-12 Thread Marko Rauhamaa
Ulli Horlacher : > Marko Rauhamaa wrote: > >> I'm thinking the only portable way is to run a watchdog process with >> subprocess or multiprocessing. > > How can a subprocess interrupt a function in another process? > > For example: waiting for user input with a timeout. > > raw_input("Hit ENTER t