[issue42916] Support for DICOM image file format in imghdr module

2021-04-11 Thread Pierre-Alain Moret
Pierre-Alain Moret added the comment: The DICOM format is indeed very widely used in the medical field and for me it deserves to be added in stdlib. I do not see why it is more specific than rast format which is included. Moreover it should be easy to add because even if the complete format

[issue36257] configure with --with-icc --with-cxx-main=icpc

2019-03-10 Thread Alain Miniussi
New submission from Alain Miniussi : Hi, I'm trying to install 3.7.2 on CentOS 7.5 and intel 19: [alainm@pollux Python-3.7.2]$ ./configure --prefix=/trinity/shared/OCA/softs/pyton-3.7-intel19 --with-icc --with-cxx-main=icpc --enable-optimizations Configure look ok but then compilation

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Alain Ketterlin
Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes: > On Mon, 19 Feb 2018 09:40:09 +0100, Alain Ketterlin wrote: > >> Tim Delaney <timothy.c.dela...@gmail.com> writes: >> >> [...] >>> As others have said, typing is about how the underlying

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Alain Ketterlin
Chris Angelico <ros...@gmail.com> writes: > On Mon, Feb 19, 2018 at 9:04 PM, Alain Ketterlin > <al...@universite-de-strasbourg.fr.invalid> wrote: >> Look at the C11 standard, section 6.3.2.3 ("Pointers"), 6.5.§6-7 >> ("effective types"

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Alain Ketterlin
Chris Angelico <ros...@gmail.com> writes: > On Mon, Feb 19, 2018 at 7:40 PM, Alain Ketterlin > <al...@universite-de-strasbourg.fr.invalid> wrote: >> No. C has much stronger rules, not on casting, but on accessing the >> pointees, which basically invalidates

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-19 Thread Alain Ketterlin
vial program, this is usually way too complex to capture, testing will be incomplete, and all you can do is run your program and see whether is goes through. As a general rule, if that's all you expect from typing, then, fine, call this "strong". I won't go as far, and just say that it is g

Re: "None" and "pass"

2018-02-05 Thread Alain Ketterlin
any side-effect and/or throw an exception). And be fired right after your first code review. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Doubt in line_profiler documentation

2018-01-27 Thread Alain Ketterlin
xed/conventional resolution. By the way, the use of gettimeofday() is strange since this function is now deprecated... clock_gettime() should be used instead. It has an associated clock_getres() as well. -- Alain. [*] WTF is wrong with these microsoft developpers? Clocks and performance counter

Re: CSV file edition

2018-01-09 Thread Alain Ketterlin
at 39 is correct). Your data look like fixed-width fields. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Alain Ketterlin
this similar to how Lua operates too? No. Lua uses a register-based (virtual) machine. See https://www.lua.org/doc/jucs05.pdf I think Lua was the first language in widespread use to move to a register-based machine. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: integer copy

2017-10-20 Thread Alain Ketterlin
not copy types like module, class, function, method, | nor stack trace, stack frame, nor file, socket, window, nor array, nor | any similar types. But who knows what "similar types" are... -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Typo-squatting PyPi

2017-09-17 Thread Alain Ketterlin
nese IP address. NBU officials contacted PyPI | administrators last week who removed the packages before officials | published a security advisory on Saturday." -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposed new syntax

2017-08-11 Thread Alain Ketterlin
make more sense, similar to conditional expressions (but I still dislike it, and don't think such a feature requires syntactic support). -- Alain. [1] https://docs.python.org/3/reference/expressions.html#displays-for-lists-sets-and-dictionaries -- https://mail.python.org/mailman/listinfo/python-list

[OT] Re: how to guess the number of cluster when do not know?

2017-08-04 Thread Alain Ketterlin
Ho Yeung Lee <jobmatt...@gmail.com> writes: > i find kmeans has to input number of cluster [...] https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set Completely off-topic on this group/list, please direct your questions elsewhere. -- Alain. -- https://mail.p

Re: Write this accumuator in a functional style

2017-07-11 Thread Alain Ketterlin
h = list_of_parrots[0] if h.color == 'blue': return ([h]+b,g,r) elif h.color == 'green': ... and so on -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-01 Thread Alain Ketterlin
ISION SLASH). I have tried this once. "Next time you're fired/dead" (and less pleasant variants) was the only comment I got from people I shared files with. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

