No ‘from __future__ import print_function’ in latest jython

2015-06-21 Thread Cecil Westerhof
When I execute in the latest Jython: from __future__ import print_function I get: Traceback (innermost last): (no code object) at line 0 File "", line 1 SyntaxError: future feature print_function is not defined This is not implemented in the latest jython? I prefer to keep

Jython and can't write cache file

2015-06-21 Thread Cecil Westerhof
On openSUSE there is a very old version of Jython installed (2.2.1), so I installed the latest version (2.7.0). But when starting this I get: *sys-package-mgr*: can't write cache file for '/var/lib/h2/h2-1.3.176/bin/h2-1.3.176.jar' *sys-package-mgr*: can't write cache file for '/home/ceci

Re: Classic OOP in Python

2015-06-21 Thread Laura Creighton
Ah, turns out there was an entry. I updated it. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: How to construct matrix from vectors?

2015-06-21 Thread Mark Lawrence
On 21/06/2015 04:47, Nasser M. Abbasi wrote: But it is not as intuitive as with Matlab For those of us who don't know would you be kind enough to do a cost comparison of Matlab vs Python licenses? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for

How to check in script if Python or Jython is used

2015-06-21 Thread Cecil Westerhof
I installed Jython and will start playing with it. There probably will be differences between Python and Jython. Is there a way to determine if a script is run by Python or Jython? Then different execution paths could be taken. With sys.version(_info) you do not get this information. -- Cecil Wes

Using Jython for Android development?

2015-06-21 Thread Cecil Westerhof
I have no experience yet with Jython or Android development. But I was wondering: would it be possible to write applications for Android with Jython? You normally use Java for it, but I think I would like Jython more. :-D -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.c

Re: No ‘from __future__ import print_function’ in latest jython

2015-06-21 Thread Cecil Westerhof
On Sunday 21 Jun 2015 09:56 CEST, Cecil Westerhof wrote: > When I execute in the latest Jython: > from __future__ import print_function > I get: > Traceback (innermost last): > (no code object) at line 0 > File "", line 1 > SyntaxError: future feature print_function is not defined > > This is not

Re: How to construct matrix from vectors?

