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

2014-10-17 Thread Chris Angelico
On Sat, Oct 18, 2014 at 5:42 PM, Artur Bercik 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 in binary, with the bits you're interested in set to 1, and e

Re: Flush stdin

2014-10-17 Thread Chris Angelico
On Fri, Oct 17, 2014 at 10:38 PM, Empty Account wrote: > I will be using this script on Unix based systems and I wondered what > approach I could use > to flush stdin? Why exactly do you need to flush stdin? If you've written a small amount of data to the console, it's stdout that you need to flu

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

2014-10-17 Thread Chris Angelico
On Sat, Oct 18, 2014 at 4:58 PM, Artur Bercik 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: 1000

Flush stdin

2014-10-17 Thread Empty Account
Hi, I am using netcat to listen to a port and python to read stdin and print to the console. nc -l 2003 | python print_metrics.py sys.stdin.flush() doesn’t seem to flush stdin, so I am using the termios module. while True: input = sys.stdin.readline() # do some parsing … sys.stdout.

Extract Indices of Numpy Array Based on Given Bit Information

2014-10-17 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: [Tutor] Convert Qstring to string in windows

2014-10-17 Thread eryksun
On Thu, Oct 16, 2014 at 10:21 AM, C@rlos wrote: > in linux i do for this way: > pythonstringtext=qstringtext.text().toUtf8.data() > and it return a python string correctly. pythonstringtext is a byte string that has to be decoded as UTF-8. Here's the 'mojibake' result when it gets decoded as UTF-

Processing xml for output with cElementTree

2014-10-17 Thread Joseph L. Casale
I am unfortunately unable to use lxml for a project and must resort to base only libraries to create several nested elements located directly under a root element. The caveat is the incremental writing and flushing of the nested elements as they are created. So assuming the structure is texttext

Re: windows log to event viewer

2014-10-17 Thread Mark Lawrence
On 17/10/2014 10:59, Arulnambi Nandagoban wrote: Hello, I am trying to run a tcp server as a windows service. The project also includes an application layer protocol somewhat like CoAP and few soap calls to data base. There is some moment the code enter into exception during a soap method call

Re: 2d color-bar map plot

2014-10-17 Thread Mark Lawrence
On 17/10/2014 07:28, Dhananjay wrote: Dear all, I am bit new to the python/pyplot. This might be simple, but I guess I am missing something here. I doubt that you'll get detailed answers here so suggest you try https://lists.sourceforge.net/lists/listinfo/matplotlib-users which is also availa

Re: Write list to new column in existent csv

2014-10-17 Thread Peter Otten
Tal Bar-Or wrote: > I am tryin to figure how to write a list i have as follows > To a a csv to for example the 3rd column , i am really got stacked here i > tried few codes with csv.writerow() but didn't got it work ,will really > appreciate if someone could help me with that Please advice Thanks

Re: windows log to event viewer

2014-10-17 Thread Irmen de Jong
On 17-10-2014 11:59, Arulnambi Nandagoban wrote: > Hello, > > > > I am trying to run a tcp server as a windows service. > > The project also includes an application layer protocol somewhat like CoAP > and few soap > calls to data base. > > There is some moment the code enter into exception d

Write list to new column in existent csv

