Re: Efficient handling of fast, real-time hex data

2016-06-01 Thread Gregory Ewing
jlada...@itu.edu wrote: One common data transmission error I've seen in other systems is added/dropped bytes. I may add a CRC-8 error-checking byte in place of the newline. Also maybe add a start byte with a known value at the beginning of each packet to help resynchronise if you get out of ste

Re: Don't put your software in the public domain

2016-06-01 Thread Gregory Ewing
Steven D'Aprano wrote: http://linuxmafia.com/faq/Licensing_and_Law/public-domain.html From that: It might be ruled to create a global licence for unrestricted use. That > licence might or might not then be adjudicated to be revocable by subsequent > copyright owners (heirs, divorcing spouses

Re: Finding .so files without setting LD_LIBRARY_PATH

2016-06-01 Thread Lawrence D’Oliveiro
On Thursday, May 12, 2016 at 9:51:02 AM UTC+12, Paul Smith wrote: > ... here's the problem: because LD_LIBRARY_PATH is in > Python's environment it is also passed down to programs invoked by > Python. That means if I (for example) invoke subprocess.call(['ssh', > ...]) then it fails because the sy

Re: What's going on here?

2016-06-01 Thread Lawrence D’Oliveiro
On Monday, May 23, 2016 at 9:47:15 AM UTC+12, DFS wrote: > def splitrange(b,e,g): > sr=[] > for i in range(b,e,g): > bg=i;eg=min(e,bg+g-1) > sr.append((bg,eg)) > return sr To be more in keeping with the Python ethos, I would take out the “-1”. -- http

Re: Recommendation for Object-Oriented systems to study

2016-06-01 Thread Lawrence D’Oliveiro
On Monday, May 30, 2016 at 7:17:47 AM UTC+12, Alan Evangelista wrote: > - Java forces everything to be implemented in OO model (classes) After you have spend a few months battering your head against the rigidity and verbosity of Java, you will run back to Python with a sense of relief. What a jo

Re: Beginner Question

2016-06-01 Thread Steven D'Aprano
On Thursday 02 June 2016 14:21, Igor Korot wrote: > Hi, guys, > > On Wed, Jun 1, 2016 at 9:42 PM, boB Stepp wrote: >> On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak >> wrote: >>> Hi to all >>> >>> I have a beginner question to which I have not found an answer I was able >>> to understand. Could so

Re: Beginner Question

2016-06-01 Thread Igor Korot
Hi, guys, On Wed, Jun 1, 2016 at 9:42 PM, boB Stepp wrote: > On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak > wrote: >> Hi to all >> >> I have a beginner question to which I have not found an answer I was able to >> understand. Could someone explain why the following program: >> >> def f(a, L=[])

Re: Beginner Question

2016-06-01 Thread Steven D'Aprano
On Thursday 02 June 2016 10:55, Marcin Rak wrote: > Hi to all > > I have a beginner question to which I have not found an answer I was able to > understand. Could someone explain why the following program: > > def f(a, L=[]): > L.append(a) > return L The default value is set once, and

Re: for / while else doesn't make sense

2016-06-01 Thread Steven D'Aprano
On Thursday 02 June 2016 09:39, Lawrence D’Oliveiro wrote: > Also, they let me declare a variable that is scoped to the loop Why do you want variables scoped to the loop? -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: Don't put your software in the public domain

2016-06-01 Thread Steven D'Aprano
On Thursday 02 June 2016 06:45, Lawrence D’Oliveiro wrote: > On Thursday, June 2, 2016 at 3:00:05 AM UTC+12, Steven D'Aprano wrote: >> ... because it is extremely unlikely to work. > > Which is why CC0 https://creativecommons.org/publicdomain/zero/1.0/ was > invented. Very true. The purpose of

Re: Don't put your software in the public domain

2016-06-01 Thread Steven D'Aprano
On Thursday 02 June 2016 07:00, John Wong wrote: > On Wed, Jun 1, 2016 at 4:45 PM, Lawrence D’Oliveiro > wrote: > >> On Thursday, June 2, 2016 at 3:00:05 AM UTC+12, Steven D'Aprano wrote: >> > ... because it is extremely unlikely to work. >> >> Which is why CC0 https://creativecommons.org/public

