guiqwt

2015-05-21 Thread Poul Riis
How can I control the size of the window in the example below? Poul Riis import numpy as np from guiqwt import pyplot as plt_ x = np.arange(0,20,0.1) y = np.cos(x) plt_.figure(1) plt_.plot(x,y,'r-') plt_.show() -- https://mail.python.org/mailman/listinfo/python-list

PYTHONPATH when calling from ipython

2015-05-21 Thread Cecil Westerhof
I am looking into using ipython instead of bash. But when I call a python program from ipython PYTHONPATH is not set. So pythonscripts that need a module through PYTHONPATH will not work. I could do something like: !PYTHONPATH=~/Python/PythonLibrary python2 … But I find that a little bit cumb

Re: Best approach to create humongous amount of files

2015-05-21 Thread Cem Karan
On May 20, 2015, at 7:44 AM, Parul Mogra wrote: > Hello everyone, > My objective is to create large amount of data files (say a million *.json > files), using a pre-existing template file (*.json). Each file would have a > unique name, possibly by incorporating time stamp information. The file

Re: textwrap.wrap() breaks non-breaking spaces

2015-05-21 Thread Roy Smith
In article , Johannes Bauer wrote: > so that textwrap.wrap() breks non-breaking spaces, is this a bug or > intended behavior? I opened http://bugs.python.org/issue16623 on this a couple of years ago. Looks like it was being worked (http://bugs.python.org/issue20491) but got stalled in the te

different types of inheritence...

2015-05-21 Thread zipher
Still considering distinguishing between different types of inheritance. Apart from object composition or mix-in style, I want to illustrate something regarding the "arrow" of inheritance. class super_dict(dict): def __init__(self, init={}, default_value=0, collision_function=None):

Re: How to do integers to binary lists and back

2015-05-21 Thread Ian Kelly
On Thu, May 21, 2015 at 4:31 PM, Ben Finney wrote: "{foo:d}".format(foo=foo) > '4567' "{foo:b}".format(foo=foo) > '1000111010111' Which since there's nothing else in the format string can be simplified to: >>> format(foo, "b") '1000111010111' -- https://mail.python.org/mailman/listinf

Re: How to do integers to binary lists and back

2015-05-21 Thread MRAB
On 2015-05-21 23:20, John Pote wrote: Hi everyone. I recently had the problem of converting from an integer to its representation as a list of binary bits, each bit being an integer 1 or 0, and vice versa. E.G. 0x53 becomes [ 0, 1, 0, 1, 0, 0, 1, 1 ] This I wanted to do for integers of many tens

Re: How to do integers to binary lists and back

2015-05-21 Thread Ben Finney
John Pote writes: > I recently had the problem of converting from an integer to its > representation as a list of binary bits, each bit being an integer 1 > or 0, and vice versa. Is this a homework assignment? > E.G. > 0x53 > becomes > [ 0, 1, 0, 1, 0, 0, 1, 1 ] >>> foo = 4567 >>> foo 4567 >>

How to do integers to binary lists and back

2015-05-21 Thread John Pote
Hi everyone. I recently had the problem of converting from an integer to its representation as a list of binary bits, each bit being an integer 1 or 0, and vice versa. E.G. 0x53 becomes [ 0, 1, 0, 1, 0, 0, 1, 1 ] This I wanted to do for integers of many tens, if not hundreds, of bits. Python

python paho mqtt thread

2015-05-21 Thread Luca Sanna
hi , I try to run this code MQTT but I can not read the messages in the topic , can you help me ? thanks class MyMQTTClass(Thread): #def __init__(self, clientid=None): clientid=None _mqttc = mqtt.Client(clientid) #_mqttc.on_message = mqtt_on_message #_mqttc.on_connect = mqtt_o

Re: Slices time complexity

