Re: one-element tuples

2016-04-11 Thread Larry Hudson via Python-list
On 04/10/2016 08:19 PM, Fillmore wrote: Thank you for trying to help, Martin. So: On 04/10/2016 09:08 PM, Martin A. Brown wrote: #1: I would not choose eval() except when there is no other solution. If you don't need eval(), it may save you some headache in the future, as well, to f

Re: Python,ping,csv

2016-04-11 Thread Jason Friedman
> I added a line. > I would need to put the output into a csv file which contained the > results of the hosts up and down. > Can you help me? > > import subprocess > from ipaddress import IPv4Network > for address in IPv4Network('10.24.59.0/24').hosts(): > a = str(address) > res = sub

Re: Python,ping,csv

2016-04-11 Thread Jason Friedman
> I added a line. > I would need to put the output into a csv file which contained the results > of the hosts up and down. > Can you help me? > > > import subprocess > from ipaddress import IPv4Network > for address in IPv4Network('10.24.59.0/24').hosts(): > a = str(address) > res =

Re: REMOVE ME

2016-04-11 Thread Chris Angelico
On Tue, Apr 12, 2016 at 9:10 AM, Steven D'Aprano wrote: > Hence "self.things" will return the same > list each time, the one defined as a class attribute, regardless of > which "self" does the lookup. > > If a method were to assign to the attribute, for example "self.things = []", > that would cre

Please use the Python Job Board for recruitment (was: !! Immediate Position:Technical Consultant at (The Woodlands, TX) !!)

2016-04-11 Thread Ben Finney
sourav524.itsci...@gmail.com writes: > Please go through the below job description and let me know your interest. This forum should not be used for job seeking or recruitment. Please use the Python Job Board, which exists specifically for that https://www.python.org/jobs/>. -- \ “Don't be

Re: OT: Anyone here use the ConEmu console app?

2016-04-11 Thread DFS
On 4/11/2016 6:04 PM, 20/20 Lab wrote: win+alt+space does not work? ctrl+alt+win+space? http://conemu.github.io/en/KeyboardShortcuts.html Says those are not configurable, so they should work. Neither of those worked, but Ctrl+~ did. Thankyouthankyouthankyou On 04/11/2016 02:49 PM, DFS

!! Immediate Position:Technical Consultant at (The Woodlands, TX) !!

2016-04-11 Thread sourav524 . itscient
Hi All , Please go through the below job description and let me know your interest. Position: Technical Consultant Location: The Woodlands, TX Duration: 6+ Months Requisition Details: Job Description:- QUALIFICATIONS

"unable to find vcvarsall.bat"

2016-04-11 Thread Terry Reedy
Blog post by Steve Dower of Microsoft and CPython core developer. '''How to deal with the pain of “unable to find vcvarsall.bat”''' https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/ Explains the message and the two solutions: get the needed C compiler; g

Re: REMOVE ME

2016-04-11 Thread Steven D'Aprano
On Tue, 12 Apr 2016 08:44 am, John Pote wrote: > On 10/04/2016 04:52, Chris Angelico wrote: >> On Sun, Apr 10, 2016 at 1:46 PM, fan nie wrote: >>> -- >>> https://mail.python.org/mailman/listinfo/python-list >> Sure. I presume you mean something like this: >> >> class Thing: >> things = [] >>

Re: REMOVE ME

2016-04-11 Thread John Pote
On 10/04/2016 04:52, Chris Angelico wrote: On Sun, Apr 10, 2016 at 1:46 PM, fan nie wrote: -- https://mail.python.org/mailman/listinfo/python-list Sure. I presume you mean something like this: class Thing: things = [] def __init__(self): self.things.append(self) def __

Re: OT: Anyone here use the ConEmu console app?

2016-04-11 Thread 20/20 Lab
win+alt+space does not work? ctrl+alt+win+space? http://conemu.github.io/en/KeyboardShortcuts.html Says those are not configurable, so they should work. On 04/11/2016 02:49 PM, DFS wrote: I turned on the Quake-style option (and auto-hide when it loses focus) and it disappeared and I can't fig

OT: Anyone here use the ConEmu console app?

2016-04-11 Thread DFS
I turned on the Quake-style option (and auto-hide when it loses focus) and it disappeared and I can't figure out how to get it back onscreen. I think there's a keystroke combo (like Win+key) but I don't know what it is. It shows in the Task Manager Processses, but not in the Alt+Tab list. Unin

Re: python pandas convert strings to datetime problems