Re: reduction

2016-06-01 Thread Fillmore
Thank you, guys. Your suggestions are avaluable. I think I'll go with the tree On 05/31/2016 10:22 AM, Fillmore wrote: My problem. I have lists of substrings associated to values: ['a','b','c','g'] => 1 ['a','b','c','h'] => 1 ['a','b','c','i'] => 1 ['a','b','c','j'] => 1 ['a','b','c','k'] =>

Re: Beginner Question

2016-06-01 Thread boB Stepp
On Wed, Jun 1, 2016 at 7:55 PM, Marcin Rak wrote: > Hi to all > > I have a beginner question to which I have not found an answer I was able to > understand. Could someone explain why the following program: > > def f(a, L=[]): > L.append(a) > return L > > print(f(1)) > print(f(2)) > print

Beginner Question

2016-06-01 Thread Marcin Rak
Hi to all I have a beginner question to which I have not found an answer I was able to understand. Could someone explain why the following program: def f(a, L=[]): L.append(a) return L print(f(1)) print(f(2)) print(f(3)) gives us the following result: [1] [1,2] [1,2,3] How can this

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-06-01 Thread Lawrence D’Oliveiro
On Tuesday, May 31, 2016 at 10:14:31 PM UTC+12, qsh...@alumni.sjtu.edu.cn wrote: > PyGILState_Ensure/PyGILState_Release. Without a running sample, it is a > little bit hard to understand how Python thread and the native pthread > interact. Python threads *are* native threads (at least on Linux).

Re: How to create development Python environment on Linux.

2016-06-01 Thread Lawrence D’Oliveiro
On Tuesday, May 17, 2016 at 4:26:23 AM UTC+12, Zachary Ware wrote: > Not what you asked for, but I would encourage you to look into whether > it's possible for you to use Python 3 instead of Python 2 for what > you're doing. If it's possible, starting with Python 3 will save you > several headache

Re: for / while else doesn't make sense

2016-06-01 Thread Lawrence D’Oliveiro
On Friday, May 20, 2016 at 4:43:56 AM UTC+12, Herkermer Sherwood wrote: > Most keywords in Python make linguistic sense, but using "else" in for and > while structures is kludgy and misleading. My objection is not to the choice of keyword, it’s to the whole design of the loop construct. It turns

Re: reduction

2016-06-01 Thread Lawrence D’Oliveiro
On Thursday, June 2, 2016 at 10:07:21 AM UTC+12, MRAB wrote: > What is "this_list"? The main 'for' loop has "entry". Sorry. :) for entry in \ ( ['a','b','c','l'], ['a','b','c'], ) \ : flag = int(not any(m == "l" for m in entry)) ...

Re: reduction

2016-06-01 Thread MRAB
On 2016-06-01 22:44, Lawrence D’Oliveiro wrote: On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote: ['a','b','c','l'] => 0 # If "l" is in my data I have a zero ['a','b','c'] => 1 # or a more generic match will do the job for entry in \ ( ['a','b','c',

Re: reduction

2016-06-01 Thread Lawrence D’Oliveiro
On Wednesday, June 1, 2016 at 2:22:42 AM UTC+12, Fillmore wrote: > ['a','b','c','l'] => 0 # If "l" is in my data I have a zero > ['a','b','c'] => 1 # or a more generic match will do the job for entry in \ ( ['a','b','c','l'], ['a','b','c'], ) \

Yet Another Cairo API Binding

2016-06-01 Thread Lawrence D’Oliveiro
Thought I would mention Qahirah , which is yet another binding for the Cairo graphics library. People using Cairo with Python are probably familiar with Pycairo. Qahirah is similar to Pycairo in some ways, but differs importantly in sev

Re: Don't put your software in the public domain

2016-06-01 Thread John Wong
On Wed, Jun 1, 2016 at 4:45 PM, Lawrence D’Oliveiro wrote: > On Thursday, June 2, 2016 at 3:00:05 AM UTC+12, Steven D'Aprano wrote: > > ... because it is extremely unlikely to work. > > Which is why CC0 https://creativecommons.org/publicdomain/zero/1.0/ was > invented. > -- > This does not solve

Re: Don't put your software in the public domain