2015-06-21 Thread Fabien
On 06/21/2015 07:21 AM, Nasser M. Abbasi wrote: v1=np.array([(1,2,3)]).T v2=np.array([(4,5,6)]).T v3=np.array([(7,8,9)]).T v4=np.array([(10,11,12)]).T mat =np.hstack(( np.vstack((v1,v3)), np.vstack((v2,v4))) ) Out[236]: array([[ 1, 4], [ 2, 5], [ 3, 6], [ 7, 10],

Re: Jython and can't write cache file

2015-06-21 Thread Laura Creighton
In a message of Sun, 21 Jun 2015 09:53:23 +0200, Cecil Westerhof writes: >On openSUSE there is a very old version of Jython installed (2.2.1), >so I installed the latest version (2.7.0). But when starting this I >get: >*sys-package-mgr*: can't write cache file for > '/var/lib/h2/h2-1.3.176/bin

Re: No ‘from __future__ import print_function’ in latest jython

2015-06-21 Thread Laura Creighton
Do you have Jython 2.7 released a few weeks ago? Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-21 Thread Laura Creighton
In a message of Sat, 20 Jun 2015 19:50:21 -0700, Rustom Mody writes: >Here is Eric Snow: > >| Keep in mind that by "immutability" I'm talking about *really* >| immutable, perhaps going so far as treating the full memory space >| associated with an object as frozen. For instance, we'd have to >| en

Re: How to check in script if Python or Jython is used

2015-06-21 Thread Laura Creighton
In a message of Sun, 21 Jun 2015 10:12:06 +0200, Cecil Westerhof writes: >I installed Jython and will start playing with it. There probably will >be differences between Python and Jython. Is there a way to determine >if a script is run by Python or Jython? Then different execution paths >could be t

Re: Using Jython for Android development?

2015-06-21 Thread Laura Creighton
In a message of Sun, 21 Jun 2015 10:14:15 +0200, Cecil Westerhof writes: >I have no experience yet with Jython or Android development. But I was >wondering: would it be possible to write applications for Android with >Jython? You normally use Java for it, but I think I would like Jython >more. :-D

Re: HOPE: A Python just-in-time compiler for astrophysical computations

2015-06-21 Thread BartC
On 21/06/2015 01:29, Mark Lawrence wrote: Another beasty I've just stumbled across which you may find interesting http://www.sciencedirect.com/science/article/pii/S2213133714000687 Blimey, that's a lot of waffle in there, but I suppose that's to be expected from a published paper. I think th

Re: Jython and can't write cache file

2015-06-21 Thread Cecil Westerhof
On Sunday 21 Jun 2015 10:56 CEST, Laura Creighton wrote: > In a message of Sun, 21 Jun 2015 09:53:23 +0200, Cecil Westerhof > writes: >> On openSUSE there is a very old version of Jython installed >> (2.2.1), so I installed the latest version (2.7.0). But when >> starting this I get: *sys-package-

Re: Using Jython for Android development?

2015-06-21 Thread Cecil Westerhof
On Sunday 21 Jun 2015 11:26 CEST, Laura Creighton wrote: > In a message of Sun, 21 Jun 2015 10:14:15 +0200, Cecil Westerhof > writes: >> I have no experience yet with Jython or Android development. But I >> was wondering: would it be possible to write applications for >> Android with Jython? You n

Re: No ‘from __future__ import print_function’ in latest jython

2015-06-21 Thread Cecil Westerhof
On Sunday 21 Jun 2015 11:05 CEST, Laura Creighton wrote: > Do you have Jython 2.7 released a few weeks ago? Yes, but I was dumb enough to start the old version when I did this. :-( There is still one problem: == >>> from __futur

Re: How to check in script if Python or Jython is used

2015-06-21 Thread Cecil Westerhof
On Sunday 21 Jun 2015 11:22 CEST, Laura Creighton wrote: > In a message of Sun, 21 Jun 2015 10:12:06 +0200, Cecil Westerhof > writes: >> I installed Jython and will start playing with it. There probably >> will be differences between Python and Jython. Is there a way to >> determine if a script is

Re: No ‘from __future__ import print_function’ in latest jython

2015-06-21 Thread Laura Creighton
In a message of Sun, 21 Jun 2015 12:21:03 +0200, Cecil Westerhof writes: >On Sunday 21 Jun 2015 11:05 CEST, Laura Creighton wrote: > >> Do you have Jython 2.7 released a few weeks ago? > >Yes, but I was dumb enough to start the old version when I did this. >:-( > >There is still one problem: >=

Re: How to construct matrix from vectors?

2015-06-21 Thread Dave Farrance
Fabien wrote: >another solution with less "(([[]]))", and less ";". There are way too >many ";" in Matlab ;) > >import numpy as np >v1 = [1, 2, 3] >v2 = [4, 5, 6] >v3 = [7, 8, 9] >v4 = [10, 11, 12] >np.hstack([[v1, v2], [v3, v4]]).T >Out[]: >array([[ 1, 4], >[ 2, 5], >[ 3, 6],

Re: How to check in script if Python or Jython is used

2015-06-21 Thread Albert-Jan Roskam via Python-list
Sun, Jun 21, 2015 12:24 PM CEST Cecil Westerhof wrote: >On Sunday 21 Jun 2015 11:22 CEST, Laura Creighton wrote: > >> In a message of Sun, 21 Jun 2015 10:12:06 +0200, Cecil Westerhof >> writes: >> I installed Jython and will start playing with it. There probably >> will

Re: Jython and can't write cache file

2015-06-21 Thread Johannes Bauer
On 21.06.2015 11:40, Cecil Westerhof wrote: > Thanks. Good that I asked it. :-D Good for you that you found someone able to enter words into a Google query. That's a skill you might want to acquire some time in the future. Cheers, Johannes -- >> Wo hattest Du das Beben nochmal GENAU vorhergesa

Re: No ‘from __future__ import print_function’ in latest jython

2015-06-21 Thread Cecil Westerhof
On Sunday 21 Jun 2015 12:54 CEST, Laura Creighton wrote: > In a message of Sun, 21 Jun 2015 12:21:03 +0200, Cecil Westerhof > writes: >> On Sunday 21 Jun 2015 11:05 CEST, Laura Creighton wrote: >> >>> Do you have Jython 2.7 released a few weeks ago? >> >> Yes, but I was dumb enough to start the ol

Re: Lawful != Mutable (was Can Python function return multiple data?)

2015-06-21 Thread Ron Adam
On 06/20/2015 10:50 PM, Rustom Mody wrote: Here is Eric Snow: | Keep in mind that by "immutability" I'm talking about*really* | immutable, perhaps going so far as treating the full memory space | associated with an object as frozen. For instance, we'd have to | ensure that "immutable" Python

Re: HOPE: A Python just-in-time compiler for astrophysical computations

2015-06-21 Thread Laura Creighton
In a message of Sun, 21 Jun 2015 10:29:32 +0100, BartC writes: >It also puts in a good dig at PyPy by including one benchmark where it >is 6 times as slow as CPython! > >It's not clear why it's particularly useful for astrophysics. > >-- >Bartc It's not that good a dig, as they say that it took

Re: JSON Object to CSV file

2015-06-21 Thread sahluwalia
On Sunday, 21 June 2015 02:47:31 UTC-4, Denis McMahon wrote: > On Wed, 17 Jun 2015 08:00:11 -0700, Saran A wrote: > > > I would like to have this JSON object written out to a CSV file so that > > the keys are header fields (for each of the columns) and the values are > > values that are associate

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Sahlusar
On Sunday, 21 June 2015 02:54:48 UTC-4, Denis McMahon wrote: > On Thu, 18 Jun 2015 18:47:30 -0700, Sahlusar wrote: > > > I have a conundrum regarding JSON objects and converting them to CSV: > > I think your conundrum is that you've taken on a coding task beyond your > abilities to comprehend,

Re: JSON Object to CSV file

2015-06-21 Thread Sahlusar
On Sunday, June 21, 2015 at 2:47:31 AM UTC-4, Denis McMahon wrote: > On Wed, 17 Jun 2015 08:00:11 -0700, Saran A wrote: > > > I would like to have this JSON object written out to a CSV file so that > > the keys are header fields (for each of the columns) and the values are > > values that are asso

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Sahlusar
It is difficult to explain this to someone asynchronously and without an in person meeting. Moreover, the strict guidelines for disclosing information make it difficult for me to explain the client's requirements and the problems that they face. I do agree with you Denis that this is an uncon

Re: JSON Object to CSV file

2015-06-21 Thread Sahlusar
On Sunday, June 21, 2015 at 2:47:31 AM UTC-4, Denis McMahon wrote: > On Wed, 17 Jun 2015 08:00:11 -0700, Saran A wrote: > > > I would like to have this JSON object written out to a CSV file so that > > the keys are header fields (for each of the columns) and the values are > > values that are asso

Re: JSON Object to CSV file

2015-06-21 Thread Ned Batchelder
On Sunday, June 21, 2015 at 10:54:44 AM UTC-4, Sahlusar wrote: > This is a duplicate to the post titled: JSON to CSV Troubleshooting: Please don't do that. --Ned. -- https://mail.python.org/mailman/listinfo/python-list

Re: JSON Object to CSV file

2015-06-21 Thread Sahlusar
On Sunday, 21 June 2015 11:31:44 UTC-4, Ned Batchelder wrote: > On Sunday, June 21, 2015 at 10:54:44 AM UTC-4, Sahlusar wrote: > > > This is a duplicate to the post titled: JSON to CSV Troubleshooting: > > Please don't do that. > > --Ned. My apologies - is it possible to delete one of my posts

Re: How to construct matrix from vectors?

2015-06-21 Thread lanuradha
On Sunday, 21 June 2015 20:43:15 UTC+5:30, Dennis Lee Bieber wrote: > On Sun, 21 Jun 2015 09:32:55 +0100, Mark Lawrence declaimed the following: > > >On 21/06/2015 04:47, Nasser M. Abbasi wrote: > > > >> > >> But it is not as intuitive as with Matlab > >> > > > >For those of us who don't know wou

Re: How to check in script if Python or Jython is used

2015-06-21 Thread Thomas 'PointedEars' Lahn
Cecil Westerhof wrote: > I installed Jython and will start playing with it. There probably will > be differences between Python and Jython. Is there a way to determine > if a script is run by Python or Jython? Then different execution paths > could be taken. With sys.version(_info) you do not get

Python functionality in Javascript

2015-06-21 Thread jonas . thornvall
Check this out using a 8 digit base with a 100 digit number no problem. http://jt.node365.se/baseconversion3.html -- https://mail.python.org/mailman/listinfo/python-list

Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread C.D. Reimer
Greetings, I'm in the process of converting 101 old BASIC games into Python (see link below). http://www.atariarchives.org/basicgames/ The short term goal is to learn the finer aspects of the Python language and reliving my misbegotten past on the Commodore 64. The long term goal is to use

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Laura Creighton
In a message of Sun, 21 Jun 2015 12:32:46 -0700, "C.D. Reimer" writes: >Do I need to release my scripts under a license? If so, which one? You should, because if you don't you could pop up some day and assert copyright and sue the hell out of people who use your code, which means that many people

Re: Catching exceptions with multi-processing

2015-06-21 Thread Paul Rubin
Fabien writes: > I am developing a tool which works on individual entities (glaciers) > and do a lot of operations on them. There are many tasks to do, one > after each other, and each task follows the same interface: ... If most of the resources will be spent on computation and the communication

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread C.D. Reimer
On 6/21/2015 1:00 PM, Laura Creighton wrote: In a message of Sun, 21 Jun 2015 12:32:46 -0700, "C.D. Reimer" writes: Do I need to release my scripts under a license? If so, which one? You should, because if you don't you could pop up some day and assert copyright and sue the hell out of people

Re: JSON Object to CSV file

2015-06-21 Thread Denis McMahon
On Sun, 21 Jun 2015 06:57:01 -0700, sahluwalia wrote: > On Sunday, 21 June 2015 02:47:31 UTC-4, Denis McMahon wrote: >> On Wed, 17 Jun 2015 08:00:11 -0700, Saran A wrote: >> >> > I would like to have this JSON object written out to a CSV file so >> > that the keys are header fields (for each of

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Marko Rauhamaa
Laura Creighton : > In a message of Sun, 21 Jun 2015 12:32:46 -0700, "C.D. Reimer" writes: > >>Do I need to release my scripts under a license? If so, which one? > > You should, because if you don't you could pop up some day and assert > copyright and sue the hell out of people who use your code,

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Denis McMahon
On Sun, 21 Jun 2015 07:38:13 -0700, Sahlusar wrote: > It is difficult to explain this to someone asynchronously and without an > in person meeting. Moreover, the strict guidelines for disclosing > information make it difficult for me to explain the client's > requirements and the problems that the

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Michael Torrie
On 06/21/2015 02:58 PM, Marko Rauhamaa wrote: > Laura Creighton : > >> In a message of Sun, 21 Jun 2015 12:32:46 -0700, "C.D. Reimer" writes: >> >>> Do I need to release my scripts under a license? If so, which one? >> >> You should, because if you don't you could pop up some day and assert >> cop

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread C.D. Reimer
On 6/21/2015 1:58 PM, Marko Rauhamaa wrote: Converting BASIC games to Python results in derived works, which are under the original copyright of the BASIC games. From the given link: BASIC Computer Games is copyright © 1978 by David H. Ahl, and is posted on www.atariarchives.org with

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Joonas Liik
On 21 June 2015 at 17:38, Sahlusar wrote: > > [snip] > I do agree with you Denis that this is an unconventional approach. I was > wondering then that perhaps I should add additional functionality at the XML > to JSON step? So far, with JSON objects without nested lists (as values) I > have been

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Marko Rauhamaa
"C.D. Reimer" : > Using the video output from the BASIC games in the book could fall > underneath the fair use provision, which allows me to use a small > portion of the book without infringing on the copyright. I'm not > publishing a book. I just want to put my code on a website as an > education

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Michael Torrie
On 06/21/2015 03:52 PM, C.D. Reimer wrote: > The copyright applies to the book ("Do not redistribute, mirror, or copy > this *online book*.") and any derivative work is based on the book. > Using the video output from the BASIC games in the book could fall > underneath the fair use provision, wh

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Marko Rauhamaa
Michael Torrie : > On 06/21/2015 02:58 PM, Marko Rauhamaa wrote: >> Converting BASIC games to Python results in derived works, which are >> under the original copyright of the BASIC games. >> >> [...] > > I disagree. Especially where the resulting python program is not a > transliteration (which

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Mark Lawrence
On 21/06/2015 22:52, C.D. Reimer wrote: On 6/21/2015 1:58 PM, Marko Rauhamaa wrote: Converting BASIC games to Python results in derived works, which are under the original copyright of the BASIC games. From the given link: BASIC Computer Games is copyright © 1978 by David H. Ahl, and is

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Denis McMahon
On Mon, 22 Jun 2015 00:55:11 +0300, Joonas Liik wrote: > In xml for instance this is valid: > > 1 > > .. and so is this: > > 1 2 > What the OP needs to do is sit down with the XML and work out how it needs to be represented in CSV terms, and then code that transformation, but it appears

Re: JSON Object to CSV file

2015-06-21 Thread Sahlusar
On Sunday, June 21, 2015 at 4:54:27 PM UTC-4, Denis McMahon wrote: > On Sun, 21 Jun 2015 06:57:01 -0700, sahluwalia wrote: > > > On Sunday, 21 June 2015 02:47:31 UTC-4, Denis McMahon wrote: > >> On Wed, 17 Jun 2015 08:00:11 -0700, Saran A wrote: > >> > >> > I would like to have this JSON object

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Sahlusar
On Sunday, June 21, 2015 at 5:56:00 PM UTC-4, Waffle wrote: > On 21 June 2015 at 17:38, Sahlusar wrote: > > > > [snip] > > I do agree with you Denis that this is an unconventional approach. I was > > wondering then that perhaps I should add additional functionality at the > > XML to JSON step? S

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread C.D. Reimer
On 6/21/2015 3:02 PM, Marko Rauhamaa wrote: As they say, tell that to the judge. More than likely, the original copyright owner can issue an DMCA take down notice and that will be end of that. Thanks, Chris R. -- https://mail.python.org/mailman/listinfo/python-list

Re: JSON Object to CSV File Troubleshooting

2015-06-21 Thread Sahlusar
On Sunday, June 21, 2015 at 7:34:47 PM UTC-4, Denis McMahon wrote: > On Mon, 22 Jun 2015 00:55:11 +0300, Joonas Liik wrote: > > > In xml for instance this is valid: > > > > > 1 > > > > .. and so is this: > > > > 1 2 > > > > What the OP needs to do is sit down with the XML and work out how

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Chris Angelico
On Mon, Jun 22, 2015 at 9:54 AM, C.D. Reimer wrote: > On 6/21/2015 3:02 PM, Marko Rauhamaa wrote: >> >> As they say, tell that to the judge. > > > More than likely, the original copyright owner can issue an DMCA take down > notice and that will be end of that. Or, alternatively, the original copy

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Steven D'Aprano
On Mon, 22 Jun 2015 09:54 am, C.D. Reimer wrote: > On 6/21/2015 3:02 PM, Marko Rauhamaa wrote: >> As they say, tell that to the judge. > > More than likely, the original copyright owner can issue an DMCA take > down notice and that will be end of that. The way the DMCA is implemented in practice

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Steven D'Aprano
On Mon, 22 Jun 2015 07:28 am, Michael Torrie wrote: > As to the question of assigning a copyright license to code, in this > case I suggest just releasing the code marked as public domain. Public domain is not a licence, and many places (including the US) do not allow individuals to put works int

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Michael Torrie
On 06/21/2015 08:27 PM, Steven D'Aprano wrote: > Public domain is not a licence, and many places (including the US) do not > allow individuals to put works into the public domain. (US government works > are a special case.) Some places will not recognise a public domain > dedication, and will treat

Re: Do I need license to release the Python version of old BASIC games?

2015-06-21 Thread Chris Angelico
On Mon, Jun 22, 2015 at 2:23 PM, Michael Torrie wrote: > From some brief research, it appears there is some question about the > ability to declare something to be in the public domain, but it is by no > means a sure thing and lots of people feel it's just fine to declare > something to be in the