pyinstaller not finding external fortran executable

2018-01-19 Thread Heli
Dear all, My code consists of a graphical user interface written in PySide. This GUI will then call a FORTRAN executable. I run the FORTRAN executable using the following lines in my script: curPath = os.path.dirname(os.path.realpath(__file__)) execPath = os.path.join(curPath, "myFORTRA

Re: python to call or start a fortran a.out

2017-08-22 Thread Rick Johnson
On Monday, August 21, 2017 at 11:31:48 AM UTC-5, Chet Buell wrote: > Need some help with updating python to call or start a > fortran a.out executable The problem I am having is I have > an old Fortran based model that I need to run, in the past > the fortran was triggered through t

Re: python to call or start a fortran a.out

2017-08-21 Thread Peter Otten
Chet Buell wrote: > Need some help with updating python to call or start a fortran a.out > executable > > The problem I am having is I have an old Fortran based model that I need > to run, in the past the fortran was triggered through the following > python code: >

Re: python to call or start a fortran a.out

2017-08-21 Thread Grant Edwards
On 2017-08-21, Chet Buell wrote: > Need some help with updating python to call or start a fortran a.out > executable > > The problem I am having is I have an old Fortran based model that I need > to run, in the past the fortran was triggered through the following > pyt

python to call or start a fortran a.out

2017-08-21 Thread Chet Buell
Need some help with updating python to call or start a fortran a.out executable The problem I am having is I have an old Fortran based model that I need to run, in the past the fortran was triggered through the following python code: #run fortran x = commands.getoutput(path+'/a.out

Re: Reading Fortran Ascii output using python

2016-11-03 Thread Heli
me line such as > >> > line 3, python seems to read this using two reads. This makes the above > >> > example will be read like this: > >> > > >> > line 1: 1 > >> > line 2: 1000.834739 2000.38473 3000.349798 > >> > line 3: 1000 2000

Re: Reading Fortran Ascii output using python

2016-10-31 Thread MRAB
n the same line such as line 3, python seems to read this using two reads. This makes the above example will be read like this: > > line 1: 1 > line 2: 1000.834739 2000.38473 3000.349798 > line 3: 1000 2000 5000.69394 > line 4: 99934.374638 54646.9784 > > How can I fix this for eac

Re: Reading Fortran Ascii output using python

2016-10-31 Thread Irmen de Jong
On 31-10-2016 19:24, Irmen de Jong wrote: > So there must be something in that line in your file that it considers an EOF. I meant to type EOL there. (end-of-line/newline). Irmen -- https://mail.python.org/mailman/listinfo/python-list

Re: Reading Fortran Ascii output using python

2016-10-31 Thread Irmen de Jong
On 31-10-2016 18:46, Heli wrote: > Thanks Irmen, > > I tried with "rU" but that did not make a difference. The problem is a line > that with one single write statement in my fortran code : > > write(UNIT=9,FMT="(99g20.8)") value > > seems

Re: Reading Fortran Ascii output using python

2016-10-31 Thread Heli
gt; The problem is when I have more than 3 numbers on the same line such as > > line 3, python seems to read this using two reads. This makes the above > > example will be read like this: > > > > line 1: 1 > > line 2: 1000.834739 2000.38473 3000.349798 > > lin

Re: Reading Fortran Ascii output using python

2016-10-31 Thread Irmen de Jong
s the above example > will be read like this: > > line 1: 1 > line 2: 1000.834739 2000.38473 3000.349798 > line 3: 1000 2000 5000.69394 > line 4: 99934.374638 54646.9784 > > How can I fix this for each fortran line to be read correctly using python? > > Thanks in Advance

Reading Fortran Ascii output using python

2016-10-31 Thread Heli
5000.69394 line 4: 99934.374638 54646.9784 How can I fix this for each fortran line to be read correctly using python? Thanks in Advance for your help, -- 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: 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->co

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: Self Learning Fortran Programming

2016-05-31 Thread Joel Goldstick
start here: https://www.python.org/about/gettingstarted/ On Wed, Jun 1, 2016 at 12:50 AM, Muhammad Ali wrote: > > Hello, > > I am interested in Python programming, however, it will be my first serious > attempt towards coding/simulation/programming. My back ground is Physics, no > practical e

Self Learning Fortran Programming

2016-05-31 Thread Muhammad Ali
Hello, I am interested in Python programming, however, it will be my first serious attempt towards coding/simulation/programming. My back ground is Physics, no practical experience with programming languages. So, this post is for the valuable suggestions from the experts that how can I star

Re: Python and fortran Interface suggestion

2015-04-22 Thread edmondo . giovannozzi
Il giorno domenica 19 aprile 2015 22:26:58 UTC+2, Dave Angel ha scritto: > On 04/19/2015 11:56 AM, pauld11718 wrote: > > I shall provide with further details > > > > Its about Mathematical modelling of a system. Fortran does one part and > > python does the other

Re: Python and fortran Interface suggestion

2015-04-19 Thread Dave Angel
On 04/19/2015 11:56 AM, pauld11718 wrote: I shall provide with further details Its about Mathematical modelling of a system. Fortran does one part and python does the other part (which I am suppose to provide). For a time interval tn --> t_n+1, fortran code generates some values, for wh

Re: Python and fortran Interface suggestion

2015-04-19 Thread pauld11718
I shall provide with further details Its about Mathematical modelling of a system. Fortran does one part and python does the other part (which I am suppose to provide). For a time interval tn --> t_n+1, fortran code generates some values, for which my python code accepts it as an input.

Re: Python and fortran Interface suggestion

2015-04-19 Thread Chris Angelico
On Mon, Apr 20, 2015 at 12:48 AM, pauld11718 wrote: > I am developing a code under Ubuntu(64bit) with python using various > libraries. Once done, I need to generate an executable which shall be > interfaced with fortran program on account of further collaboration. The > pytho

Python and fortran Interface suggestion

2015-04-19 Thread pauld11718
I am developing a code under Ubuntu(64bit) with python using various libraries. Once done, I need to generate an executable which shall be interfaced with fortran program on account of further collaboration. The python executable shall be used with windows(32bit). So, I guess everytime my

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Chris Angelico
On Tue, Feb 3, 2015 at 5:34 AM, Mark Lawrence wrote: > On 02/02/2015 17:25, Chris Angelico wrote: >> >> On Tue, Feb 3, 2015 at 3:52 AM, Mark Lawrence >> wrote: >>> >>> I'd like to see anybody define 'a' and 'the' without using 'a' and 'the'. >>> Would that be formally rigorous or rigorously forma

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Michael Torrie : > Fair enough. You raise good points. I am not taking it personally; your > emails, lacking emotional context, just seemed a bit unnecessarily > argumentative. For example, "The cherry on top: "_1"! The C++ compiler > figures out template types heroically but can't wrap its head

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 17:25, Chris Angelico wrote: On Tue, Feb 3, 2015 at 3:52 AM, Mark Lawrence wrote: I'd like to see anybody define 'a' and 'the' without using 'a' and 'the'. Would that be formally rigorous or rigorously formal? a: Indefinite article, used to represent individual objects not other

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Michael Torrie
On 02/02/2015 10:57 AM, Marko Rauhamaa wrote: > I really don't understand why you are taking all of this so personally. > We are just discussing different aspects of different programming > languages. Fair enough. You raise good points. I am not taking it personally; your emails, lacking emotiona

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Michael Torrie : > You have no intention of being impressed with C++, let alone simply > learn about it. I am fully open to being impressed. I have more than a decade of C++ programming under my belt, although not much for the past few years. > There's no possible way for the compiler to know th

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Chris Angelico
On Tue, Feb 3, 2015 at 3:52 AM, Mark Lawrence wrote: > I'd like to see anybody define 'a' and 'the' without using 'a' and 'the'. > Would that be formally rigorous or rigorously formal? a: Indefinite article, used to represent individual objects not otherwise identifiable. the: Definite article,

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 16:21, Rustom Mody wrote: On Monday, February 2, 2015 at 9:40:35 PM UTC+5:30, Mark Lawrence wrote: On 02/02/2015 08:52, Marko Rauhamaa wrote: Chris Angelico : On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: And there are underspecified rules too. What is the plural of o

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Michael Torrie
On 02/02/2015 12:39 AM, Marko Rauhamaa wrote: > Michael Torrie : > >> http://en.cppreference.com/w/cpp/utility/functional/function >> >> Thus if we were to shoehorn your example into C++, the result would be >> idiomatically very similar to what you have in your Python code. > > I can understand

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Rustom Mody
On Monday, February 2, 2015 at 9:40:35 PM UTC+5:30, Mark Lawrence wrote: > On 02/02/2015 08:52, Marko Rauhamaa wrote: > > Chris Angelico : > > > >> On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: > >>> And there are underspecified rules too. What is the plural of octopus? No > >>> fair look

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 08:52, Marko Rauhamaa wrote: Chris Angelico : On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard and well-known piece of trivia, and there are several

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 04:47, Chris Angelico wrote: On Mon, Feb 2, 2015 at 3:14 PM, Roy Smith wrote: In article <54ceda0b$0$12977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: What is the plural of octopus? It's a trick question. Octopus is already plural. Monopus is singular. P

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread beliavsky
ry-management > abstractions built in. Lots of people are using C++ to build packages for statistical programming language R, using the package Rcpp. It has been possible to build such packages for R and S using Fortran and C since the beginning, and many have done so, but the wide usage of

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Paul Rudin : > Marko Rauhamaa writes: >> Your brain's grammar engine will give you the correct answer. It may >> not match your English teacher's answer, but the language we are >> talking about is not standard English but the dialect you have >> acquired in childhood. > > Aha - the Humpty Dumpty

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Paul Rudin
Marko Rauhamaa writes: > Chris Angelico : > >> On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano >> wrote: >>> And there are underspecified rules too. What is the plural of octopus? No >>> fair looking it up in the dictionary. >> >> Standard and well-known piece of trivia, and there are several >

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Chris Angelico : > On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano > wrote: >> And there are underspecified rules too. What is the plural of octopus? No >> fair looking it up in the dictionary. > > Standard and well-known piece of trivia, and there are several > options. "Octopodes" is one of th

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Steven D'Aprano : > Steven D'Aprano wrote: >> Of course people make grammar mistakes that they don't spot. > > Ironically, this is one of them. It should of course be "grammatical > mistakes". I don't believe you made a mistake according to your brain's grammar engine. Parenthetically, I don't b

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Michael Torrie : > http://en.cppreference.com/w/cpp/utility/functional/function > > Thus if we were to shoehorn your example into C++, the result would be > idiomatically very similar to what you have in your Python code. I can understand why you wouldn't write out my example in C++: using st

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Chris Angelico wrote: > On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano > wrote: >> And there are underspecified rules too. What is the plural of octopus? No >> fair looking it up in the dictionary. > > Standard and well-known piece of trivia, and there are several > options. "Octopodes" is one

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Chris Angelico
On Mon, Feb 2, 2015 at 3:14 PM, Roy Smith wrote: > In article <54ceda0b$0$12977$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> What is the plural of octopus? > > It's a trick question. Octopus is already plural. Monopus is singular. People is already plural, too, but you c

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Roy Smith
In article <54ceda0b$0$12977$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > What is the plural of octopus? It's a trick question. Octopus is already plural. Monopus is singular. -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Feb 2, 2015 at 1:35 PM, Matthew Barnett > wrote: > > And the plural of "virus" is "viruses", not "viri" (that's the plural of > > "vir") or "virii" (that would be the plural of "virius", if it existed). > > Yes indeed."Virii" and "octopi" are as wro

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Chris Angelico
On Mon, Feb 2, 2015 at 1:35 PM, Matthew Barnett wrote: > And the plural of "virus" is "viruses", not "viri" (that's the plural of > "vir") or "virii" (that would be the plural of "virius", if it existed). Yes indeed."Virii" and "octopi" are as wrong as "hice" for "houses" (paralleling mice). Chr

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Matthew Barnett
On 2015-02-02 02:04, Chris Angelico wrote: On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard and well-known piece of trivia, and there are several options. "Octopodes

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Steven D'Aprano wrote: > Of course people make grammar mistakes that they don't spot. Ironically, this is one of them. It should of course be "grammatical mistakes". Seriously, I didn't do that on purpose. I only noticed the error on reading it back after sending. -- Steven -- https://mail

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Chris Angelico
On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: > And there are underspecified rules too. What is the plural of octopus? No > fair looking it up in the dictionary. Standard and well-known piece of trivia, and there are several options. "Octopodes" is one of the most rigorously formal, but

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Steven D'Aprano : > >> Marko Rauhamaa wrote: >> >>> The natural language has a rigorous grammar plus a lexicon that includes >>> a number of idioms. Nobody has so far been able to codify a natural >>> language completely because the rigorous grammar consists of maybe >>> 1

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Michael Torrie
On 02/01/2015 05:50 PM, Michael Torrie wrote: > Honestly with the C++ standard library implementing std::function and > std::bind macros, idiomatically it would look very much similar to the > Python code you showed. Make that templates, not macros. -- https://mail.python.org/mailman/listinfo/py

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Michael Torrie
On 02/01/2015 12:12 PM, Marko Rauhamaa wrote: > So please implement this small piece of Python code in C++ so we can > compare the idioms: So I though I might just for kicks code up a C++ version. In doing so, I realized that idomatically, this particular example would not really use callbacks in

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Michael Torrie
On 02/01/2015 12:12 PM, Marko Rauhamaa wrote: > Christian Gollwitzer : > >> Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: >>> Qt gave up on C++ when it comes to callbacks ("signals") and went for >>> an apocryphal metacompiler. >> >> Yes, but only because C++ compilers were not good enough when QT

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Christian Gollwitzer : > Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: >> Qt gave up on C++ when it comes to callbacks ("signals") and went for >> an apocryphal metacompiler. > > Yes, but only because C++ compilers were not good enough when QT came > out, and later is was too late to change it to a

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Steven D'Aprano : > Marko Rauhamaa wrote: > >> The natural language has a rigorous grammar plus a lexicon that includes >> a number of idioms. Nobody has so far been able to codify a natural >> language completely because the rigorous grammar consists of maybe >> 10,000 rules. > > If nobody has co

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Marko Rauhamaa wrote: > The natural language has a rigorous grammar plus a lexicon that includes > a number of idioms. Nobody has so far been able to codify a natural > language completely because the rigorous grammar consists of maybe > 10,000 rules. If nobody has codified the rigorous grammar,

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Christian Gollwitzer
Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: > Paul Rubin : > >> Marko Rauhamaa writes: >>> Stroustrup apparently has never had to deal with callbacks; his thick >>> books never made a mention of them last time I checked. >> >> C++ has function pointers just like C, > > Et tu, Brute! > > C's ca

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Paul Rubin : > Marko Rauhamaa writes: >> Stroustrup apparently has never had to deal with callbacks; his thick >> books never made a mention of them last time I checked. > > C++ has function pointers just like C, Et tu, Brute! C's callbacks always use a void pointer for the "self reference." In

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Marko Rauhamaa
Rustom Mody : > There is a real conflict between the logician's goal and the > educator's. The logician wants to minimize the variety of ideas, > and doesn't mind a long, thin path. The educator (rightly) wants > to make the paths short and doesn't mind–in fact, > prefers–connections to many other

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Paul Rubin
Marko Rauhamaa writes: > The guiding principle in C++ language development is to take static > type safety to the extreme. Heh, try Ada. > Stroustrup apparently has never had to deal with callbacks; his thick > books never made a mention of them last time I checked. C++ has function pointers

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-31 Thread Devin Jeanpierre
On Fri, Jan 30, 2015 at 1:28 PM, Sturla Molden wrote: > in Python. It actually corresponds to > > with Foo() as bar: > The problem with with statements is that they only handle the case of RAII with stack allocated variables, and can't handle transfer of ownership cleanly. Consider the case

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-31 Thread Chris Angelico
On Sun, Feb 1, 2015 at 2:00 PM, Steven D'Aprano wrote: >> A C++ statement with RAII like >> >> { >>Foo bar(); >>// suite >> } >> >> is not equivalent to >> >> bar = Foo() >> >> in Python. It actually corresponds to >> >> with Foo() as bar: >> > > > Nice answer! I'm not qualified t

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-31 Thread Steven D'Aprano
Sturla Molden wrote: > Rustom Mody wrote: > >> The case of RAII vs gc is hardly conclusive: >> >> http://stackoverflow.com/questions/228620/garbage-collection-in-c-why > > The purpose of RAII is not to be an alternative to garbage collection > (which the those answers imply), but to ensure de

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 11:13:29 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody: > > > On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: > >> Esthetically, I'm most impressed with Scheme. One day it might give > >> Python a run for its money. > > > > Aren't you

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Steven D'Aprano
Marko Rauhamaa wrote: > I'm most impressed with Scheme. One day it might give > Python a run for its money. Scheme is forty years old, having come out in 1975. Python is 24 years old, having come out in 1991. If Scheme hasn't caught up with Python by now, it never will. -- Steven -- https:/

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Mark Lawrence
On 31/01/2015 15:50, Rustom Mody wrote: On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: Esthetically, I'm most impressed with Scheme. One day it might give Python a run for its money. Marko Aren't you getting this backwards? http://www.wisdomandwonder.com/link/21

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Marko Rauhamaa
Rustom Mody : > On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: >> Esthetically, I'm most impressed with Scheme. One day it might give >> Python a run for its money. > > Aren't you getting this backwards? Deep down I'm a minimalist romantic. > Its just that its 2015 n

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 4:34:14 PM UTC+5:30, Steven D'Aprano wrote: > > Yesterday, as I wrote that message, my web browser crashed *eight times* in > a matter of half an hour. There are thousands of serious security > vulnerabilities due to mishandled pointers. Anyone who thinks that Linu

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: > Esthetically, I'm most impressed with Scheme. One day it might give > Python a run for its money. > > > Marko Aren't you getting this backwards? http://www.wisdomandwonder.com/link/2110/why-mit-switched-from-scheme-to

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Marko Rauhamaa
Gregory Ewing : > I'm completely convinced nowadays that there is *no* use case for C++. While I wouldn't go quite that far (my most recent creation was written in C++; why? because the legacy support libraries were written in C++). However, C++ is like putting lipstick on a pig. In fact, C++ ha

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Steven D'Aprano
ouldn't write a kernel > in it without providing it with some sort of unsafe memory access > (pointers!). Or even write a Python interpreter (Yes there's PyPy, but > with a jit it's still working with pointers). Systems languages now are, in a sense, in the same position t

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Christian Gollwitzer
Am 30.01.15 um 19:23 schrieb Paul Rubin: > Michael Torrie writes: >> Follow basic [C++] rules and 99% of segfaults will never happen and >> the majority of leaks will not happen either. > > That is a safe and simple approach, but it works by copying data all > over the place instead of passing po

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 04:50 PM, Steven D'Aprano wrote: > Oh great. So if the average application creates a hundred thousand pointers > of the course of a session, you'll only have a thousand or so seg faults > and leaks. > > Well, that certainly explains this: > > https://access.redhat.com/articles/13322

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 04:12 PM, Sturla Molden wrote: > Michael Torrie wrote: > >> Yes I can tell you haven't used C++. Compared to C, I've always found >> memory management in C++ to be quite a lot easier. The main reason is >> that C++ guarantees objects will be destroyed when going out of scope. >> S

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Steven D'Aprano
Michael Torrie wrote: > If that happened, then it's because you the programmer wanted it to > happen.  It's not just going to happen all by itself.  Yes anytime > pointers are allowed, things are potentially unsafe in the hands of a > programmer.  I'm just saying it's not nearly so bad as you make

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Steven D'Aprano
Gregory Ewing wrote: > I'm completely convinced nowadays that there is > no use case for C++. I can think of one use-case for C++. You walk up to somebody in the street, say "I wrote my own C++ parser!", and while they are gibbering and shaking in shock, you rifle through their pockets and stea

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Sturla Molden
Michael Torrie wrote: > Yes I can tell you haven't used C++. Compared to C, I've always found > memory management in C++ to be quite a lot easier. The main reason is > that C++ guarantees objects will be destroyed when going out of scope. > So when designing a class, you put any allocation rout

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Gregory Ewing
Michael Torrie wrote: On 01/30/2015 10:31 AM, Rustom Mody wrote: And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. I'd say it's what higher-level languages are for. :-) I'm completely convinced nowadays that there is *no* use case for

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-30 Thread Sturla Molden
Rustom Mody wrote: > The case of RAII vs gc is hardly conclusive: > > http://stackoverflow.com/questions/228620/garbage-collection-in-c-why The purpose of RAII is not to be an alternative to garbage collection (which the those answers imply), but to ensure deterministc execution of setup and t

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Paul Rubin
Michael Torrie writes: > Follow basic [C++] rules and 99% of segfaults will never happen and > the majority of leaks will not happen either. That is a safe and simple approach, but it works by copying data all over the place instead of passing pointers, resulting in performance loss. Alex Martel

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 10:31 AM, Rustom Mody wrote: > And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. > You say just use copy constructors and no pointers. > Can you (ie C++) guarantee that no pointer is ever copied out of > scope of these copy-co