2016-06-01 Thread Lawrence D’Oliveiro
On Thursday, June 2, 2016 at 3:00:05 AM UTC+12, Steven D'Aprano wrote: > ... because it is extremely unlikely to work. Which is why CC0 https://creativecommons.org/publicdomain/zero/1.0/ was invented. -- https://mail.python.org/mailman/listinfo/python-list

Re: Self Learning Fortran Programming

2016-06-01 Thread Muhammad Ali
I don't know how to change the title now, but I am looking for python. -- https://mail.python.org/mailman/listinfo/python-list

Re: Efficient handling of fast, real-time hex data

2016-06-01 Thread jladasky
On Tuesday, May 31, 2016 at 9:37:18 PM UTC-7, Gregory Ewing wrote: > > So, how can I take the byte sequence <0x01 0x02 0x03 0x04 0x05 0x06 \n> that > > Serial.readline() returns to me, > > Using readline() to read binary data doesn't sound like > a good idea -- what happens if one of the data byte

Re: Self Learning Fortran Programming

2016-06-01 Thread Peter Pearson
On Tue, 31 May 2016 21:50:33 -0700 (PDT), Muhammad Ali wrote: > > I am interested in Python programming, [snip] Just out of curiosity, why do you seem to be confused about whether your interest is in FORTRAN or Python? -- To email me, substitute nowhere->runbox, invalid->com. -- https://mail.py

SQLObject 3.0.0

2016-06-01 Thread Oleg Broytman
Hello! I'm pleased to announce version 3.0.0, the first stable release of branch 3.0 of SQLObject. What's new in SQLObject === Features * Support for Python 2 and Python 3 with one codebase! (Python version >= 3.4 currently required.) Minor features

Breaking down network range to individual networks

2016-06-01 Thread Aaron Christensen
Hello, Does anyone know about a feature of ipaddress that will take the following network range: "10.224.16.0-10.224.23.0" and convert it to individual networks? I am trying to figure out the best way to take a network range and break it up into the largest possible networks. I started working

Re: Don't put your software in the public domain

2016-06-01 Thread Marko Rauhamaa
Steven D'Aprano : > ... because it is extremely unlikely to work. If you actually want > your users to be legally able to use your software without a > commercial licence, use a recognised open licence like the MIT > licence. Public domain dedications are on extremely shaky ground and > give your

Re: re.search - Pattern matching review

2016-06-01 Thread Ganesh Pal
Thanks works fine : ) -- https://mail.python.org/mailman/listinfo/python-list

Don't put your software in the public domain

2016-06-01 Thread Steven D'Aprano
... because it is extremely unlikely to work. If you actually want your users to be legally able to use your software without a commercial licence, use a recognised open licence like the MIT licence. Public domain dedications are on extremely shaky ground and give your users no protection. http://

Re: Recommendation for Object-Oriented systems to study

2016-06-01 Thread Terry Reedy
On 5/31/2016 1:52 PM, Ankush Thakur wrote: Hi Terry, Can you point me towards the source code? For IDLE 3.4.4 or 3.5.1: /Lib/idlelib/help.py, at least on Windows. > by "after reading it carefully", do you mean you or me? :D You. I wrote it and already read it carefully. Beyond "pick a m

Re: Self Learning Fortran Programming

2016-06-01 Thread Stephen Tucker
Hi, there, Muhammad, I have found Learning Python by Mark Lutz helpful. The fourth edition covers both Python 2.6 and 3.x. Although it is a text book for a course that Mark delivers, there are useful summaries of the various functions and methods for strings, integers, etc at various spots in the

Re: variable argument unpacking

2016-06-01 Thread Alexandre Paloschi Horta
The way you defined the function: def a(a = 1, b = 2, c = 3, *d, **e): print(a, b, c) print(d) print(e) a, b and c are positional arguments. d will be filled with the excess arguments and e will receive a dictionary, if supplied. One thing is the function definition, ano

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-06-01 Thread dieter
qshh...@alumni.sjtu.edu.cn writes: ... Python/C++ integration ... When I learn about a task to integrate Python with C or C++, I first think of "cython". "cython" facilitates those integrations. Especially, it has annotations to control the GIL. I have used "cython" for the implementation of a Py