scipy tutorial question

2016-10-02 Thread Sayth Renshaw
I would ask on scipy mailing list as it may provide a better response. https://www.scipy.org/scipylib/mailing-lists.html Sayth -- https://mail.python.org/mailman/listinfo/python-list

Create a map for data to flow through

2016-10-02 Thread Sayth Renshaw
Is there a standard library feature that allows you to define a declarative map or statement that defines the data and its objects to be parsed and output format? Just wondering as for loops are good but when i end up 3-4 for loops deep and want multiple matches at each level i am finding it ha

Re: unintuitive for-loop behavior

2016-10-02 Thread Jussi Piitulainen
Steve D'Aprano writes: > On Sun, 2 Oct 2016 05:35 pm, Jussi Piitulainen wrote: > > [...] >>> I'm sorry, I don't understand what you mean by "Python semantics" versus >>> "a translation". A translation of what? In what way is it "magical >>> semantics"? I see nothing magical in your code: it is Pyt

Re: announcing fython

2016-10-02 Thread Denis Akhiyarov
On Sunday, October 2, 2016 at 10:57:57 AM UTC-5, nicolases...@gmail.com wrote: > >One problem with using very similar syntax for distinct languages is that it > >can get confusing. > > The first inspiration for Fython was to be close to Fortran, while improving > the syntax. The project is in th

Re: Locals [was Re: unintuitive for-loop behavior]

2016-10-02 Thread Chris Angelico
On Mon, Oct 3, 2016 at 3:09 PM, Steven D'Aprano wrote: > But if it did, then just as in the similar situation in IronPython and Jython, > you would still need to convince the compiler to use LOAD_FAST or equivalent > in > order to see it. Hence: > > > x = y = 'global' > def example(): > local

Locals [was Re: unintuitive for-loop behavior]

2016-10-02 Thread Steven D'Aprano
On Monday 03 October 2016 12:42, Steve D'Aprano wrote: > Yes the local would have been created, but you wouldn't see it from an > ordinary lookup of name x. You would need to use > > locals()['x'] > > to see that it exists. For x to return it, you have to convince the compiler > to use LOAD_

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread John Ladasky
On Sunday, October 2, 2016 at 7:21:15 PM UTC-7, blue wrote: > You have here a PyQt5 Reference Guide > http://pyqt.sourceforge.net/Docs/PyQt5/index.html > Some example can be found here 4 and 5 > http://codeprogress.com/python/libraries/pyqt/ That's a nice page of examples, but there are no OpenG

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread John Ladasky
On Sunday, October 2, 2016 at 7:45:50 PM UTC-7, Lawrence D’Oliveiro wrote: > On Monday, October 3, 2016 at 2:14:13 PM UTC+13, John Ladasky wrote: > > > > I am making my first attempt at 3D rendering. > > Bear in mind there are two kinds of 3D rendering: realtime (with OpenGL) and > non-realtime.

Re: Learning python data types

2016-10-02 Thread Rustom Mody
On Monday, October 3, 2016 at 3:38:24 AM UTC+5:30, Crane Ugly wrote: > I am not new in scripting in general. > And about a year I create scripts in python, but my approach was always based > on my habits from UNIX shell, where data types are not obvious. > Going deeper with python I see necessity

Re: PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread blue
You have here a PyQt5 Reference Guide http://pyqt.sourceforge.net/Docs/PyQt5/index.html Some example can be found here 4 and 5 http://codeprogress.com/python/libraries/pyqt/ Support for OpenGL http://pyqt.sourceforge.net/Docs/PyQt5/opengl.html told us: When compiled against Qt v5.1 or later, Py

Re: unintuitive for-loop behavior

2016-10-02 Thread Steve D'Aprano
On Sun, 2 Oct 2016 05:35 pm, Jussi Piitulainen wrote: [...] >> I'm sorry, I don't understand what you mean by "Python semantics" versus >> "a translation". A translation of what? In what way is it "magical >> semantics"? I see nothing magical in your code: it is Python code. > > "Python semantics

Re: unintuitive for-loop behavior

2016-10-02 Thread Steve D'Aprano
On Sun, 2 Oct 2016 09:41 pm, Chris Angelico wrote: > The only way to prove that something is a new binding is to > demonstrate that, when this binding is removed, a previous one becomes > visible. In Python, that only ever happens across namespaces, and in > CPython, the only way I can make it ha

Re: SOAP XML webserver in Python/Django

2016-10-02 Thread ivan77
Thank you for the info dieter. I'll take a look at your suggestions. -- https://mail.python.org/mailman/listinfo/python-list