2014-10-17 Thread Tal Bar-Or
Hello Group, I am tryin to figure how to write a list i have as follows ['info', '19987→445 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM=1\n', '445→19987 [SYN, ACK] Seq=0 Ack=1 Win=65535 Len=0 MSS=1460 WS=64 SACK_PERM=1\n', '19987→445 [ACK] Seq=1 Ack=1 Win=65536 Len=0\n', 'Negoti

Re: your mail

2014-10-17 Thread Terry Reedy
On 10/17/2014 6:43 AM, Cameron Simpson wrote: On 17Oct2014 11:45, Dhananjay wrote: 2.1576318858 -1.8651195165 4.2333428278 ... (total of 200 lines) Columns 1,2,3 corresponds to x,y,z axis data points. for line in open('flooding-psiphi.dat','r'): line = line.split() xs.app

Re: 2d color-bar map plot

2014-10-17 Thread Peter Pearson
On Fri, 17 Oct 2014 14:28:13 +0800, Dhananjay wrote: [snip] > xs = ys = zs = [] > for line in fl1: > line = line.split() > xs.append(float(line[0])) > ys.append(float(line[1])) > zs.append(float(line[2])) > > print xs[0], ys[0], zs[0] The line "xs = ys = zs = []" is almost surely n

non-gobject based dbus library?

2014-10-17 Thread Tycho Andersen
Hi all, An application I maintain recently moved away from the gobject event loop to the tulip/trollius/asyncio event loop. However, we were using python-dbus, which internally uses the gobject event loop, as our main event loop. This worked nicely when we were gobject based, but now that we're no

Re: Permissions on files installed by pip?

2014-10-17 Thread Jean-Michel Pichavant
- Original Message - > From: "Adam Funk" > To: python-list@python.org > Sent: Thursday, 16 October, 2014 9:29:46 PM > Subject: Permissions on files installed by pip? > > I've been using the python-nltk package on Ubuntu, but I need ntlk > 3.0 > now. I used 'sudo aptitude purge python-nlt

Re: your mail

2014-10-17 Thread Cameron Simpson
On 17Oct2014 11:45, Dhananjay wrote: This might be simple, but I guess I am missing something here. I have data file as follows: 2.1576318858 -1.8651195165 4.2333428278 2.1681875208 -1.9229968780 4.1989176884 2.3387636157 -2.0376253255 2.4460899122 2.1696565965 -2.6186941271 4.4172007912 2.0848

windows log to event viewer

2014-10-17 Thread Arulnambi Nandagoban
Hello, I am trying to run a tcp server as a windows service. The project also includes an application layer protocol somewhat like CoAP and few soap calls to data base. There is some moment the code enter into exception during a soap method call. This exception is not viewed in Windows eve

Re: Help in using grako for parsing

2014-10-17 Thread varun7rs
I'm really sorry for not being clear. I shall explain things in detail from now onwards. Really sorry. The output I would like is In a similar way I have something like this for every request. This is what I intend to get from the input that I had pasted earlier. -- https://mail.pytho

Re: Help in using grako for parsing

2014-10-17 Thread varun7rs
Oh damn, it turned out really crappy. I could not format it properly -- https://mail.python.org/mailman/listinfo/python-list

Re: Help in using grako for parsing

2014-10-17 Thread Peter Otten
varun...@gmail.com wrote: > Hello, > I am trying to parse a file which ahs the below content. I tried using the > split function but that wasn't a good programming practice. I had to use > it repeatedly to split the line and then read my data. I thought of doing > it in a better way which is when

Help in using grako for parsing

2014-10-17 Thread varun7rs
Hello, I am trying to parse a file which ahs the below content. I tried using the split function but that wasn't a good programming practice. I had to use it repeatedly to split the line and then read my data. I thought of doing it in a better way which is when I came across grako. But I have n

[no subject]

2014-10-17 Thread Dhananjay
Hello, This might be simple, but I guess I am missing something here. I have data file as follows: 2.1576318858 -1.8651195165 4.2333428278 2.1681875208 -1.9229968780 4.1989176884 2.3387636157 -2.0376253255 2.4460899122 2.1696565965 -2.6186941271 4.4172007912 2.0848862071 -2.1708981985 3.340452096

Convert Qstring to string in windows

2014-10-17 Thread C@rlos
I have been tryed to convert a Qstring text to string on python, in linux that work fine but in windows when qstring contine á,é,í,ó,ú the converted text is not correct, contine extranger characters, this qstring text is an url from qdialogtext. in linux i do for this way: pythonstringtext=q