2015-05-21 Thread bart4858
On Thursday, 21 May 2015 18:16:33 UTC+1, Steven D'Aprano wrote: > On Thu, 21 May 2015 11:34 pm, bartc wrote: > > On Thursday, 21 May 2015 06:19:39 UTC+1, Steven D'Aprano wrote: > > Using what is really pass-by-reference for everything is fine, > > I'm really sure it isn't fine. You could use p

Re: Strategies for using cffi with C++ code?

2015-05-21 Thread Skip Montanaro
On Thu, May 21, 2015 at 12:06 PM, Laura Creighton wrote: > Skip: you may be interested in the new CFFI the pypy project just released > _today_. > > > http://morepypy.blogspot.se/search?updated-min=2015-01-01T00:00:00%2B01:00&updated-max= > 2016-01-01T00:00:00%2B01:00&max-results=11 > Laura, Su

Re: Slices time complexity

2015-05-21 Thread Steven D'Aprano
On Thu, 21 May 2015 11:34 pm, bartc wrote: > On Thursday, 21 May 2015 06:19:39 UTC+1, Steven D'Aprano wrote: >> On Wednesday 20 May 2015 19:56, Bartc wrote: > >> What you *shouldn't* do is implement your own argument convention, > > (That's exactly what I did for my static language compiler whi

Re: Strategies for using cffi with C++ code?

2015-05-21 Thread Laura Creighton
Skip: you may be interested in the new CFFI the pypy project just released _today_. http://morepypy.blogspot.se/search?updated-min=2015-01-01T00:00:00%2B01:00&updated-max=2016-01-01T00:00:00%2B01:00&max-results=11 In any case we have docs here: http://cffi.readthedocs.org/en/latest/ Laura -- ht

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread MRAB
On 2015-05-21 17:31, Grant Edwards wrote: On 2015-05-21, Chris Angelico wrote: On Fri, May 22, 2015 at 12:14 AM, Grant Edwards wrote: On 2015-05-21, Steven D'Aprano wrote: import glob print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*")) Don't use backslashes \ as they have special meanin

Re: Slices time complexity

2015-05-21 Thread MRAB
On 2015-05-21 14:34, bartc wrote: On Thursday, 21 May 2015 06:19:39 UTC+1, Steven D'Aprano wrote: On Wednesday 20 May 2015 19:56, Bartc wrote: What you *shouldn't* do is implement your own argument convention, (That's exactly what I did for my static language compiler which generates x64 c

Strategies for using cffi with C++ code?

2015-05-21 Thread Skip Montanaro
If my reading so far is correct, you can't directly apply cffi to C++ libraries. Everything has to be wrapped in "extern C" declarations, which means, practically speaking, that you have to provide factory function wrapper(s) around constructors and methods. I did find a trivial example: https://g

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Grant Edwards
On 2015-05-21, Chris Angelico wrote: > On Fri, May 22, 2015 at 12:14 AM, Grant Edwards > wrote: >> On 2015-05-21, Steven D'Aprano wrote: >> >>> import glob >>> print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*")) >>> >>> Don't use backslashes \ as they have special meaning to Python. Use forwa

Re: Best approach to create humongous amount of files

2015-05-21 Thread Peter Otten
Mario R. Osorio wrote: > On Wednesday, May 20, 2015 at 2:09:59 PM UTC-4, Denis McMahon wrote: >> On Wed, 20 May 2015 17:14:15 +0530, Parul Mogra wrote: >> >> > Hello everyone, >> > My objective is to create large amount of data files (say a million >> > *.json files), using a pre-existing templat

Re: Best approach to create humongous amount of files

2015-05-21 Thread Mario R. Osorio
On Wednesday, May 20, 2015 at 2:09:59 PM UTC-4, Denis McMahon wrote: > On Wed, 20 May 2015 17:14:15 +0530, Parul Mogra wrote: > > > Hello everyone, > > My objective is to create large amount of data files (say a million > > *.json files), using a pre-existing template file (*.json). Each file > >

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Tim Golden
On 21/05/2015 15:14, Grant Edwards wrote: > On 2015-05-21, Steven D'Aprano wrote: > >> import glob >> print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*")) >> >> Don't use backslashes \ as they have special meaning to Python. Use forward >> slashes and let Python convert them as needed. > > Int

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Chris Angelico
On Fri, May 22, 2015 at 12:14 AM, Grant Edwards wrote: > On 2015-05-21, Steven D'Aprano wrote: > >> import glob >> print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*")) >> >> Don't use backslashes \ as they have special meaning to Python. Use forward >> slashes and let Python convert them as need

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Grant Edwards
On 2015-05-21, Steven D'Aprano wrote: > import glob > print(glob.glob("c:/abc/def/ghjmain/features/XYZ/*")) > > Don't use backslashes \ as they have special meaning to Python. Use forward > slashes and let Python convert them as needed. Interesting. I've never heard about this. When will Pytho

Re: subprocess.Popen zombie

2015-05-21 Thread Ian Kelly
On May 21, 2015 12:41 AM, "Thomas Rachel" < nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de> wrote: > > Am 20.05.2015 um 18:44 schrieb Robin Becker: > >> not really, it's just normal to keep event routines short; the routine >> which beeps is after detection of the cat's entrance

Re: No ttk in 2.7

2015-05-21 Thread Sturla Molden
Zachary Ware wrote: > The way I would do it is as follows: > >try: >import tkinter as tk >from tkinter import ttk >except ImportError: >import Tkinter as tk >import ttk > > If I may suggest, just write it in Python3 first, then when it does > what you wan

Re: Slices time complexity

2015-05-21 Thread bartc
On Thursday, 21 May 2015 06:19:39 UTC+1, Steven D'Aprano wrote: > On Wednesday 20 May 2015 19:56, Bartc wrote: > What you *shouldn't* do is implement your own argument convention, (That's exactly what I did for my static language compiler which generates x64 code. The Win64 calling convention wa

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Tim Golden
On 21/05/2015 09:07, Steven D'Aprano wrote: > On Thursday 21 May 2015 15:34, chaotic@gmail.com wrote: > >> So I was trying to dir /s /b using python. >> Now since the file's path name is computed using other part of the code, I >> am feeding in a variable here and somehow it does not seem to w

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Peter Otten
Steven D'Aprano wrote: > Also, this only looks in the C:.../XYZ directory. I think that Python 3.4 > or better will accept a ** wildcard instead of * to look in subdirectories > too. Unfortunately that's Python 3.5. You are ahead of time. > Actually, I think you don't need the shell argument. T

Re: Slices time complexity

2015-05-21 Thread Chris Angelico
On Thu, May 21, 2015 at 5:35 PM, Steven D'Aprano wrote: >> You don't need huge. On any algorithm where slices are being used you >> will have to account for the linear complexity. You seem to be >> dismissive of this fact, but it can have tremendous performance >> implications, since it can turn a

Re: Find if a file existing within 1000s of folder/sub-folder - each file has a unique presence

2015-05-21 Thread Steven D'Aprano
On Thursday 21 May 2015 15:34, chaotic@gmail.com wrote: > So I was trying to dir /s /b using python. > Now since the file's path name is computed using other part of the code, I > am feeding in a variable here and somehow it does not seem to work.. :( > > Intent is to run following command fr

Re: Slices time complexity

2015-05-21 Thread Steven D'Aprano
On Thursday 21 May 2015 05:51, Mario Figueiredo wrote: > On Wed, 20 May 2015 03:07:03 +1000, Steven D'Aprano > wrote: [...] >>But, really... if you're serious about dealing with huge arrays of data, >>you want something like numpy, not Python lists. > > You don't need huge. On any algorithm wher

Re: Looking for direction

2015-05-21 Thread 20/20 Lab
Your the second to recommend this to me. I ended up picking it up last week. So I need to sit down with it. I was able to get a working project. However, I dont fully grasp the details on how. So the book will help I'm sure. Thank you. On 05/20/2015 05:50 AM, darnold via Python-list wrote