PyQt5, OpenGL, where to start, minimal example code?

2016-10-02 Thread John Ladasky
Hi there, I am making my first attempt at 3D rendering. My system configuration: OS : Ubuntu 16.04 64-bit Python : 3.5.1 Qt : 5.5.1 PyQt : 5.5.1 OpenGL : 4.5.0 (I have a modern GPU) All software was installed from the Canonical repository. I didn't build any binaries myself. >From

Re: Byte code descriptions somewhere?

2016-10-02 Thread Chris Angelico
On Mon, Oct 3, 2016 at 9:58 AM, Cem Karan wrote: >> To execute your own code, look at types.FunctionType and >> types.CodeType, particularly the latter's 'codestring' argument >> (stored as the co_code attribute). Be careful: you can easily crash >> CPython if you mess this stuff up :) > > Ah, but

Re: Byte code descriptions somewhere?

2016-10-02 Thread Cem Karan
On Oct 1, 2016, at 7:34 PM, breamore...@gmail.com wrote: > On Saturday, October 1, 2016 at 11:57:17 PM UTC+1, Cem Karan wrote: >> Hi all, I've all of a sudden gotten interested in the CPython interpreter, >> and started trying to understand how it ingests and runs byte code. I found >> Include

Re: Byte code descriptions somewhere?

2016-10-02 Thread Cem Karan
On Oct 1, 2016, at 8:30 PM, Ned Batchelder wrote: > On Saturday, October 1, 2016 at 7:48:09 PM UTC-4, Cem Karan wrote: >> Cool, thank you! Quick experimentation suggests that I don't need to worry >> about marking anything for garbage collection, correct? The next question >> is, how do I cr

Re: Byte code descriptions somewhere?

2016-10-02 Thread Cem Karan
On Oct 1, 2016, at 7:56 PM, Chris Angelico wrote: > On Sun, Oct 2, 2016 at 10:47 AM, Cem Karan wrote: >> Cool, thank you! Quick experimentation suggests that I don't need to worry >> about marking anything for garbage collection, correct? The next question >> is, how do I create a stream of

Re: Byte code descriptions somewhere?

2016-10-02 Thread Cem Karan
I kind of got the feeling that was so from reading the docs in the source code. Too bad! :( Cem On Oct 1, 2016, at 7:53 PM, Paul Rubin wrote: > Cem Karan writes: >> how do I create a stream of byte codes that can be interpreted by >> CPython directly? > > Basically, study the already existi

Learning python data types

2016-10-02 Thread Crane Ugly
I am not new in scripting in general. And about a year I create scripts in python, but my approach was always based on my habits from UNIX shell, where data types are not obvious. Going deeper with python I see necessity to know better data types, differences between them and most importantly whe

Re: working with ctypes and complex data structures

2016-10-02 Thread eryk sun
On Sun, Oct 2, 2016 at 5:50 PM, Michael Felt wrote: > > a) where is documentation on "CField"'s? It's undocumented. A CField is a data descriptor that accesses a struct field with the given type, size, and offset. Like most descriptors, it's meant to be accessed as an attribute of an instance, n

scipy tutorial question

2016-10-02 Thread Xristos Xristoou
hello i want to follow this scipy tutorial http://www2.geog.ucl.ac.uk/~plewis/geogg122-2011-12/dem2.html to calculate slope/aspect and more. first question,this is a good way to calculate slope/aspect with scipy ? can i find more easy way for this calculate ? second question and most important

Re: Need help for the print() function with a better order

2016-10-02 Thread 380162267qq
在 2016年10月2日星期日 UTC-4下午1:05:58,Peter Pearson写道: > On Sat, 1 Oct 2016 18:12:29 -0700 (PDT), 38016226...@gmail.com wrote: > > I am trying to print a simple decision tree for my homework. > > The answer must keep in this format: > > > > Top 7,4,0.95 > > career gain = 100 > > 1.Management 2, 3, 0.9

Re: inplace text filter - without writing file

2016-10-02 Thread MRAB
On 2016-10-02 06:33, Sayth Renshaw wrote: On Sunday, 2 October 2016 16:19:14 UTC+11, Sayth Renshaw wrote: On Sunday, 2 October 2016 12:14:43 UTC+11, MRAB wrote: > On 2016-10-02 01:21, Sayth Renshaw wrote: > > Hi > > > > I have a fileobject which was fine however now I want to delete a line fro

Re: Merecurial and Python-2.7.x, Python-3.Y