[issue21301] pathlib missing Path.expandvars(env=os.environ)

2017-03-26 Thread Alain Mellan
Alain Mellan added the comment: Yes, you can close it. — alain. On Mar 25, 2017, at 23:51 , Serhiy Storchaka <rep...@bugs.python.org> wrote: http://bugs.python.org/issue21301 <http://bugs.python.org/issue21301> -- ___ Python

Re: Who are the "spacists"?

2017-03-19 Thread Alain Ketterlin
traces of nuts. Tabs should > not be folded, spindled or mutilated. Tabs are vicious if wounded. > Remember, kids: Just Say No to the Invisible Menace. And US government officials call them "alternative spaces". Enough said. -- Alain. P/S: just in case: https://www.jwz.org/doc/tabs-vs-spaces.html -- https://mail.python.org/mailman/listinfo/python-list

Re: When will os.remove fail?

2017-03-12 Thread Alain Ketterlin
s has its own set of rules: https://msdn.microsoft.com/en-us/library/bb727008.aspx > Under what circumstances will os.remove fail to remove a file? > > If you don't own the file and have no write permission, if it is on > read-only media, anything else? I'm not sure which system you

Re: The hardest problem in computer science...

2017-01-06 Thread Alain Ketterlin
> what do we call the vertical and horizontal line elements? Box-drawing characters. At least that's how Unicode calls them. Even if you don't draw boxes... https://en.wikipedia.org/wiki/Box-drawing_character -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why does this list swap fail?