RAII vs gc (was fortran lib which provide python like data type)

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 11:01:50 PM UTC+5:30, Rustom Mody wrote: > On Friday, January 30, 2015 at 10:39:12 PM UTC+5:30, Michael Torrie wrote: > > On 01/30/2015 09:27 AM, Rustom Mody wrote: > > > ... if I restate that in other words it says that sufficiently > > > complex data structures will

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 10:39:12 PM UTC+5:30, Michael Torrie wrote: > On 01/30/2015 09:27 AM, Rustom Mody wrote: > > ... if I restate that in other words it says that sufficiently > > complex data structures will be beyond the reach of the standard > > RAII infrastructure. > > > > Of course

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 09:27 AM, Rustom Mody wrote: > ... if I restate that in other words it says that sufficiently > complex data structures will be beyond the reach of the standard > RAII infrastructure. > > Of course this only brings up one side of memory-mgmt problems > viz. unreclaimable memory. > >

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 1:03:03 PM UTC+5:30, Christian Gollwitzer wrote: > Am 30.01.15 um 02:40 schrieb Rustom Mody: > > FORTRAN > > > > use dictionary > > type(dictionary), pointer :: d > > d=>dict_new() > > call set(d//'toto',1) &g

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Christian Gollwitzer
Am 30.01.15 um 02:40 schrieb Rustom Mody: > FORTRAN > > use dictionary > type(dictionary), pointer :: d > d=>dict_new() > call set(d//'toto',1) > v = d//'toto' > call dict_free(d) > > The corresponding python > > d = dict() >

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Rustom Mody
On Friday, January 30, 2015 at 4:09:19 AM UTC+5:30, beli...@aol.com wrote: > On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: > > Hi, > > I am not sure here is the right place to ask this question, but I want to > > give it a shot:) > > are t

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread beliavsky
On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: > Hi, > I am not sure here is the right place to ask this question, but I want to > give it a shot:) > are there fortran libs providing python like data type, such as set, dict, > list? > Thanks, >