2016-10-02 Thread Michael Felt
On 02/10/2016 19:01, Ned Batchelder wrote: On Saturday, October 1, 2016 at 9:25:57 PM UTC-4, Michael Felt wrote: Finally, I got to where I understood what needed to be done to get both Mercurial built - and the the new SSL requirements met. So, running: # hg clone https://hg.python.org/cpyth

working with ctypes and complex data structures

2016-10-02 Thread Michael Felt
I am trying to understand the documentation re: ctypes and interfacing with existing libraries. I am reading the documentation, and also other sites that have largely just copied the documentation - as well as the "free chapter" at O'Reilly (Python Cookbook). I am missing anything on CFields

Re: Need help for the print() function with a better order

2016-10-02 Thread Peter Pearson
On Sat, 1 Oct 2016 18:12:29 -0700 (PDT), 38016226...@gmail.com wrote: > I am trying to print a simple decision tree for my homework. > The answer must keep in this format: > > Top 7,4,0.95 > career gain = 100 > 1.Management 2, 3, 0.9709505944546686 > 2.Service 5, 1, 0.6500224216483541 >

Re: Merecurial and Python-2.7.x, Python-3.Y

2016-10-02 Thread Ned Batchelder
On Saturday, October 1, 2016 at 9:25:57 PM UTC-4, Michael Felt wrote: > Finally, I got to where I understood what needed to be done to get both > Mercurial built - and the the new SSL requirements met. > > So, running: > > # hg clone https://hg.python.org/cpython > > works. What is the next ste

Re: Merecurial and Python-2.7.x, Python-3.Y

2016-10-02 Thread Michael Felt
On 02/10/2016 08:34, Terry Reedy wrote: No. By default, the working directory for a clone is for the default branch. Any clone can be 'updated' to any branch. I have each share clone updated to a different branch, so I never update to a different branch. -- This answers my underlying questi

Re: announcing fython

2016-10-02 Thread nicolasessisbreton
>One problem with using very similar syntax for distinct languages is that it >can get confusing. The first inspiration for Fython was to be close to Fortran, while improving the syntax. The project is in the early days, so all suggestions are welcome. Some difference to the Python language are

Re: Italian libel spam

2016-10-02 Thread Skip Montanaro
On Sun, Oct 2, 2016 at 9:14 AM, Marko Rauhamaa wrote: > I'd imagine just having a list of 100 Italian words should give you a > pretty accurate spam score. Extra points for all caps. > Thanks, but that's not how SpamBayes works. Have a look here if you're interested: http://www.spambayes.org/

Re: announcing fython

2016-10-02 Thread BartC
On 02/10/2016 14:43, nicolasessisbre...@gmail.com wrote: **Is Fython a full-featured Python implementation that compiles to Fortran, or a thin wrapper around Fortran that uses Python syntax, or something in between? It's something in between. Fython is a programming langugage with its own synt

Italian libel spam

2016-10-02 Thread Marko Rauhamaa
Skip Montanaro : > Yeah, we've been struggling with it over at mail.python.org. While > incoming mail has all sorts of spam fighting bells and whistles, > messages arriving from Usenet only has the SpamBayes filter. I'm sure > I have a few more of these messages held. I will continue to train on >

Re: announcing fython

2016-10-02 Thread nicolasessisbreton
**Is Fython a full-featured Python implementation that compiles to Fortran, or a thin wrapper around Fortran that uses Python syntax, or something in between? It's something in between. Fython is a programming langugage with its own syntax. For example def mean: int in

Re: Lawrence D'Oliveiro

2016-10-02 Thread Skip Montanaro
If you have one or more of these messages saved, please forward it along to me (in its entirety, headers and all). Attaching it as a compressed tar file will help sneak it past other spam filters. Thanks, Skip On Sun, Oct 2, 2016 at 8:00 AM, Skip Montanaro wrote: > > On Sun, Oct 2, 2016 at 1:

Re: Lawrence D'Oliveiro

2016-10-02 Thread Skip Montanaro
On Sun, Oct 2, 2016 at 1:05 AM, Bob Martin wrote: > It's in several of the groups that I follow. Yeah, we've been struggling with it over at mail.python.org. While incoming mail has all sorts of spam fighting bells and whistles, messages arriving from Usenet only has the SpamBayes filter. I'm s

Re: RASTER analysis(slope)

2016-10-02 Thread Xristos Xristoou
Τη Σάββατο, 1 Οκτωβρίου 2016 - 8:52:13 μ.μ. UTC+3, ο χρήστης Xristos Xristoou έγραψε: > hello team > > i want to calculate slope and aspect from some RASTER > IMAGE(.grid,tiff,geotiff) > who is the better method to can i do this ? > with numpy and scipy or with some package? > > > thnx you tea

