RE: Visit All URLs with selenium python

2017-04-12 Thread Deborah Swanson
Nicole wrote, on Wednesday, April 12, 2017 11:05 PM > > Hi Deborah, >I checked again selecting css there found 11 URLS and I > printed it is printing all urls but it visits the first url not all.. Hmm. Sounds like you've changed your code in some way. Either changing the web page you're poi

RE: Visit All URLs with selenium python

2017-04-12 Thread Deborah Swanson
Nicole wrote, on Wednesday, April 12, 2017 11:05 PM > > Hi Deborah, >I checked again selecting css there found 11 URLS and I > printed it is printing all urls but it visits the first url not all.. I'm just guessing again, but time.sleep(4) could be too long a time to sleep, especi

RE: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Peter Otten
Deborah Swanson wrote: > It's a small point, but I suspect getattr(record, label) would still > fail, even if label's value is 'label' and only 'label', but what's the > point of having a variable if it will only ever have just one value? You are misunderstanding. Your getattr() call fails becaus

Re: Python and the need for speed

2017-04-12 Thread Steven D'Aprano
On Wed, 12 Apr 2017 14:38:52 +0100, Ben Bacarisse wrote: > Steve D'Aprano writes: > >> On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote: >> >>> I still do my everyday stuff in Python and I'd like to get more >>> conversant with stuff like numpy, but it feels like an old-fashioned >>> language thes

RE: Visit All URLs with selenium python

2017-04-12 Thread Deborah Swanson
Nicole wrote, on Wednesday, April 12, 2017 11:03 PM > > from selenium.webdriver.firefox.firefox_profile import > FirefoxProfile import random from selenium import webdriver > from selenium.webdriver.common.keys import Keys Ok, that gives us a clue what you're working with, which will probably h

Re: Python and the need for speed

2017-04-12 Thread Gregory Ewing
Jussi Piitulainen wrote: Traceback (most recent call last): File "/dev/fd/63", line 37, in SanityClauseException: code is blatantly sub-optimal As far as I know, no language does that. Because reasons? Because the problem of making a compiler do that is probably AI-complete! -- Greg -- htt

Re: Merging multiple sorted sequences.

2017-04-12 Thread Peter Otten
Erik wrote: > Hi Peter, > > On 12/04/17 23:42, Peter Otten wrote: >> Erik wrote: >> >>> I need to be able to lazily merge a variable number of already-sorted(*) >>> variable-length sequences into a single sorted sequence. >> >> https://docs.python.org/dev/library/heapq.html#heapq.merge > > AFAIC

Re: Visit All URLs with selenium python