2016-11-14 Thread Alain Ketterlin
usly), you just overwrite the first element twice. Congratulations, a very good corner case (you can't call it a bug, since it conforms to the definition of the language). -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to pick out the same titles.

2016-10-16 Thread Alain Ketterlin
Killing Fields" Sometimes the title will > have the date a year off. > > What I would like to do it output to another file that show those two > as a match. Try the difflib module (read the doc, its default behavior may be surprising). -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to process syntax errors

2016-10-14 Thread Pierre-Alain Dorange
previously, do not except python to understand your new syntax, just write a small interpreter to translate your new language to python. -- Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <h

Re: How to process syntax errors

2016-10-12 Thread Pierre-Alain Dorange
eur developer. But what confuse me, is that Python require "real live" interpratation of the code to work properly (or perhaps i also confuse on that but Python rely on interpretation of the code to conform to its own standard, ie variables can change type during execution...) -- Pierre-A

Re: Python code is compiled before execution

2016-10-11 Thread Pierre-Alain Dorange
reted language, and i found strange the initial request. And sure, i overinterpret or simplify thing (compiling)... But it seems that all this talk do not interested the initial requester (Mr Puneet) : at that time he has not answer to the thread. -- Pierre-Alain Dorange Moof <htt

Re: Python code is compiled before execution

2016-10-11 Thread Pierre-Alain Dorange
n and all kind of combinaison : strict interpretation, byte-code compilation, JIT compilation, AOT compilation... So yes Python compile (bytecode). -- Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/> Ce message est sous licence Creative Commons "by-nc-sa-2.0"

Re: How to process syntax errors

2016-10-11 Thread Pierre-Alain Dorange
means it is most definitely > meant to be able to be caught. Using compile() function yes. So yes there is a way to check "syntax error" before executing code (using compile function and exceptions) but it was not standard, nor widely used... It was still a hack for me, but perha

Re: How to process syntax errors

2016-10-10 Thread Pierre-Alain Dorange
requested but that only a hack and should not be used in real world. -- Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/> -- https://mail.python.org/mailman/listinfo/python-list

Re: how to refactor nested for loop into smaller for loop assume each of them independent?

2016-10-08 Thread Alain Ketterlin
Python wll fold the constants, but I haven't checked). Are you sure this is your (real) problem? -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: BeautifulSoup help !!

2016-10-07 Thread Pierre-Alain Dorange
eb site (vigiecrue) : retrieve the page, extract data, extract last river level and mean the 24h last levels. <https://www.dropbox.com/sh/k5974t374zmcoj6/AACes_Xo5DrxCbE1RjSaeKXYa?dl=0> Note : it was probably not beautiful python code, but it works for the purpose it was written. -- Pierre-Al

Re: Problem with difflib SequenceMatcher

2016-09-12 Thread Alain Ketterlin
on your strings (it returns no matching blocks). It is all due to the "Autojunk" heuristics (see difflib's doc for details), which considers the first characters as junk. Call SM(...,autojunk=False). I have no idea why the maintainers made this stupid autojunk idea the default. Complai

Re: Creating a calculator

2016-07-04 Thread Pierre-Alain Dorange
DFS <nos...@dfs.com> wrote: > > 2 lines? Love it! > > But apparently eval==evil. > > http://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html > > I bet you get hammered about it here on clp. It was a software to be deploy, it was just for educatio

Re: Well, I finally ran into a Python Unicode problem, sort of

2016-07-03 Thread Alain Ketterlin
l_analysis.html#identifiers To me it makes a lot of sense to *not* include category Sm characters in identifiers, since they are usually used to denote operators (like +). It would be very confusing to have a variable named ∇f, as confusing as naming a variable a+b or √x. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a calculator

2016-07-01 Thread Pierre-Alain Dorange
--- env={} env["__builtins__"] = None u=raw_input('Enter calculation:") print eval(u,env) - -- Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/> -- https://mail.python.org/mailman/listinfo/python-list

Re: Creating a calculator

2016-07-01 Thread Pierre-Alain Dorange
- More reduced : -- u=raw_input('Enter calculation:") print eval(u) -- works and compute : 1+2+3+4-1+4*2 2+3.0/2-0.5 Perform better and shorter, but less educationnal of course... -- Pierre-Alain Dorange

Re: Assignment Versus Equality

2016-06-27 Thread Alain Ketterlin
et bored with less-than-useful spaces. > Did the poor sod who wrote the compiler think it was a good idea? I don't know, but he has a good excuse: he was one of the first to ever write a compiler (see https://en.wikipedia.org/wiki/Compiler, the section on History). You just called John Backus a

Re: Empty List

2016-06-27 Thread Pierre-Alain Dorange
izing you should do "something" that perhaps will fill the list (word.append("hello"). Then after do your job, you perhaps need to print it. But initializing and just print, will do nothing else than initialize and print the result... As state before this code more or

Re: Break and Continue: While Loops

2016-06-24 Thread Pierre-Alain Dorange
hing". To be empty, something must exist first. -- Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/> -- https://mail.python.org/mailman/listinfo/python-list

Re: Can math.atan2 return INF?

2016-06-24 Thread Pierre-Alain Dorange
Marko Rauhamaa <ma...@pacujo.net> wrote: > Note that the "valid point of view for external observers" is the only > valid scientific point of view. For a scientific point of view, right. But tell this to the one that will be close to a blackhole ;-) -- Pierre-Alain Dora

Re: Can math.atan2 return INF?

2016-06-23 Thread Pierre-Alain Dorange
Steven D'Aprano <st...@pearwood.info> wrote: > > which infinity. There are many - some larger than others > > China has just announced a new supercomputer that is so fast it can run an > infinite loop in 3.7 seconds. Near a black hole 3.7 seconds can last an infinite time

Re: Can math.atan2 return INF?

2016-06-23 Thread Pierre-Alain Dorange
e maximum value. So the tendancy is always atan2(y,x) tend to pi/4 if you looks at lot od y and x that will be grater and greater each time : the final frontier would always be pi/4, even if t take a long time to reach it. -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> C

Re: [tkinter] widget size adjustment

2016-06-22 Thread Pierre-Alain Dorange
just CENTERED... I do not explore this, i just thought NSEW was also CENTERED. Many Thanks. -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/&

Re: [tkinter] widget size adjustment

2016-06-22 Thread Pierre-Alain Dorange
pmx-bigmap> the tkinter code is in pmx.py the canvas class was TMap GUI was created in main_gui.__init__() callback function was main_gui.resize() -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> Ce message est sous licence Creative Commons &q

Re: Can math.atan2 return INF?

2016-06-22 Thread Pierre-Alain Dorange
an2(0, 0) would have been NaN too but i'm not a math expert, but the limit of atan2 would be 45°, so pi/4 radians (0,7854). As x,y are coordinates, the both infinite would tend toward 45°. x only infinite would be 0° (0 radians) y only infinite woudl be 180° (pi/2 radians) --

Re: Can math.atan2 return INF?

2016-06-22 Thread Pierre-Alain Dorange
nvalid... -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/> -- https://mail.python.org/mailman/listinfo/python-list

Re: [tkinter] widget size adjustment

2016-06-22 Thread Pierre-Alain Dorange
map servers) : user can drag the map to see a different portion. So i except the map to be resized to show a bigger portion of the whole map : no streching. -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> Ce message est sous licence Creative Commons "by-n

Re: Can math.atan2 return INF?

2016-06-21 Thread Pierre-Alain Dorange
sed the correct quadrant (for angle answer). -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/> -- https://mail.python.org/mailman/listinfo/python-list

Re: [tkinter] widget size adjustment

2016-06-21 Thread Pierre-Alain Dorange
cell where the canvas widget is put). I think i can resize the canvas, but i can't find a way to get the available space after resize. Perhaps using the grid manager is not the godd idea for that ? I except it was more understandable. -- Pierre-Alain Dorange<http://microwar.sourcef

[tkinter] widget size adjustment

2016-06-19 Thread Pierre-Alain Dorange
to do from that. Any clue or advice or tutorial ? -- Pierre-Alain Dorange<http://microwar.sourceforge.net/> Ce message est sous licence Creative Commons "by-nc-sa-2.0" <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/> -- https://mail.python.org/mailman/listinfo/python-list

Re: Detecting repeated subsequences of identical items

2016-04-21 Thread Alain Ketterlin
yway, it looks like a job for a suffix trees. Depending on what you are after, you may also be interested in the sequitur algorithm (http://www.sequitur.info/). -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Serious error in int() function?

2016-04-13 Thread Alain Ketterlin
t;float". See http://floating-point-gui.de/ for a nice explanation. Use decimal (https://docs.python.org/2/library/decimal.html) if you need exact representations. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: A new module for performing tail-call elimination

2015-07-16 Thread Alain Ketterlin
., Y combinator mutual recursion, whose first result is: http://stackoverflow.com/questions/4899113/fixed-point-combinator-for-mutually-recursive-functions -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Can Python function return multiple data?

2015-06-05 Thread Alain Ketterlin
Steven D'Aprano st...@pearwood.info writes: On Fri, 5 Jun 2015 04:17 am, Alain Ketterlin wrote: Steven D'Aprano st...@pearwood.info writes: [...] But you still find a few people here and there who have been exposed to Java foolishness, and will argue that Python is pass by value, where

Re: Can Python function return multiple data?

2015-06-05 Thread Alain Ketterlin
) are references. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Can Python function return multiple data?

2015-06-05 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@universite-de-strasbourg.fr.invalid: Grant Edwards invalid@invalid.invalid writes: [...] Or to be a bit obtuse: Python parameters are passed by value, but all values are references. Exactly, that's a perfect description

Re: Can Python function return multiple data?

2015-06-04 Thread Alain Ketterlin
. No, Java doesn't work like that for primitive types (assuming that by Java you mean the language and execution environment defined in reference documents). -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: fork/exec close file descriptors

2015-06-03 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Wed, Jun 3, 2015 at 7:06 AM, Alain Ketterlin al...@universite-de-strasbourg.fr.invalid wrote: I've no idea what the OP's program was doing, so I'm not going to split hairs. I can't imagine why one would like to mass-close an arbitrary set of file

Re: fork/exec close file descriptors

2015-06-03 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@universite-de-strasbourg.fr.invalid: Marko Rauhamaa ma...@pacujo.net writes: First, if close() fails, what's a poor program to do? Warn the user? Not assume everything went well? It all depends on the application, and what

Re: fork/exec close file descriptors

2015-06-03 Thread Alain Ketterlin
random...@fastmail.us writes: On Wed, Jun 3, 2015, at 03:11, Alain Ketterlin wrote: Thank you, I know this. What I mean is: what are the reasons that you cannot access your file descriptors one by one? To me closing a range of descriptors has absolutely no meaning, simply because ranges have

Re: fork/exec close file descriptors

2015-06-02 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@universite-de-strasbourg.fr.invalid: The close(2) manpage has the following warning on my Linux system: | Not checking the return value of close() is a common but | nevertheless serious programming error. It is quite possible

Re: fork/exec close file descriptors

2015-06-02 Thread Alain Ketterlin
followed the thread, but if your problem is to make sure fds are closed on exec, you may be better off using the... close-on-exec flag. Or simply do the bookkeeping.) -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Using Python instead of Bash

2015-05-31 Thread Alain Ketterlin
anyway). And I would call that variable threshold instead of treshold. (What I don't see is the advantage you find in writing such scripts in python instead of sh, but I guess you have your own reasons.) -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen zombie

2015-05-20 Thread Alain Ketterlin
. The subprocess version appears to be doing that for me somehow. Not sure what you mean. You have to do the bookkeeping yourself. (But, does beep really take so much time that you can't just call() it?) -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Throw the cat among the pigeons

2015-05-07 Thread Alain Ketterlin
Dave Angel da...@davea.name writes: On 05/06/2015 11:36 AM, Alain Ketterlin wrote: Yes, plus the time for memory allocation. Since the code uses r *= ..., space is reallocated when the result doesn't fit. The new size is probably proportional to the current (insufficient) size. This means

Re: Throw the cat among the pigeons

2015-05-06 Thread Alain Ketterlin
. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Am I missing something here? ipaddress vs socket

2015-05-01 Thread Alain Ketterlin
== 4 or 6 Check the value of the version attribute. Or use socket.getaddrinfo(), which is more convenient if all you need is an address parser. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Best search algorithm to find condition within a range

2015-04-09 Thread Alain Ketterlin
and for signed, while the underlying architecture of every twos complement machine I have used did add, subtract, and multiply as though the numbers were unsigned (what you call modular arithmetic). Alain did have a point. *If* I had used int64_t in my algorithm, it might not have worked because

Re: Best search algorithm to find condition within a range

2015-04-09 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr: No, it would not work for signed integers (i.e., with lo and hi of int64_t type), because overflow is undefined behavior for signed. All architectures I've ever had dealings with have used 2's-complement

Re: Best search algorithm to find condition within a range

2015-04-09 Thread Alain Ketterlin
, but...) No, it would not work for signed integers (i.e., with lo and hi of int64_t type), because overflow is undefined behavior for signed. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Best search algorithm to find condition within a range

2015-04-09 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Thu, Apr 9, 2015 at 11:57 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Because, in: z = x+y; // all signed ints if ( z x ) ... either there was no overflow (and the condition is false), or there was, and the result

Re: Socket ICMP V6 error

2015-01-22 Thread Alain Ketterlin
.) -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: OTish: using short-term TCP connections to send to multiple slaves