2016-04-11 Thread Peter Otten
Daiyue Weng wrote: > Hi, I need to compare the years in a Series. The values in the Series is > like '1996', '2015', '2006-01-02' or '20130101' etc. The code I created > is, > > col_value_series = pd.to_datetime(col_value_series, > infer_datetime_format=True) min_year = col_value_series.min().yea

Re: Is threading better on Usenet or gmane?

2016-04-11 Thread Grant Edwards
On 2016-04-11, Grant Edwards wrote: > On 2016-04-11, Grant Edwards wrote: > > I just finished checking a very recent thread containing 67 articles > by pointing slrn at news.panix.com for the Usenet version and at > news.gmane.com for the mailing-list version. [...] > On the Usenet side, 35 of 67

python pandas convert strings to datetime problems

2016-04-11 Thread Daiyue Weng
Hi, I need to compare the years in a Series. The values in the Series is like '1996', '2015', '2006-01-02' or '20130101' etc. The code I created is, col_value_series = pd.to_datetime(col_value_series, infer_datetime_format=True) min_year = col_value_series.min().year max_year = col_value_series.ma

Re: Is threading better on Usenet or gmane?

2016-04-11 Thread Grant Edwards
On 2016-04-11, Grant Edwards wrote: I just finished checking a very recent thread containing 67 articles by pointing slrn at news.panix.com for the Usenet version and at news.gmane.com for the mailing-list version. Both servers appeared to show the same set of 67 articles (that alone is pretty g

Re: Is threading better on Usenet or gmane?

2016-04-11 Thread Grant Edwards
On 2016-04-11, Random832 wrote: > I've already outlined under what circumstances threading is likely > to be broken (before the recent changes): > >| For users reading by the mailing list, Usenet users' replies to >| Mailing List users will be broken (but their replies to each other >| will be fi

Re: Is threading better on Usenet or gmane?

2016-04-11 Thread Random832
On Mon, Apr 11, 2016, at 10:24, Grant Edwards wrote: > I've been reading c.l.p on Usenet for many, many years. There has > always been a certain abount of thread breakage (presumably due to > broken e-mail clients and/or the list<->usenet gateway), but it seems > to have gotten worse lately. > >

Re: one-element tuples

2016-04-11 Thread Grant Edwards
On 2016-04-11, Fillmore wrote: > On 04/11/2016 10:10 AM, Grant Edwards wrote: > >>> What behaviour did you expect instead? That's still unclear. >> >> I must admit this is one of the best trolls I've seen in a while... > > shall I take it as a compliment? That depends on your intent, so only you

Is threading better on Usenet or gmane?

2016-04-11 Thread Grant Edwards
I've been reading c.l.p on Usenet for many, many years. There has always been a certain abount of thread breakage (presumably due to broken e-mail clients and/or the list<->usenet gateway), but it seems to have gotten worse lately. Has anybody noticed whether the threading is less broken if one r

Re: one-element tuples

2016-04-11 Thread Grant Edwards
On 2016-04-11, Marko Rauhamaa wrote: > BartC : > >> Of course this doesn't help you parsing typical input which uses >> commas as separators, not terminators! > > That's a red herring. You mustn't parse with eval(). You shouldn't event > think of parsing non-Python data with eval(). And you probl

Re: one-element tuples

2016-04-11 Thread Fillmore
On 04/11/2016 10:10 AM, Grant Edwards wrote: What behaviour did you expect instead? That's still unclear. I must admit this is one of the best trolls I've seen in a while... shall I take it as a compliment? -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples

2016-04-11 Thread Grant Edwards
On 2016-04-11, Ben Finney wrote: > Fillmore writes: >> >> I can tell you that it exists because it bit me in the butt today... >> >> and mind you, I am not saying that this is wrong. I'm just saying that >> it surprised me. > > What behaviour did you expect instead? That's still unclear. I must

Re: Parens do create a tuple

2016-04-11 Thread Random832
On Mon, Apr 11, 2016, at 04:01, Steven D'Aprano wrote: > What tuple that is passed to FunctionType.__call__? > > Where is the tuple in these examples? > > > py> from types import FunctionType > py> FunctionType.__call__(lambda x: x+1, 23) > 24 > py> FunctionType.__call__(lambda x, y: str(x)+str(

Re:

2016-04-11 Thread Igor Korot
Hi, On Sat, Apr 9, 2016 at 11:37 AM, DEEPAK KUMAR PAWAR wrote: > I am trying to install numpy along with the python35 > But it getting error everytime. What error you receive? Please copy and paste the error as this list does not allow screenshots... Thank you. > > > > Sent from Mail for Wind

Re: installation problem

2016-04-11 Thread Igor Korot
Hi, Palak, On Sun, Apr 10, 2016 at 2:30 AM, palak pandey wrote: > i m not able to install python software in my windows 10 os... > i have provided u with the image of error that is occurring during > installation > [image: Inline image 1] Attachments are not allowed on this list. Please copy an

Re: one-element tuples

2016-04-11 Thread Marko Rauhamaa
BartC : > Of course this doesn't help you parsing typical input which uses > commas as separators, not terminators! That's a red herring. You mustn't parse with eval(). You shouldn't event think of parsing non-Python data with eval(). Why should Python's syntax resemble a CSV file? Try compiling

installation problem

2016-04-11 Thread palak pandey
i m not able to install python software in my windows 10 os... i have provided u with the image of error that is occurring during installation [image: Inline image 1] -- https://mail.python.org/mailman/listinfo/python-list

[no subject]

2016-04-11 Thread DEEPAK KUMAR PAWAR
I am trying to install numpy along with the python35 But it getting error everytime. Sent from Mail for Windows 10 -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples

2016-04-11 Thread BartC
On 11/04/2016 01:48, Fillmore wrote: On 04/10/2016 08:31 PM, Ben Finney wrote: Can you describe explicitly what that “discontinuation point” is? I'm not seeing it. Here you go: >>> a = '"string1"' >>> b = '"string1","string2"' >>> c = '"string1","string2","string3"' >>> ea = eval(a) >>>

Re: numpy arrays

2016-04-11 Thread Heli
As you said, this did the trick. sortedVal=np.array(val[ind]).reshape((xcoord.size,ycoord.size,zcoord.size)) Only val[ind] instead of val[ind,:] as val is 1D. Thanks Oscar, -- https://mail.python.org/mailman/listinfo/python-list

Re: Python,ping,csv

2016-04-11 Thread Smith
Il 10/04/2016 05:29, Jason Friedman ha scritto: for ping in range(1,254): address = "10.24.59." + str(ping) res = subprocess.call(['ping', '-c', '3', address]) if res == 0: print ("ping to", address, "OK") elif res == 2: print ("no response from", address)

Re: numpy arrays

2016-04-11 Thread Heli
Thanks Oscar, In my case this did the trick. sortedVal=np.array(val[ind]).reshape((xcoord.size,ycoord.size,zcoord.size)) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python,ping,csv

2016-04-11 Thread Smith
Il 10/04/2016 05:29, Jason Friedman ha scritto: for ping in range(1,254): address = "10.24.59." + str(ping) res = subprocess.call(['ping', '-c', '3', address]) if res == 0: print ("ping to", address, "OK") elif res == 2: print ("no response from", address)

Re: Parens do create a tuple

2016-04-11 Thread Steven D'Aprano
On Monday 11 April 2016 15:27, Random832 wrote: > On Mon, Apr 11, 2016, at 00:08, Steven D'Aprano wrote: >> Should we say that the / and - operators therefore create tuples? I don't >> think so. > > But I am talking about the tuple that is passed to FunctionType.__call__ > at runtime, not a tuple

Re: Most probably a stupid question, but I still want to ask

2016-04-11 Thread Steven D'Aprano
On Monday 11 April 2016 14:03, Fillmore wrote: > I'll make sure I approach the temple of pythonistas bare-footed and with > greater humility next time Don't forget to rip your clothes into rags and heap ashes on your head too. -- Steve -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples [Was: Most probably a stupid question, but I still want to ask]

2016-04-11 Thread Tim Chase
On 2016-04-11 01:33, MRAB wrote: > A one-element tuple can be written as: > > >>> ('hello',) > ('hello',) > > As has been said already, it's the comma that makes the tuple. The > parentheses are often needed to avoid ambiguity. Except when the comma *doesn't* make the tuple: >>> t = ()

Re: Most probably a stupid question, but I still want to ask

2016-04-11 Thread Rustom Mody
On Monday, April 11, 2016 at 11:12:39 AM UTC+5:30, Stephen Hansen wrote: > On Sun, Apr 10, 2016, at 10:18 PM, Rustom Mody wrote: > > On Monday, April 11, 2016 at 10:17:13 AM UTC+5:30, Stephen Hansen wrote: > > > On Sun, Apr 10, 2016, at 09:03 PM, Fillmore wrote: > > > > and the (almost always to be

Re: one-element tuples

2016-04-11 Thread Jussi Piitulainen
Fillmore writes: > so, I do not quite control the format of the file I am trying to > parse. > > it has the format: > > "str1","str2",,"strN" => more stuff > : > > in some cases there is just one "str" which is what created me > problem. The first "str1" has special meaning and, at times, i