2017-04-12 Thread Nicole
Here you can see now from selenium.webdriver.firefox.firefox_profile import FirefoxProfile import random from selenium import webdriver from selenium.webdriver.common.keys import Keys browser.get('https://www.google.co.uk/search?q=Rashmi&oq=Rashmi&aqs=chrome..69i57j69i60l3.6857j0j1&sourceid=c

Re: Python and the need for speed

2017-04-12 Thread Gregory Ewing
bart4...@gmail.com wrote: (Although I think Python would have difficulty in turning x+=1 into a single opcode, if using normal object references and a shared object model.) The ADD_ONE opcode would have to be defined to have the same effect as the sequence emitted for x+=1, including all the dy

Re: Calling dunder methods manually

2017-04-12 Thread Rustom Mody
On Thursday, April 13, 2017 at 11:00:03 AM UTC+5:30, Steven D'Aprano wrote: > Should you call dunder methods (Double leading and trailing UNDERscores) > manually? For example: > > > my_number.__add__(another_number) > > > The short answer is: > > NO! In general, you shouldn't do it. > > > G

Re: Visit All URLs with selenium python

2017-04-12 Thread Nicole
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile import random from selenium import webdriver from selenium.webdriver.common.keys import Keys -- https://mail.python.org/mailman/listinfo/python-list

Re: Visit All URLs with selenium python

2017-04-12 Thread Nicole
Hi Deborah, I checked again selecting css there found 11 URLS and I printed it is printing all urls but it visits the first url not all.. -- https://mail.python.org/mailman/listinfo/python-list

Calling dunder methods manually

2017-04-12 Thread Steven D'Aprano
Should you call dunder methods (Double leading and trailing UNDERscores) manually? For example: my_number.__add__(another_number) The short answer is: NO! In general, you shouldn't do it. Guido recently commented: I agree that one shouldn't call __init__ manually (and in fact Python

RE: Visit All URLs with selenium python

2017-04-12 Thread Deborah Swanson
Nicole wrote, on Wednesday, April 12, 2017 9:49 PM > > browser.get('https://www.google.co.uk/search?q=Rashmi&oq=Rashm > i&aqs=chrome..69i57j69i60l3.6857j0j1&sourceid=chrome&ie=UTF-8# q=Rashmi+Custom+Tailors') > time.sleep(5) > > try: > p_links = > brow

Re: Python and the need for speed

2017-04-12 Thread Jussi Piitulainen
bart4...@gmail.com writes: > On Wednesday, 12 April 2017 16:50:01 UTC+1, Jussi Piitulainen wrote: >> bart4...@gmail.com writes: >> >> > On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen wrote: >> >> bartc writes: >> >> >> > >> >> > These are straightforward language enhancements. >

Visit All URLs with selenium python

2017-04-12 Thread Nicole
browser.get('https://www.google.co.uk/search?q=Rashmi&oq=Rashmi&aqs=chrome..69i57j69i60l3.6857j0j1&sourceid=chrome&ie=UTF-8#q=Rashmi+Custom+Tailors') time.sleep(5) try: p_links = browser.find_elements_by_css_selector('div > h3 > a') url_list

Re: Merging multiple sorted sequences.

2017-04-12 Thread Paul Rubin
Erik writes: > I need to be able to lazily merge a variable number of > already-sorted(*) variable-length sequences If the number of sequences is large, the traditional way is with the heapq module. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-12 Thread Paul Rubin
Michael Torrie writes: > Equivalent to the JNI and Lisp FFI is the CFFI [1]. The JNI, the FFI, > and the CFFI, are all for calling native code from within their > respective languages, if I understand correctly. They don't define a > standard way for native code to call into these languages. Th

Re: Python and the need for speed

2017-04-12 Thread Paul Rubin
Marko Rauhamaa writes: > Traditionally, disk access in Linux has been considered nonblocking. > There is AIO, but that hasn't been used much. AIO is asynchronous but it's for dealing with already-opened files. There doesn't seem to be a way to asynchronously OPEN a file. > I believe the lack of

Re: Python and the need for speed

2017-04-12 Thread Paul Rubin
Brecht Machiels writes: > However, rinohtype is located in a very different niche and it would > greatly benefit a lot from a speed boost. Rendering the Sphinx > documentation (311 pages) takes almost 10 minutes on my i7 Yikes... > As for moving to a compiled language (Nim or Rust would be inter

Re: closing image automatically in for loop , python

2017-04-12 Thread William Ray Wing
> On Apr 12, 2017, at 7:18 AM, Masoud Afshari wrote: > > Dear all > > I have several *.sfd files which created by a simulation code. I wrote a > program containing a for Loop which reads each time one .sfd file and plot > the requested Parameters. I have two request: > > 1- my Problem is t

Re: Python Command Line Arguments

2017-04-12 Thread ian . stegner
On Thursday, April 13, 2017 at 12:38:48 PM UTC+10, MRAB wrote: > On 2017-04-13 02:59, ian.steg...@gmail.com wrote: > > I have this code which I got from > > https://www.tutorialspoint.com/python/python_command_line_arguments.htm The > > example works fine but when I modify it to what I need, it o

Re: Merging multiple sorted sequences.

2017-04-12 Thread Cameron Simpson
On 12Apr2017 23:15, Erik wrote: I need to be able to lazily merge a variable number of already-sorted(*) variable-length sequences into a single sorted sequence. The merge should continue until the longest sequence has been exhausted. (*) They may in practice be a lazy source of data known to

Re: homework confusion

2017-04-12 Thread MRAB
On 2017-04-13 03:13, Lauren Fugate wrote: [snip] Read the last 2 paragraphs again: ""So you should be able to create Lockable objects with commands* like Lockable("front door", "in the foyer", house_key, False, True) (returning an object that starts out closed and locked), or Lockable("diary"

Re: homework confusion

2017-04-12 Thread Jason Friedman
> > The example command is: Lockable("diary", "under Sam's bed", tiny_key, > True) > > And I keep getting a NameError: tiny_key is not defined. > > What do I do? > Without knowing what your professor intends this is a guess: define tiny_key. For example tiny_key = "some string" thing = Lockable

Re: Python Command Line Arguments

2017-04-12 Thread MRAB
On 2017-04-13 02:59, ian.steg...@gmail.com wrote: I have this code which I got from https://www.tutorialspoint.com/python/python_command_line_arguments.htm The example works fine but when I modify it to what I need, it only half works. The problem is the try/except. If you don't specify an inp

Re: Moderating the list [was: Python and the need for speed]

2017-04-12 Thread Jason Friedman
> > However, it's simply a technical fact: the thing which we moderate is the >> mailing list. We can control which posts make it through from the newsgroup >> by blocking them at the gateway. But the posts will continue to appear on >> comp.lang.python which is, as the description says, unmoderate

Re: Merging multiple sorted sequences.

2017-04-12 Thread Terry Reedy
On 4/12/2017 7:15 PM, Erik wrote: Hi Peter, On 12/04/17 23:42, Peter Otten wrote: Erik wrote: I need to be able to lazily merge a variable number of already-sorted(*) variable-length sequences into a single sorted sequence. https://docs.python.org/dev/library/heapq.html#heapq.merge AFAICT

Re: Python Command Line Arguments

2017-04-12 Thread Jason Friedman
> > I have this code which I got from https://www.tutorialspoint. > com/python/python_command_line_arguments.htm The example works fine but > when I modify it to what I need, it only half works. The problem is the > try/except. If you don't specify an input/output, they are blank at the end > but i

homework confusion

2017-04-12 Thread Lauren Fugate
Hello! So I have a homework assignment that I can't seem to understand. The problems are talking about classes and subclasses. My issue is that the examples use objects as arguments and I don't know how to make that happen without getting a name error. The question is: Create a subclass of Open

Python Command Line Arguments

2017-04-12 Thread ian . stegner
I have this code which I got from https://www.tutorialspoint.com/python/python_command_line_arguments.htm The example works fine but when I modify it to what I need, it only half works. The problem is the try/except. If you don't specify an input/output, they are blank at the end but it shouldn

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread jfong
Peter Otten at 2017/4/12 UTC+8 PM 8:13:53 wrote: > I should add that you can write > > lr = [[1], [0]] > lx = [] > for i in range(len(lr)): > > ... lx = lr[i][:] > > ... lx.append(0) > > ... lr[i].append(1) > > ... lr.append(lx) > > ... > lr > >[[1, 1], [0, 1],

Re: Merging multiple sorted sequences.

2017-04-12 Thread Erik
Hi Ian, On 13/04/17 00:09, Erik wrote: On 12/04/17 23:44, Ian Kelly wrote: I would just use "lowest = min(items, key=itemgetter(0))". I had it in my head for some reason that min() would return the smallest key, not the object (and hence I wouldn't be able to know which sequence object to get

Re: "Goto" statement in Python

2017-04-12 Thread Rob Gaddi
On 04/12/2017 04:42 PM, Mikhail V wrote: On 12 April 2017 at 02:44, Nathan Ernst wrote: goto is a misunderstood and much misaligned creature. It is a very useful feature, but like nearly any programming construct can be abused. Constructs like 'break', 'continue' or 'next' in languages like Py

RE: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Deborah Swanson
Deborah Swanson wrote, on Wednesday, April 12, 2017 4:29 PM > > Peter Otten wrote, on Wednesday, April 12, 2017 3:15 PM > > > > >> Indeed you cannot change the namedtuple's attributes. Like the > > >> "normal" tuple it is designed to be immutable. If you want changes in > > >> one list (the grou

"Goto" statement in Python

2017-04-12 Thread Mikhail V
On 12 April 2017 at 02:44, Nathan Ernst wrote: > goto is a misunderstood and much misaligned creature. It is a very useful > feature, but like nearly any programming construct can be abused. > > Constructs like 'break', 'continue' or 'next' in languages like Python or > C/C++ are goto's with impli

Re: Python and the need for speed

2017-04-12 Thread bart4858
On Thursday, 13 April 2017 00:09:35 UTC+1, Gregory Ewing wrote: > bart4...@gmail.com wrote: > > > But the language can also play a part in not allowing certain things to be > > expressed naturally. So the for-loop in the example has to have a > > control-variable even if it's not referenced. > >

RE: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Deborah Swanson
Peter Otten wrote, on Wednesday, April 12, 2017 3:15 PM > > Deborah Swanson wrote: > > >> >value = getattr(record, label) > >> > >> That should work. > > > > We may agree that it *should* work, by an intuitive grasp of how it > > should work, but it doesn't. You get "object has no attribute 'la

Re: Merging multiple sorted sequences.

2017-04-12 Thread Erik
Hi Peter, On 12/04/17 23:42, Peter Otten wrote: Erik wrote: I need to be able to lazily merge a variable number of already-sorted(*) variable-length sequences into a single sorted sequence. https://docs.python.org/dev/library/heapq.html#heapq.merge AFAICT (looking at the Python 3.5 heapq i

Re: Merging multiple sorted sequences.

2017-04-12 Thread Erik
On 12/04/17 23:44, Ian Kelly wrote: This might be okay since Timsort on an already-sorted list should be O(n). But there's not really any need to keep them sorted and I would just use "lowest = min(items, key=itemgetter(0))". Sure (and this was my main worry). I had it in my head for some reaso

Re: Python and the need for speed

2017-04-12 Thread Gregory Ewing
bart4...@gmail.com wrote: But the language can also play a part in not allowing certain things to be expressed naturally. So the for-loop in the example has to have a control-variable even if it's not referenced. If the compiler can recognise when code is "stupid", it's probably capable of doi

Re: Merging multiple sorted sequences.

2017-04-12 Thread Ian Kelly
On Wed, Apr 12, 2017 at 4:44 PM, Ian Kelly wrote: > On Wed, Apr 12, 2017 at 4:15 PM, Erik wrote: >> while len(items) > 1: >> items.sort(key=lambda item: item[0]) > > This might be okay since Timsort on an already-sorted list should be > O(n). But there's not really any need to keep th

Re: Merging multiple sorted sequences.

2017-04-12 Thread Ian Kelly
On Wed, Apr 12, 2017 at 4:15 PM, Erik wrote: > Hi. > > I need to be able to lazily merge a variable number of already-sorted(*) > variable-length sequences into a single sorted sequence. The merge should > continue until the longest sequence has been exhausted. > > (*) They may in practice be a la

Re: Merging multiple sorted sequences.

2017-04-12 Thread Peter Otten
Erik wrote: > I need to be able to lazily merge a variable number of already-sorted(*) > variable-length sequences into a single sorted sequence. https://docs.python.org/dev/library/heapq.html#heapq.merge -- https://mail.python.org/mailman/listinfo/python-list

RE: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Peter Otten
Deborah Swanson wrote: >> >value = getattr(record, label) >> >> That should work. > > We may agree that it *should* work, by an intuitive grasp of how it > should work, but it doesn't. You get "object has no attribute 'label'. Only if the namedtuple (1) does not have a label attribute and (2)

Merging multiple sorted sequences.

2017-04-12 Thread Erik
Hi. I need to be able to lazily merge a variable number of already-sorted(*) variable-length sequences into a single sorted sequence. The merge should continue until the longest sequence has been exhausted. (*) They may in practice be a lazy source of data known to only ever be generated in

RE: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Deborah Swanson
Peter Otten wrote, on Wednesday, April 12, 2017 1:45 PM > > Deborah Swanson wrote: > > > I won't say the following points are categorically true, but I became > > convinced enough they were true in this instance that I abandoned the > > advised strategy. Which was to use defaultdict to group th

Re: external process not terminating

2017-04-12 Thread Larry Martell
On Wed, Apr 12, 2017 at 10:51 AM, Dennis Lee Bieber wrote: > On Wed, 12 Apr 2017 09:51:12 -0400, Larry Martell > declaimed the following: > > >> >>Anyone know how I can get the external process to terminate when done? >> > > It has... You just haven't cleaned up after it... > > https://en

Re: Passing parameters thru decorators

2017-04-12 Thread Peter Otten
andrew.hol...@otternetworks.de wrote: > Hi, > > I'm trying to work out how to pass parameters through decorators: > > class Meow(): > > def __init__(self, arg1, arg2): > print("INIT ClassBasedDecoratorWithParams") > print(arg1) > print(arg2) > > def makebold(sel

RE: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Deborah Swanson
> -Original Message- > From: Python-list > [mailto:python-list-bounces+python=deborahswanson.net@python.o > rg] On Behalf Of MRAB > Sent: Wednesday, April 12, 2017 1:42 PM > To: python-list@python.org > Subject: Re: Namedtuples: some unexpected inconveniences > > > On 2017-04-12 20:57,

Re: Passing parameters thru decorators

2017-04-12 Thread MRAB
On 2017-04-12 21:42, andrew.hol...@otternetworks.de wrote: Hi, I'm trying to work out how to pass parameters through decorators: class Meow(): def __init__(self, arg1, arg2): print("INIT ClassBasedDecoratorWithParams") print(arg1) print(arg2) def makebold(

Re: Namedtuples: some unexpected inconveniences

2017-04-12 Thread Peter Otten
Deborah Swanson wrote: > I won't say the following points are categorically true, but I became > convinced enough they were true in this instance that I abandoned the > advised strategy. Which was to use defaultdict to group the list of > namedtuples by one of the fields for the purpose of determi

Passing parameters thru decorators

2017-04-12 Thread andrew . holway
Hi, I'm trying to work out how to pass parameters through decorators: class Meow(): def __init__(self, arg1, arg2): print("INIT ClassBasedDecoratorWithParams") print(arg1) print(arg2) def makebold(self, fn): def wrapped(): return "" +

Re: Namedtuples: some unexpected inconveniences

2017-04-12 Thread MRAB
On 2017-04-12 20:57, Deborah Swanson wrote: I won't say the following points are categorically true, but I became convinced enough they were true in this instance that I abandoned the advised strategy. Which was to use defaultdict to group the list of namedtuples by one of the fields for the purp

Namedtuples: some unexpected inconveniences

2017-04-12 Thread Deborah Swanson
I won't say the following points are categorically true, but I became convinced enough they were true in this instance that I abandoned the advised strategy. Which was to use defaultdict to group the list of namedtuples by one of the fields for the purpose of determining whether certain other field

Re: Python and the need for speed

2017-04-12 Thread bart4858
On Wednesday, 12 April 2017 16:04:53 UTC+1, Brecht Machiels wrote: > On 2017-04-12 14:46:45 +, Michael Torrie said: > It would be great if you could run the benchmark I mention in my first > link and share the results. Highly appreciated! Were you ever able to isolate what it was that's tak

Re: XML tree to a pandas dataframe

2017-04-12 Thread Chris Angelico
On Thu, Apr 13, 2017 at 12:54 AM, David Shi via Python-list wrote: > What is the best way to convert XML document into a pandas dataframe? > Regards. > David I don't know. What's the least painful way to gouge out my eyes with a rusty fork? You're going to need to know the layout of the XML doc

Re: Python and the need for speed

2017-04-12 Thread bart4858
On Wednesday, 12 April 2017 16:50:01 UTC+1, Jussi Piitulainen wrote: > bart4...@gmail.com writes: > > > On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen wrote: > >> bartc writes: > >> > > > >> > These are straightforward language enhancements. > >> > >> FYI, the question is not ho

HOT LIST

2017-04-12 Thread Jack
Hi Hope you doing great! Greeting from Niche Soft Solutions. I would like to present our topnotch consultants currently available. Please have a look at the below hot list of Niche Soft Solutions an

Re: IOError: [Errno 12] Not enough space

2017-04-12 Thread Irmen de Jong
On 12-4-2017 7:54, LnT wrote: > > Hi Irmen, > > you may please find full log @ https://pastebin.mozilla.org/9018753 I have no idea what I'm looking at. But my initial response was wrong, see the reply by eryk sun; your error has nothing to do with disk space but rather, a lack of system memory

Re: Python and the need for speed

2017-04-12 Thread Jussi Piitulainen
bart4...@gmail.com writes: > On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen wrote: >> bartc writes: >> > >> > These are straightforward language enhancements. >> >> FYI, the question is not how to optimize the code but how to prevent >> the programmer from writing stupid code in

How to pd.read_csv into a DataFrame with multiple seperators?

2017-04-12 Thread David Shi via Python-list
Have a look at this example. http://www.ebi.ac.uk/ena/data/warehouse/search?query=%22geo_circ(-0.587,-90.5713,170)%22&result=sequence_release&display=text How to pd.read_csv into a DataFrame with multiple seperators? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: closing image automatically in for loop , python

2017-04-12 Thread Frank Miles
On Wed, 12 Apr 2017 04:18:45 -0700, Masoud Afshari wrote: > filename ="Ex_resample" +'_sdf_'+ str(n)+'.dat' > with open(filename, 'rb') as f: #read binary file data = np.fromfile(f, > dtype='float64', count=nx*ny) #float64 for Double precision float numbers > Ex = np.reshape(data, [ny, nx], ord

Re: Python and the need for speed

2017-04-12 Thread Brecht Machiels
On 2017-04-12 14:46:45 +, Michael Torrie said: On 04/12/2017 03:33 AM, Brecht Machiels wrote: However, rinohtype is located in a very different niche and it would greatly benefit a lot from a speed boost. Rendering the Sphinx documentation (311 pages) takes almost 10 minutes on my i7, which

XML tree to a pandas dataframe

2017-04-12 Thread David Shi via Python-list
What is the best way to convert XML document into a pandas dataframe? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-12 Thread Michael Torrie
On 04/11/2017 06:38 PM, Paul Rubin wrote: > Grant Edwards writes: >> If there are now other Python implementations (e.g. MicroPython) with >> C APIs that differ from CPython, then it seems like it is no longer >> redundant to say "the CPython API". > > Perhaps there should be an attempt to define

Re: Python and the need for speed

2017-04-12 Thread Michael Torrie
On 04/12/2017 03:33 AM, Brecht Machiels wrote: > However, rinohtype is located in a very different niche and it would > greatly benefit a lot from a speed boost. Rendering the Sphinx > documentation (311 pages) takes almost 10 minutes on my i7, which is > simply too long given the available proc

external process not terminating

2017-04-12 Thread Larry Martell
I have an app (using 2.7) that processes requests. When a request of type "A" is received I need to start an external process. When a request of type "B" is received I need to check and see if that external process has completed or not and then do some stuff depending on if it has or not. The iss

Re: Python and the need for speed

2017-04-12 Thread Rustom Mody
On Wednesday, April 12, 2017 at 7:09:04 PM UTC+5:30, Ben Bacarisse wrote: > Steve D'Aprano writes: > > > On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote: > > > >> I still do my everyday stuff in Python and I'd like to get more > >> conversant with stuff like numpy, but it feels like an old-fashion

Re: Python and the need for speed

2017-04-12 Thread bart4858
On Wednesday, 12 April 2017 12:56:32 UTC+1, Jussi Piitulainen wrote: > bartc writes: > > > These are straightforward language enhancements. > > FYI, the question is not how to optimize the code but how to prevent the > programmer from writing stupid code in the first place. Someone > suggested

Re: Python and the need for speed

2017-04-12 Thread Ben Bacarisse
Steve D'Aprano writes: > On Wed, 12 Apr 2017 03:39 am, Paul Rubin wrote: > >> I still do my everyday stuff in Python and I'd like to get more >> conversant with stuff like numpy, but it feels like an old-fashioned >> language these days. > > "Old fashioned"? With await/async just added to the lan

Re: IOError: [Errno 12] Not enough space

2017-04-12 Thread LnT
On Wednesday, April 12, 2017 at 11:13:22 AM UTC+5:30, LnT wrote: > Hello eryk sun, > Thanks so much for your input. > > could you please advice. > 1) Any workaround for this issue ? > 2) is it good to report issue in Windows OS help desk ? > > Regards, > LnT > > > > On Wednesday, April 12, 201

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread Peter Otten
jf...@ms4.hinet.net wrote: > Peter Otten at 2017/4/12 UTC+8 PM 4:41:36 wrote: >> jf...@ms4.hinet.net wrote: >> >> Assuming both x and y are lists >> >> x[:] = y >> >> replaces the items in x with the items in y while >> >> >> x = y[:] >> >> makes a copy of y and binds that to the name x. In

Re: Python and the need for speed

2017-04-12 Thread Jussi Piitulainen
bart4...@gmail.com writes: > On Wednesday, 12 April 2017 10:57:10 UTC+1, bart...@gmail.com wrote: >> On Wednesday, 12 April 2017 07:48:57 UTC+1, Steven D'Aprano wrote: > >> > for i in range(10): >> > answer += 1 > >> > So... how exactly does the compiler prohibit stupid code? > >> An

Re: Swiss Ephemeris

2017-04-12 Thread jmp
On 04/10/2017 07:29 AM, Deborah Swanson wrote: Fully recognizing that most of what you wrote was tongue-in-cheek, I just want to say that regardless of the wonders of modern medicine, it's a pity they learn so little about successful medicines other than their own. In other academic scientific di

Re: Python and the need for speed

2017-04-12 Thread bart4858
On Wednesday, 12 April 2017 10:57:10 UTC+1, bart...@gmail.com wrote: > On Wednesday, 12 April 2017 07:48:57 UTC+1, Steven D'Aprano wrote: > > for i in range(10): > > answer += 1 > > So... how exactly does the compiler prohibit stupid code? > And this lookup happens for every loop i

closing image automatically in for loop , python

2017-04-12 Thread Masoud Afshari
Dear all I have several *.sfd files which created by a simulation code. I wrote a program containing a for Loop which reads each time one .sfd file and plot the requested Parameters. I have two request: 1- my Problem is that for Showing successive Images in for Loop I have to Close the Ima

PyDev 5.7.0 Released

2017-04-12 Thread Fabio Zadrozny
PyDev 5.7.0 Release Highlights --- * **Important** PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards. * PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars). * **PyLint** * The PyLint integration is much improved. * Working along with the PyDev co

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread jfong
Peter Otten at 2017/4/12 UTC+8 PM 4:41:36 wrote: > jf...@ms4.hinet.net wrote: > > Assuming both x and y are lists > > x[:] = y > > replaces the items in x with the items in y while > > > x = y[:] > > makes a copy of y and binds that to the name x. In both cases x and y remain > different li

Re: Python and the need for speed

2017-04-12 Thread Marko Rauhamaa
bart4...@gmail.com: > On Wednesday, 12 April 2017 07:48:57 UTC+1, Steven D'Aprano wrote: >> Here's another example: >> >> answer = 0 >> for i in range(10): >> answer += 1 >> >> instead of >> >> answer = 10 >> >> So... how exactly does the compiler prohibit stupid code? >

Re: Python and the need for speed

2017-04-12 Thread Marko Rauhamaa
Paul Rubin : > I'd be interested to know how to open a disk file asynchronously in a > single-threaded Python program under Linux. As far as I can tell there > is no way to do it. Traditionally, disk access in Linux has been considered nonblocking. There is AIO, but that hasn't been used much. I h

Re: CPython Class variable exposed to Python is altered.

2017-04-12 Thread Vincent Vande Vyvre
Le 12/04/17 à 11:47, Peter Otten a écrit : Vincent Vande Vyvre wrote: No, no warning. For the truth, this code is copy-pasted from the doc. https://docs.python.org/3.5//extending/newtypes.html#adding-data-and-methods-to-the-basic-example But the example expects objects (the big O), not str

Re: Python and the need for speed

2017-04-12 Thread bart4858
On Wednesday, 12 April 2017 07:48:57 UTC+1, Steven D'Aprano wrote: > On Tue, 11 Apr 2017 21:10:56 -0700, Rick Johnson wrote: > > > high level languages like Python should make it difficult, if not > > impossible, to write sub- > > optimal code (at least in the blatantly obvious cases). > > Here

Re: CPython Class variable exposed to Python is altered.

2017-04-12 Thread Peter Otten
Vincent Vande Vyvre wrote: > Le 12/04/17 à 10:51, Peter Otten a écrit : >> Vincent Vande Vyvre wrote: >> >>> Le 12/04/17 à 08:57, Vincent Vande Vyvre a écrit : Hi, Learning CPython, I've made this simple exercice, a module test which contains an object Test. The objec

Re: Python and the need for speed

2017-04-12 Thread Brecht Machiels
On 2017-04-11 14:56:33 +, Steve D'Aprano said: On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote: Hey! This random, ignorant blogger has feelings too! :-) Hi, and welcome! Sorry, I wasn't *specifically* referring to you, except in the sense that you aren't a compiler expert. That's

Re: Python and the need for speed

2017-04-12 Thread alister
On Tue, 11 Apr 2017 16:31:16 -0700, Rick Johnson wrote: > On Tuesday, April 11, 2017 at 9:56:45 AM UTC-5, Steve D'Aprano wrote: >> On Tue, 11 Apr 2017 07:56 pm, Brecht Machiels wrote: >> > On 2017-04-11 08:19:31 +, Steven D'Aprano said: >> > >> > I understand that high performance was never a

Re: CPython Class variable exposed to Python is altered.

2017-04-12 Thread Vincent Vande Vyvre
Le 12/04/17 à 10:51, Peter Otten a écrit : Vincent Vande Vyvre wrote: Le 12/04/17 à 08:57, Vincent Vande Vyvre a écrit : Hi, Learning CPython, I've made this simple exercice, a module test which contains an object Test. The object Test has an attribute name, fixed at instanciation. So, I tr

Re: CPython Class variable exposed to Python is altered.

2017-04-12 Thread Peter Otten
Vincent Vande Vyvre wrote: > Le 12/04/17 à 08:57, Vincent Vande Vyvre a écrit : >> Hi, >> >> Learning CPython, I've made this simple exercice, a module test which >> contains an object Test. >> >> The object Test has an attribute name, fixed at instanciation. >> >> So, I try my code with a script:

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread Peter Otten
jf...@ms4.hinet.net wrote: Assuming both x and y are lists x[:] = y replaces the items in x with the items in y while x = y[:] makes a copy of y and binds that to the name x. In both cases x and y remain different lists, but in only in the second case x is rebound. This becomes relevant wh

Re: What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread alister
On Wed, 12 Apr 2017 01:08:07 -0700, jfong wrote: > I have a list of list and like to expand each "list element" by > appending a 1 and a 0 to it. For example, from "lr = [[1], [0]]" expand > to "lr = [[1,1], [0,1], [1,0], [0,0]]". > > The following won't work: > > Python 3.4.4 (v3.4.4:737efcadf5

What is the difference between x[:]=y and x=y[:]?

2017-04-12 Thread jfong
I have a list of list and like to expand each "list element" by appending a 1 and a 0 to it. For example, from "lr = [[1], [0]]" expand to "lr = [[1,1], [0,1], [1,0], [0,0]]". The following won't work: Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win

Re: Inclusion of of python and python libraries licensed with BSD- 3 clause license in proprietary software

2017-04-12 Thread Abhishek Kumar
On Wednesday, 12 April 2017 07:12:27 UTC+5:30, Steve D'Aprano wrote: > On Wed, 12 Apr 2017 06:35 am, Abhishek Kumar wrote: > > > Hello, > > > > I tried finding the answer but even the lawyers in my town have no idea > > Where is your town? > > > > about it and searching the web leaved me puz

Re: CPython Class variable exposed to Python is altered.

2017-04-12 Thread Vincent Vande Vyvre
Le 12/04/17 à 08:57, Vincent Vande Vyvre a écrit : Hi, Learning CPython, I've made this simple exercice, a module test which contains an object Test. The object Test has an attribute name, fixed at instanciation. So, I try my code with a script: --- f

CPython Class variable exposed to Python is altered.

2017-04-12 Thread Vincent Vande Vyvre
Hi, Learning CPython, I've made this simple exercice, a module test which contains an object Test. The object Test has an attribute name, fixed at instanciation. So, I try my code with a script: --- from test import Test for n in ("The name", "Foo", "

Re: Python and the need for speed

2017-04-12 Thread Ian Kelly
On Tue, Apr 11, 2017 at 8:08 PM, Steve D'Aprano wrote: > Comprehensions may have been around for a decade or two in Haskell, but most > older languages don't have them. I'm pretty sure Java doesn't. Java does not have comprehensions per se, but the Streams API introduced in Java 8 is similar in c