Re: rocket simulation game with just using tkinter

2016-10-02 Thread Irmen de Jong
On 1-10-2016 22:07, Irmen de Jong wrote: > On 1-10-2016 15:44, Christian Gollwitzer wrote: >> Am 01.10.16 um 00:59 schrieb Irmen de Jong: >>> Hi, >>> >>> I've made a very simple rocket simulation game, inspired by the recent >>> success of SpaceX >> >>> You can get the code here if you want to giv

Re: ConfigParser: use newline in INI file

2016-10-02 Thread Peter Otten
Thorsten Kampe wrote: > * Ned Batchelder (Sat, 1 Oct 2016 17:41:28 -0700 (PDT)) >> If you want to have \n mean a newline in your config file, you can >> do the conversion after you read the value: >> >> >>> "a\\nb".decode("string-escape") >> 'a\nb' > > Interesting approach (although it

Re: ConfigParser: use newline in INI file

2016-10-02 Thread Chris Angelico
On Sun, Oct 2, 2016 at 9:34 PM, Thorsten Kampe wrote: >> If you want to have \n mean a newline in your config file, you can >> do the conversion after you read the value: >> >> >>> "a\\nb".decode("string-escape") >> 'a\nb' > > Interesting approach (although it does not work with Python 3:

Re: unintuitive for-loop behavior

2016-10-02 Thread Chris Angelico
On Sun, Oct 2, 2016 at 9:20 PM, Steve D'Aprano wrote: > On Sun, 2 Oct 2016 04:06 pm, Chris Angelico wrote: >> Hmm, interesting. I don't have IronPython here, but maybe you can tell >> me what this does: >> >> print(str) >> str = "demo" >> print(str) >> del str >> print(str) >> >> and the same insi

Re: ConfigParser: use newline in INI file

2016-10-02 Thread Thorsten Kampe
* Ned Batchelder (Sat, 1 Oct 2016 17:41:28 -0700 (PDT)) > > On Saturday, October 1, 2016 at 6:25:16 PM UTC-4, Thorsten Kampe wrote: > > * Ben Finney (Sun, 02 Oct 2016 07:12:46 +1100) > > > > > > Thorsten Kampe writes: > > > > > > > ConfigParser escapes `\n` in ini values as `\\n`. > > > > Inde

Re: unintuitive for-loop behavior

2016-10-02 Thread Steve D'Aprano
On Sun, 2 Oct 2016 04:06 pm, Chris Angelico wrote: > On Sun, Oct 2, 2016 at 3:19 PM, Steve D'Aprano > wrote: >> In IronPython, you could have the following occur in a function locals, >> just as it could happen CPython for globals: >> >> - delete the name binding "x" >> - which triggers a diction

Re: inplace text filter - without writing file

2016-10-02 Thread breamoreboy
On Sunday, October 2, 2016 at 6:19:14 AM UTC+1, Sayth Renshaw wrote: > > I just can't quite get it. > > def return_files(file_list): > for filename in sorted(file_list): > file = os.path.join(dir_path, filename) > print(file) > with open(file) as fd: > prin

Re: unintuitive for-loop behavior

2016-10-02 Thread Jussi Piitulainen
Marko Rauhamaa writes: > Jussi Piitulainen wrote: >> I could have just posted that yes, it *could* be done, there's >> nothing so special about variables and scope in Python. But I pretty >> much know that the response to *that* would have been yet another >> round of "You don't understand that Py

Re: unintuitive for-loop behavior

2016-10-02 Thread Jussi Piitulainen
Steve D'Aprano writes: > On Sun, 2 Oct 2016 11:44 am, Gregory Ewing wrote: > >> Steve D'Aprano wrote: >> >>> Certainly when you call a function, the local bindings need to be >>> created. Obviously they didn't exist prior to calling the function! >>> I didn't think that was the difference you were

Re: unintuitive for-loop behavior

2016-10-02 Thread Marko Rauhamaa
Jussi Piitulainen : > I could have just posted that yes, it *could* be done, there's nothing > so special about variables and scope in Python. But I pretty much know > that the response to *that* would have been yet another round of "You > don't understand that Python variables are different, they

Re: Lawrence D'Oliveiro

2016-10-02 Thread Bob Martin
in 765736 20161001 072941 Paul Rubin wrote: >Chris Angelico writes: >>> Why can't you block "PEDOFILO"? >> I've no idea who you're talking about > >That's the weird Italian spam that the newsgroup has been getting for a >while. I've been wondering for a while if anyone knows what the story >is,