set environmental variable from python

2014-10-30 Thread Artur Bercik
I have to set environmental variable in my windows PC as follows: variable name: GISBASE value: C:\GRASS-64 Is it possible to set it from python? import sys sys.path.append(C:\\GRASS-64) But how to give variable name? I have to set both the variable name and value. Thanks in the advance.

Re: set environmental variable from python

2014-10-30 Thread Artur Bercik
PM, Artur Bercik wrote: I have to set environmental variable in my windows PC as follows: variable name: GISBASE value: C:\GRASS-64 Is it possible to set it from python? Which Python? I'll have to assume 3.x import sys sys.path.append(C:\\GRASS-64) But how to give variable name? I

Re: set environmental variable from python

2014-10-30 Thread Artur Bercik
could you please elaborate 'setx ...'? On Fri, Oct 31, 2014 at 11:30 AM, Zachary Ware zachary.ware+pyl...@gmail.com wrote: On Thursday, October 30, 2014, Artur Bercik vbubbl...@gmail.com wrote: Dear Dave Angel Thanks for your answer. I am using Python 2.7 I want to set it permanently

Re: set environmental variable from python

2014-10-30 Thread Artur Bercik
I have to set several variables so it would be easier if I could set them from Python. On Fri, Oct 31, 2014 at 11:36 AM, Rustom Mody rustompm...@gmail.com wrote: On Friday, October 31, 2014 8:01:08 AM UTC+5:30, Zachary Ware wrote: On Thursday, October 30, 2014, Artur Bercik vbub...@gmail.com

Extract Indices of Numpy Array Based on Given Bit Information

2014-10-18 Thread Artur Bercik
Dear Python and Numpy Users: My data are in the form of '32-bit unsigned integer' as follows: myData = np.array([1073741824, 1073741877, 1073742657, 1073742709, 1073742723, 1073755137, 1073755189,1073755969],dtype=np.int32) I want to get the index of my data where the following occurs: Bit No.

Re: Extract Indices of Numpy Array Based on Given Bit Information

2014-10-18 Thread Artur Bercik
, Chris Angelico ros...@gmail.com wrote: On Sat, Oct 18, 2014 at 5:42 PM, Artur Bercik vbubbl...@gmail.com wrote: I got some sense, but could not imagine if required Bit No. 2–5, and Bit Combination . I hope example with the new case would make me more sense. Just write the number

Re: Extract Indices of Numpy Array Based on Given Bit Information

2014-10-18 Thread Artur Bercik
, 2014 at 4:58 PM, Artur Bercik vbubbl...@gmail.com wrote: I want to get the index of my data where the following occurs: Bit No. 0–1 Bit Combination: 00 So, what you want to do is look at each number in binary, and find the ones that have two zeroes in the last two places? 1073741824

Re: Extract Indices of Numpy Array Based on Given Bit Information

2014-10-18 Thread Artur Bercik
On Sat, Oct 18, 2014 at 4:10 PM, Chris Angelico ros...@gmail.com wrote: On Sat, Oct 18, 2014 at 6:02 PM, Artur Bercik vbubbl...@gmail.com wrote: So, the Bit No. 2-5 for the following case is '1101', right? 1073741877: 1110101 If my required bit combination