[OT] fortran lib which provide python like data type

2015-01-29 Thread 1989lzhh
Hi, I am not sure here is the right place to ask this question, but I want to give it a shot:) are there fortran libs providing python like data type, such as set, dict, list? Thanks, Yours liuzhenhai -- https://mail.python.org/mailman/listinfo/python-list

Re: Interfacing Fortran applications

2014-06-10 Thread alister
On Mon, 09 Jun 2014 14:24:07 +0200, Michael Welle wrote: > Hello, > > Sturla Molden writes: > >> Michael Welle wrote: >> >>> I thought about equipping the Fortran application with sockets, so >>> that I can send input data and commands (which is now

Re: Interfacing Fortran applications

2014-06-09 Thread Sturla Molden
On 09/06/14 14:24, Michael Welle wrote: >> If you are to rewrite the Fortran app you can just as well use f2py from >> NumPy. > a rewrite of the application isn't possible. That would require > knowledge about what the used algorithms are, why they are implemented &g

Re: Interfacing Fortran applications

2014-06-09 Thread Chris Angelico
possibly you could turn the whole thing into a C-callable library, although I've no idea how easy it is to do that. (My experience with FORTRAN - yes, not Fortran, the code was that old - goes as far as eyeballing some of IBM's DB2 examples and translating them into REXX. I've never

Re: Interfacing Fortran applications

2014-06-09 Thread Sturla Molden
Michael Welle wrote: > I thought about equipping the Fortran application with sockets, so that > I can send input data and commands (which is now done via cmd line) and > reading output data back. Any opinions on this? Best pratices? If you are to rewrite the Fortran app you can jus

Re: Interfacing Fortran applications

2014-06-09 Thread Chris Angelico
On Mon, Jun 9, 2014 at 5:43 PM, Michael Welle wrote: > I want to build a Python based user interface for an existing Fortran > application (as everyone wants to do ;)). Lets assume the application is > parametrised via cmdline parameters and it calculates tons of numbers > that have t