2014-11-16 Thread Alain Ketterlin
another story. [...] -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Send UDP packet to link-local IPv6 address?

2014-10-29 Thread Alain Ketterlin
of getaddrinfo()). Hope this helps, -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-23 Thread Alain Ketterlin
*of the potential results*, i.e., instill a bit of lazyness. One could object that, again, both expressions in the tuple have been evaluated (building two lambdas), only one of which is finally called. I guess that's what BartC meant. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: Truthiness

2014-10-23 Thread Alain Ketterlin
, dictionaries, sets and frozensets). All other values are interpreted as true. (links are to the 2.7 version of the reference manual, I think not much has changed in 3.* versions.) -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: your mail

2014-10-18 Thread Alain Ketterlin
) ys.append(y) zs.append(z) Or even: xs,ys,zs = zip(*[ map(float,line.split()) for line in open('flooding-psiphi.dat','r') ]) You get tuples, though. Use map(list,zip(...)) if you need lists. Easy to update when you move to 4D data... -- Alain. -- https

Re: OT: This Swift thing

2014-06-07 Thread Alain Ketterlin
Sturla Molden sturla.mol...@gmail.com writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Sturla Molden sturla.mol...@gmail.com writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Many of these students suggest Python as the development language (they learned it and liked

Re: OT: This Swift thing

2014-06-07 Thread Alain Ketterlin
Mark Lawrence breamore...@yahoo.co.uk writes: On 07/06/2014 09:20, Alain Ketterlin wrote: Sturla Molden sturla.mol...@gmail.com writes: Many of these students suggest Python as the development language (they learned it and liked it), and the suggestion is (almost) always rejected, in favor

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Travis Griggs travisgri...@gmail.com writes: On Jun 5, 2014, at 1:14, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar to python's (ref. counting). Which makes me think that a subset of python with the same type safety would be an instant success

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Terry Reedy tjre...@udel.edu writes: On 6/5/2014 4:07 PM, Alain Ketterlin wrote: When I compile Cython modules I use LLVM on this computer. Cython is not Python, it is another language, with an incompatible syntax. Cython compiles Python with optional extensions that allow additional

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Sturla Molden sturla.mol...@gmail.com writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Many of these students suggest Python as the development language (they learned it and liked it), and the suggestion is (almost) always rejected, in favor of Java or C# or C/C

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Fri, Jun 6, 2014 at 7:23 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 05/06/2014 21:07, Alain Ketterlin wrote: Sturla Molden sturla.mol...@gmail.com writes: On 05/06/14 10:14, Alain Ketterlin wrote: Type safety. Perhaps. Python has

Re: OT: This Swift thing

2014-06-06 Thread Alain Ketterlin
Sturla Molden sturla.mol...@gmail.com writes: On 05/06/14 22:27, Alain Ketterlin wrote: I have seen dozens of projects where Python was dismissed because of the lack of static typing, and the lack of static analysis tools. [...] When is static analysis actually needed and for what purpose

Re: OT: This Swift thing

2014-06-05 Thread Alain Ketterlin
. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: This Swift thing

2014-06-05 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Thu, Jun 5, 2014 at 6:14 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar to python's (ref. counting). Which makes me think that a subset of python with the same type safety would be an instant success

Re: OT: This Swift thing

2014-06-05 Thread Alain Ketterlin
Sturla Molden sturla.mol...@gmail.com writes: On 05/06/14 10:14, Alain Ketterlin wrote: Type safety. Perhaps. Python has strong type safety. Come on. [...] (And with it comes better performance ---read battery life--- and better static analysis tools, etc.) Perhaps, perhaps not. My

Re: OT: This Swift thing

2014-06-05 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Thu, Jun 5, 2014 at 7:42 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Chris Angelico ros...@gmail.com writes: On Thu, Jun 5, 2014 at 6:14 PM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Swift's memory management is similar

Re: OT: This Swift thing

2014-06-05 Thread Alain Ketterlin
Chris Angelico ros...@gmail.com writes: On Fri, Jun 6, 2014 at 6:07 AM, Alain Ketterlin al...@dpt-info.u-strasbg.fr wrote: Perhaps, perhaps not. My experience is that only a small percentage of the CPU time is spent in the Python interpreter. Basically, you're saying that a major fraction

[issue21658] __m128, can't build 3.4.1 with intel 14.0.0

2014-06-05 Thread Alain Miniussi
Alain Miniussi added the comment: Some details... Environement: {{{ [alainm@gurney Python-3.4.1]$ ^Cconfigure --prefix=/softs/exp/python-3.4.1-intel14-fake [alainm@gurney Python-3.4.1]$ icc --version icc (ICC) 14.0.0 20130728 Copyright (C) 1985-2013 Intel Corporation. All rights reserved

[issue21658] __m128, can't build 3.4.1 with intel 14.0.0

2014-06-04 Thread Alain Miniussi
New submission from Alain Miniussi: In ffi64.c, intel 14.0.0 has an issue with: {{{ #if defined(__INTEL_COMPILER) #define UINT128 __m128 #else ... }}} At leat on Linux CentOS 6.5, an include directive is required for __m128: {{{ #if defined(__INTEL_COMPILER) #include xmmintrin.h #define UINT128

Re: Fortran

2014-05-14 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr: The real nice thing that makes Julia a different language is the optional static typing, which the JIT can use to produce efficient code. It's the only meaningful difference with the current state of python

Re: Fortran

2014-05-13 Thread Alain Ketterlin
Mark H Harris harrismh...@gmail.com writes: On 5/12/14 3:44 AM, Alain Ketterlin wrote: When you are doing scientific computation, this overhead is unacceptable, because you'll have zillions of computations to perform. I'm still trying to sort that out. I have not tested this yet

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

2014-05-12 Thread Alain Ketterlin
Mark H Harris harrismh...@gmail.com writes: On 5/11/14 12:05 PM, Alain Ketterlin wrote: Julia is Matlab and R, Python, Lisp, Scheme; all rolled together on steroids. Its amazing as a dynamic language, and its fast, like lightning fast as well as multiprocessing (parallel processing) at its

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

2014-05-11 Thread Alain Ketterlin
on her fellows. Well, Fortran experts around me are skeptic. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: How can this assert() ever trigger?

2014-05-10 Thread Alain Ketterlin
-162*1e-162. Equals zero. -- Alain. -- https://mail.python.org/mailman/listinfo/python-list

Re: parsing multiple root element XML into text

2014-05-09 Thread Alain Ketterlin
entity, though). If you have other XML processors in your workflow, they will/should reject it. The easiest fix is to wrap this inside a root element (see other messages in this thread), or use a DTD-declared entity to include this fragment in a document. -- Alain. -- https://mail.python.org

Re: parsing multiple root element XML into text

2014-05-09 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr: Technically speaking, this is not a well-formed XML document (it is a well-formed external general parsed entity, though). If you have other XML processors in your workflow, they will/should reject

Re: parsing multiple root element XML into text

2014-05-09 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr: Marko Rauhamaa ma...@pacujo.net writes: Sometimes the XML elements come through a pipe as an endless sequence. You can still use the wrapping technique and a SAX parser. However, the other option

Re: parsing multiple root element XML into text

2014-05-09 Thread Alain Ketterlin
Marko Rauhamaa ma...@pacujo.net writes: Alain Ketterlin al...@dpt-info.u-strasbg.fr: which does an exact traversal of potential the DOM tree... (assuming a DOM is even defined on a non well-formed XML document). Anyway, my point was only to warn the OP that he is not doing XML. I consider

[issue21301] pathlib missing Path.expandvars(env=os.environ)

2014-04-18 Thread Alain Mellan
New submission from Alain Mellan: A lot of times paths are manipulated with environment variables that may even be expanded multiple times in a loop. For example, I have a path defined as $RUNDIR/logfile.txt and expanding the path for a bunch of different RUNDIRs in a loop. By default

  1   2   3   4   >