Re: Fortran

2014-05-29 Thread Marko Rauhamaa
Steven D'Aprano : > You're talking as if this were only theoretical. It is not. The state > of the art in compiler techniques has advanced a lot since the old > days of the Pascal P-Machine. Parakeet, for example[2], compiles > numeric functions to optimized machine code on the fly using > decorat

Re: Fortran

2014-05-29 Thread Steven D'Aprano
On Thu, 29 May 2014 17:50:00 +0300, Marko Rauhamaa wrote: > alb...@spenarnc.xs4all.nl (Albert van der Horst): > >> I always thought that the real point of JIT was that it can take >> advantage of type information that is not available until runtime. If >> it can infer that something is an integer

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-29 Thread Peter Pearson
On 29 May 2014 14:06:47 GMT, Albert van der Horst wrote: > In article , > Mark H Harris wrote: >>On 5/11/14 1:59 PM, Chris Angelico wrote: > julia> prec=524288 > 524288 > julia> with_bigfloat_precision(prec) do > println(atan(BigFloat(1)/5)*16 - atan(BigFloat(1)/239)

Re: Fortran

2014-05-29 Thread Marko Rauhamaa
Chris Angelico : > On Fri, May 30, 2014 at 12:50 AM, Marko Rauhamaa wrote: >> Python code, too, is compiled into interpreted bytecode. Again, you >> could compile it into machine code ahead of execution or perform the >> compilation on the fly with JIT techniques. However, Python is so >> ridicul

Re: Fortran

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 12:50 AM, Marko Rauhamaa wrote: > Python code, too, is compiled into interpreted bytecode. Again, you > could compile it into machine code ahead of execution or perform the > compilation on the fly with JIT techniques. However, Python is so > ridiculously dynamic that such

Re: Fortran

2014-05-29 Thread Marko Rauhamaa
alb...@spenarnc.xs4all.nl (Albert van der Horst): > I always thought that the real point of JIT was that it can take > advantage of type information that is not available until runtime. If > it can infer that something is an integer, just before entering a loop > to be executed millions of times,

Re: Fortran

2014-05-29 Thread Albert van der Horst
In article <8761l9pi3n@elektro.pacujo.net>, Marko Rauhamaa wrote: > >Producing an effective JIT for Python seems like a formidable challenge >but not impossible in principle. After all, the developer *could* >provide that static typing information in, like, 99.9% of the code. That >would be

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-29 Thread Albert van der Horst
In article , Mark H Harris wrote: >On 5/11/14 1:59 PM, Chris Angelico wrote: julia> prec=524288 524288 >>> julia> with_bigfloat_precision(prec) do println(atan(BigFloat(1)/5)*16 - atan(BigFloat(1)/239)*4) end >> >> Would it be quicker (and no less accurate

  1   2   3   4   >