[issue46288] Migrating python 2.7 to 3.6 using 2to3 tool

2022-01-06 Thread Karthik S
New submission from Karthik S : Greeting of the day to all.. I would like to address few queries as mentioned in the below. python 2.7 code is running fine on RHEL 7.9,we are migrating to python3 from Python2 using 2to3 on RHEL 7.9. After migrating, When we run our products in python 3.6,we

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
Karthik Nishanth added the comment: I made my version PEP440 (local version) compliant. Now I get an error in a different place and it makes more sense. [WinError 206] The filename or extension is too long: 'build\\bdist.win-amd64\\wheel\\...\\purelib\\pkg..-2.3.0+b0105812.1.preview-py3.9

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
Karthik Nishanth added the comment: I use the same version of python on my local windows machine and in the VM. Since I am not explicitly upgrading setuptools in my scripts, I should expect the same error on my windows machine too, right? This also works on linux. The stacktrace also says

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
Karthik Nishanth added the comment: Sorry, I did use the `setup` function from `from setuptools import setup` I marked the component as Distutils because I noticed setuptools called distutils internally in the stacktrace -- ___ Python tracker

[issue43035] FileNotFoundError in distutils\file_util.py copy_tree

2021-01-27 Thread Karthik Nishanth
New submission from Karthik Nishanth : I am making a bdist_wheel for a private python binary module. `python setup.py bdist_wheel` fails on a very specific windows VM repeatedly. This works fine on both a regular windows machine & linux machines. Attached the complete distutils verbose

Implementing CURL command using libcurl in C/C++

2019-12-13 Thread Karthik Sharma
The `CURL` command that I am using is shown below. curl -F 'file=@/home/karthik/Workspace/downloadfile.out' http://127.0.0.1:5000/file-upload --verbose The response from the server is shown below. * Trying 127.0.0.1... * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0

Transfer a file to httpserver via POST command from curl

2019-12-12 Thread Karthik Sharma
me/user/testfile.txt http:// 127.0.0.1:5000/file-upload Is it really possible to transfer a large binary file from my machine to the above httpserver via POST command and download it again? If yes, is the above Flask app enough for that and what am I doing wrong? Kindly Reply, Regards, Karthik.

How to implement semaphores in python?

2016-06-07 Thread karthik jagilinki
Hello All, I need some help with semaphore implementation between two programs in python. I'd be glad if anyone can give me some help. -- https://mail.python.org/mailman/listinfo/python-list

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-23 Thread Karthik Reddy
On Wednesday, March 23, 2016 at 9:43:21 AM UTC+5:30, Karthik Reddy wrote: > On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote: > > On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote: > > > > > The error I am getting is "Uncaught Refere

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-22 Thread Karthik Reddy
On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote: > On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote: > > > The error I am getting is "Uncaught ReferenceError: gapi is not defined" > > > Have you tried googling for it? That's

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-22 Thread Karthik Reddy
On Tuesday, March 22, 2016 at 4:55:40 PM UTC+5:30, Karthik Reddy wrote: > On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote: > > On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote: > > > > > The error I am getting is "Uncaught Refere

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-22 Thread Karthik Reddy
On Tuesday, March 22, 2016 at 4:48:37 PM UTC+5:30, Steven D'Aprano wrote: > On Tue, 22 Mar 2016 09:37 pm, Karthik Reddy wrote: > > > The error I am getting is "Uncaught ReferenceError: gapi is not defined" > > > Have you tried googling for it? That's

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-22 Thread Karthik Reddy
On Tuesday, March 22, 2016 at 9:54:53 AM UTC+5:30, Mark Lawrence wrote: > On 22/03/2016 04:14, Karthik Reddy wrote: > > Hi Experts, > > > > I am trying to post on facebook and google plus page from my application. > > I am using facebook-sdk an d I am able to post u

Re: GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-22 Thread Karthik Reddy
On Tuesday, March 22, 2016 at 9:54:53 AM UTC+5:30, Mark Lawrence wrote: > On 22/03/2016 04:14, Karthik Reddy wrote: > > Hi Experts, > > > > I am trying to post on facebook and google plus page from my application. > > I am using facebook-sdk an d I am able to post u

GAPI -- Sharing a post to Social Networking Pages from my App

2016-03-21 Thread Karthik Reddy
Hi Experts, I am trying to post on facebook and google plus page from my application. I am using facebook-sdk an d I am able to post using local machine but I am not able to post from dev server. Can Anyone Please help me on this. Thanks, Karthik -- https://mail.python.org/mailman

Plotting a timeseris graph from pandas dataframe using matplotlib

2015-11-19 Thread Karthik Sharma
I have the following data in a csv file SourceIDBSs hour Type 7208 87 11MAIN 11060 67 11MAIN 3737 88 11MAIN 9683 69 11MAIN 9276 88 11MAIN 7754 62 11

Plotting timeseries from a csv file using matplotlib

2015-11-12 Thread Karthik Sharma
I have some csv data in the following format. Ln Dr Tag Lab 0:01 0:02 0:03 0:04 0:05 0:06 0:07 0:08 0:09 L0 St vT 4R 0 0 00 0 0 00 0 L2 Tx st 4R

Re: Decoding JSON file using python

2015-05-27 Thread Karthik Sharma
, Karthik Sharma karthik.sha...@gmail.com wrote: I have the JSON structure shown below and the python code shown below to manipulate the JSON structure. import json json_input = { msgType: 0, tid: 1, data: [{\Severity\:\warn\,\Subject\:\Reporting

Decoding JSON file using python

2015-05-27 Thread Karthik Sharma
I have the JSON structure shown below and the python code shown below to manipulate the JSON structure. import json json_input = { msgType: 0, tid: 1, data: [{\Severity\:\warn\,\Subject\:\Reporting

Error in processing JSON files in Python

2015-03-30 Thread Karthik Sharma
I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.tool` I get the following error `extra

Python JSON processing - extra data error

2015-03-30 Thread karthik . sharma
I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.tool` I get the following error `extra

Re: Beginner

2014-11-20 Thread Karthik Reddy
Now Its working Thanks a lot Steven -- https://mail.python.org/mailman/listinfo/python-list

Beginner

2014-11-19 Thread Karthik Reddy
Hi all I am python beginner I am trying the below code and getting incorrect syntax in python (3.3.2) number = 23 running = True while running: guess = int(raw_input('Enter an integer : ')) if guess == number: print (Congratulations, you guessed it.) running = False # this causes the while

ZMQError: Resource temporarily unavailable

2014-10-09 Thread karthik . sharma
I am using zero-mq for IPC between two machines. My zmq function is given below def recieve_messages(self): string = self.sub_socket.recv(flags=zmq.NOBLOCK) print('flow mod messages recieved {}'.format(string)) When I run the program however I get the following

Re: python

2014-02-26 Thread Karthik Reddy
On Monday, February 24, 2014 2:01:11 PM UTC+5:30, Karthik Reddy wrote: I worked as a weblogic administrator and now i am changing to development and i am very much interested in python . please suggest me what are the things i need to learn more rather than python to get an I.T job

Re: python

2014-02-25 Thread Karthik Reddy
.. On Tuesday, February 25, 2014 12:58:15 AM UTC+5:30, CM wrote: On Monday, February 24, 2014 3:31:11 AM UTC-5, Karthik Reddy wrote: I worked as a weblogic administrator and now i am changing to development and i am very much interested in python . please suggest me what

python

2014-02-24 Thread Karthik Reddy
I worked as a weblogic administrator and now i am changing to development and i am very much interested in python . please suggest me what are the things i need to learn more rather than python to get an I.T job. I came to know about Django but i am in a confusion please help me

stuck at this from so much time,need help....please ..

2013-11-23 Thread Bhanu Karthik
data = sock.recv(RECV_BUFFER) username = str(sock.getpeername()) username = usernames[username] if command == /quit: print data sock.send(bye)

Re: stuck at this from so much time,need help....please ..

2013-11-23 Thread Bhanu Karthik
On Saturday, 23 November 2013 14:23:08 UTC-8, Chris Angelico wrote: On Sun, Nov 24, 2013 at 9:15 AM, Bhanu Karthik bhanukarthik2...@gmail.com wrote: data = sock.recv(RECV_BUFFER) username = str(sock.getpeername()) username

Re: stuck at this from so much time,need help....please ..

2013-11-23 Thread Bhanu Karthik
On Saturday, 23 November 2013 14:23:08 UTC-8, Chris Angelico wrote: On Sun, Nov 24, 2013 at 9:15 AM, Bhanu Karthik bhanukarthik2...@gmail.com wrote: data = sock.recv(RECV_BUFFER) username = str(sock.getpeername()) username

Re: stuck at this from so much time,need help....please ..

2013-11-23 Thread Bhanu Karthik
On Saturday, 23 November 2013 14:37:09 UTC-8, Roy Smith wrote: In article 8445e47e-7efe-4f37-9b40-db2896d58...@googlegroups.com, Bhanu Karthik bhanukarthik2...@gmail.com wrote: data = sock.recv(RECV_BUFFER) username = str(sock.getpeername

select.select()

2013-11-22 Thread Bhanu Karthik
please help me.. what does the following line do? read_sockets,write_sockets,error_sockets = select.select(CONNECTION_LIST,[],[]) -- https://mail.python.org/mailman/listinfo/python-list

Re: select.select()

2013-11-22 Thread Bhanu Karthik
On Friday, 22 November 2013 18:29:12 UTC-8, Steven D'Aprano wrote: On Fri, 22 Nov 2013 17:42:07 -0800, Bhanu Karthik wrote: please help me.. what does the following line do? read_sockets,write_sockets,error_sockets = select.select(CONNECTION_LIST

Re: select.select()

2013-11-22 Thread Bhanu Karthik
On Friday, 22 November 2013 18:15:10 UTC-8, Roy Smith wrote: In article b8d42424-e0ab-4595-9c87-25e5c1b53...@googlegroups.com, Bhanu Karthik bhanukarthik2...@gmail.com wrote: please help me.. what does the following line do? read_sockets,write_sockets,error_sockets

How to parse the starting and ending of a loop statements in python

2013-07-30 Thread karthik sridhar
My objective is to find the line numbers of the start and the end of a loop statement in python. Example scenario #A.py Line1: a=0 Line2: while a5: Line3:print a Line4:a=a+1 Desired output: Start of a loop Line2 End of a loop Line4 Current

query from sqlalchemy returns AttributeError: 'NoneType' object

2013-05-02 Thread karthik . sharma
while handling Connection!PacketIn... Traceback (most recent call last): File /home/karthik/pox/pox/lib/revent/revent.py, line 234, in raiseEventNoErrors return self.raiseEvent(event, *args, **kw) File /home/karthik/pox/pox/lib/revent/revent.py, line 281, in raiseEvent

RE : Gnuplot

2013-04-04 Thread Murugesan, Karthik
Hello, I am having a few issues interfacing gnuplot with python. When I try to run the demo.py file I get the following error messages: Traceback (most recent call last): File C:\Program Files\Common Files\dSPACE\Python25\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py, line 310,

Packing a ctypes struct containing bitfields.

2009-06-18 Thread Karthik
long bar: 48; }; printf(sizeof(foo) = %d, sizeof(foo)); === So... what am I doing wrong? Thanks, Karthik. -- http://mail.python.org/mailman/listinfo/python-list

Re: Packing a ctypes struct containing bitfields.

2009-06-18 Thread Karthik
On Jun 18, 6:29 pm, Nick Craig-Wood n...@craig-wood.com wrote: Karthik karthik301...@gmail.com wrote:  Hello Everybody,  I'm trying to create a packed structure in ctypes (with one 64-bit  element that is bitfielded to 48 bits),  unsuccessfully

SSL Server side Client Certficate Verification in M2Crypto

2009-04-27 Thread Karthik
and SWIG 1.33. The M2Crypto I am using is 0.18. I am also using my own CA to sign the certificates. The CA certificates are available with both the server and the client. Please let me know if you require additional information on this. Thanks Karthik import select import socket import sys import

Re: Subprocess module: running an interactive shell

2009-03-14 Thread Karthik Gurusamy
) ro...@rslabs:~/pruebas$ [2]+  Stopped                 ./shell.py ro...@rslabs:~/pruebas$ Why and how to fix it? Would you suggest a better and more elegant way to do what I want? As I see it, 'sh' is attempting to read from the keyboard and not from stdin. Karthik Thank you

Re: Subprocess module: running an interactive shell

2009-03-14 Thread Karthik Gurusamy
On Mar 14, 3:03 am, Roman Medina-Heigl Hernandez ro...@rs-labs.com wrote: Karthik Gurusamy escribió: On Mar 13, 6:39 pm, Roman Medina-Heigl Hernandez ro...@rs-labs.com wrote: Hi, I'm experimenting with Python and I need a little help with this. What I'd like is to launch

Re: Can read() be non-blocking?

2008-11-06 Thread Karthik Gurusamy
wait of 1 minute data = proc.stdout.read() except Exception, e: if not str(e) == 'timeout': # something else went wrong .. raise # got the timeout exception from alarm .. proc is hung; kill it Karthik Thanks                 Thomas -- http://mail.python.org/mailman

Re: Output of pexpect

2008-09-30 Thread Karthik Gurusamy
sys.stdout as well as another file-object). I guess that's your question. The above should give you a starting point to explore. [May be give a fake file like object and intercept the write/ flush calls?] Karthik Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple processes, private working directories

2008-09-24 Thread Karthik Gurusamy
that if any of the processes generate lot of stdout/stderr, you will get a deadlock in the above loop. Then you way want to go for threads or use run.poll and do the reading of the output from your child processes. Karthik thanks for any suggestions, --Tim Arnold -- http://mail.python.org

Newbie Question:Please help

2008-09-09 Thread Karthik Krishnan
Hi, I am a newbie to python and I hope this is not a stupid question. I am trying to run a main method from a Python command line using the command shell using the command. python main_test.py I get the following error. File stdin, line 1 python main_test.py Syntax Error: invalid syntax

Re: Seeking ideas for a cron implementation

2008-09-06 Thread Karthik Gurusamy
On Aug 22, 1:51 pm, Sean DiZazzo [EMAIL PROTECTED] wrote: On Aug 22, 1:30 pm, Karthik Gurusamy [EMAIL PROTECTED] wrote: Hi, I'm working on acronlike functionality for my application. The outer loops runs continuously waking every x seconds (say x=180, 300, ..). It needs to know what

Re: Storing Subprocess Results

2008-09-02 Thread Karthik Gurusamy
') While money can't buy happiness, it certainly lets you choose your own \nform of misery. Karthik  Any help is appreciated.  Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Seeking ideas for a cron implementation

2008-08-22 Thread Karthik Gurusamy
like: month=11, wday=1, hour=3, min=30# At 3:30 AM on a Tuesday in November Thanks for your thoughts. Karthik -- http://mail.python.org/mailman/listinfo/python-list

Re: help with list comprehension

2008-05-01 Thread Karthik Gurusamy
), p) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] Karthik -- Yves.http://www.SollerS.ca -- http://mail.python.org/mailman/listinfo/python-list

Re: ssh

2008-04-30 Thread Karthik Gurusamy
to program than the more primitive os.execv/os.read/write. If you have already setup keys, ssh should work passwordless whether it's interactive or not (AFAIK). Karthik -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] annoying dictionary problem, non-existing keys

2008-04-24 Thread Karthik
] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/bvidinli%40gmail.com Is this an acceptable alternative? try: if conf['key1'] == 'something': ur commands except KeyError: pass Regards, Karthik -- http

Re: Setting default version among multiple python installations

2008-04-09 Thread Karthik
Gabriel Genellina wrote: En Wed, 09 Apr 2008 02:45:28 -0300, Karthik [EMAIL PROTECTED] escribió: if i type python2.5 i am able to use the latest python, but if i simply type python it taken me to the older version. (it is a minor annoyance, but I want to know how to fix it) From

Setting default version among multiple python installations

2008-04-08 Thread Karthik
. How do i set python2.5 as the default version? -Karthik -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting default version among multiple python installations

2008-04-08 Thread Karthik
Gabriel Genellina wrote: En Tue, 08 Apr 2008 06:48:54 -0300, Karthik [EMAIL PROTECTED] escribió: I am an absolute linux and python newbie. The linux machine(red hat version 7.2) that i managed to get my hands on had python 1.5(vintage stuff, i guess) in it. I have installed python 2.5

Re: clocking subprocesses

2008-03-03 Thread Karthik Gurusamy
-tuple and what you want is child cpu times. times(...) times() - (utime, stime, cutime, cstime, elapsed_time) Return a tuple of floating point numbers indicating process times. cutime+cstime will give you the total CPU used by child (your simulation). Karthik Thanks for the advice

Re: How to identify which numbers in a list are within each others' range

2008-02-01 Thread Karthik Gurusamy
= [(node, i) for i in clique if i != node] edges += new_edges clique.remove(node) return edges def main(): lst = [(52, 58), (18, 22), (13, 21), (57, 63)] print overlaps(lst) Output: [(2, 1), (0, 3)] Karthik Thanks! Erik -- http://mail.python.org/mailman

Re: finding child cpu usage of a running child

2008-01-26 Thread Karthik Gurusamy
On Jan 25, 11:59 pm, Paddy [EMAIL PROTECTED] wrote: On Jan 26, 5:43 am, Karthik Gurusamy [EMAIL PROTECTED] wrote: Hi, Wondering if there is a way to measure a child process's cpu usage (sys and user) when the child is still running. I see os.times() working fine in my system (Linux

finding child cpu usage of a running child

2008-01-25 Thread Karthik Gurusamy
is on-demand only when the request is made. Thanks, Karthik -- http://mail.python.org/mailman/listinfo/python-list

RE: Replace stop words (remove words from a string)

2008-01-17 Thread Karthik
How about - for s in stoplist: string.replace(mystr, s, ) Hope this should work. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BerlinBrown Sent: Thursday, January 17, 2008 1:55 PM To: python-list@python.org Subject: Replace stop words (remove

Re: executing newgrp from python in current shell possible?

2008-01-12 Thread Karthik Gurusamy
' on shell prompt) Karthik [1]. e.g. import os os.execvp(cmd_run[0], cmd_run) # cmd_run is probably ['/bin/bash'] -- Svenn -- http://mail.python.org/mailman/listinfo/python-list

Re: popen question

2008-01-08 Thread Karthik Gurusamy
__iter__ call) instead of a more logical single line read. Change your reading to force line-by-line read e.g. While True: line = child.readline() if not line: break print line Karthik Thanks, robert -- http://mail.python.org/mailman/listinfo/python-list

Re: pexpect ssh login and ls | grep

2008-01-01 Thread Karthik Gurusamy
(r'.*]') Try the ls command and rest of the statements. Karthik result=child.before print result.split('\r\n')[1] [EMAIL PROTECTED] ~] print result.split('\r\n')[0] Last login: Mon Dec 31 20:52:09 2007 from com1 print result.split('\r\n') ['Last login: Mon Dec 31 20:52:09 2007 from com1

Re: Understanding tempfile.TemporaryFile

2007-12-28 Thread Karthik Gurusamy
. If the operating system uses permission bits to indicate whether a file is executable, the file is executable by no one. The file descriptor is not inherited by children of this process. Caller is responsible for deleting the file when done with it. --- Karthik -- Steven

Re: Pexpect and a Linux Terminal

2007-12-24 Thread Karthik Gurusamy
like prompt = '.*#' # assumes your shell prompt for root ends in # child.expect(prompt) child.sendline(cmd2) Again add child.expect(prompt) so that you wait the completion of cmd2 and then child.close() Karthik (is a French Terminal so 'Mot de passe' means Password :' After that i try

auto-increment operator - why no syntax error?

2007-12-08 Thread Karthik Gurusamy
accepted the expression and it took me a while to debug the problem. Why are the following accepted even without a warning about syntax error? (I would expect the python grammar should catch these kind of syntax errors) n = 1 2 * + n 2 n += 1 n 2 ++n 2 Karthik -- http

Re: simple question on dictionary usage

2007-10-26 Thread Karthik Gurusamy
': '1182', 'E1': '1137', 'E3': '1163', 'E2': '1169'} Karthik Thanks in advance -- Frank Stutzman -- http://mail.python.org/mailman/listinfo/python-list

Re: Easiest way to get exit code from os.popen()?

2007-10-24 Thread Karthik Gurusamy
to interpret it as given in other post (os.WEXITSTATUS(1280)) Karthik Thanks, --Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: negative base raised to fractional exponent

2007-10-16 Thread Karthik Gurusamy
(no special modules needed). Just write your real number r, as r+0j e.g. square-root of -4 is 2j (-4+0j)**(0.5) (1.2246063538223773e-16+2j) # real part is almost zero (-4.234324+0j)**(0.5) (1.2599652164116278e-16+2.0577473119894969j) 2.0577473119894969j ** 2 (-4.234324+0j) Karthik

Re: matching a street address with regular expressions

2007-10-10 Thread Karthik Gurusamy
= r\d+ (\w+\s*)+ will work as well. Note that using raw-string for re pattern is safer in most uses. Karthik -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about subprocess

2007-10-04 Thread Karthik Gurusamy
these at once so that they all execute in parallel. Karthik Thanks, JD -- http://mail.python.org/mailman/listinfo/python-list

Re: Confused about 'positive lookbehind assertion'

2007-09-25 Thread Karthik Gurusamy
. In the above example, r.search('abcdef') does the job of ensuring 'def' is preceded by 'abc'. Karthik Erik Jones Software Developer | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.292.5888 615.292.0777 (fax) Emma helps organizations everywhere communicate market in style. Visit us online athttp

Re: shutil.copy2 error

2007-09-24 Thread Karthik Gurusamy
a guess... Yet another possibility is 'x' is not a regular file (say in unix it could be a named pipe).. you can try adding a check for x (like os.path.isfile(x)) and copy only regular files. Karthik else: logfile.write(File exists. Skipping

Re: subprocess -popen - reading stdout from child - hangs

2007-09-24 Thread Karthik Gurusamy
On Sep 24, 2:22 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Sep 23, 2:58 am, Karthik Gurusamy [EMAIL PROTECTED] wrote: On Sep 22, 8:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Let's say I have this Python file called loop.py: import sys print 'hi' sys.stdout.flush

Re: subprocess -popen - reading stdout from child - hangs

2007-09-23 Thread Karthik Gurusamy
loop.py is still alive and hasn't closed its stdout, the caller continues to wait for EOF (it doesn't know if loop.py is done generating all its output) Karthik Thanks, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing objects in a list via a wild card

2007-09-19 Thread Karthik Gurusamy
, '*.py') and not fnmatch(file, '*.pyc')] Another option is to use glob. import glob p1 = glob.glob('*.py') p2 = glob.glob('*.pyc') all = glob.glob('*') # won't include '.', '..' non_py = set(all) - set(p1) - set(p2) Karthik -- http://mail.python.org/mailman/listinfo/python-list

Re: Sets in Python

2007-09-19 Thread Karthik Gurusamy
equal). So if the list changes, it will result in a different hash and we will get a hash-miss. I doubt this is in anyway less intuitive than dis- allowing mutable items as keys. Karthik -- \S -- [EMAIL PROTECTED] --http://www.chaos.org.uk/~sion/ Frankly I have no feelings towards

Re: Sets in Python

2007-09-19 Thread Karthik Gurusamy
On Sep 19, 3:06 pm, Paddy [EMAIL PROTECTED] wrote: On Sep 19, 9:58 pm, Karthik Gurusamy [EMAIL PROTECTED] wrote: Since we know hashing is used, all that is needed is, a well-defined way to construct a hash out of a mutable. Given a sequence, how to get a hash is the problem. If later

Re: Sets in Python

2007-09-19 Thread Karthik Gurusamy
On Sep 19, 7:17 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 19 Sep 2007 20:58:03 +, Karthik Gurusamy wrote: While it's easy to explain the behavior, I think the decision to dis- allow mutable items as keys is a bit arbitrary. There is no need for dict

Re: How can I know how much to read from a subprocess

2007-09-18 Thread Karthik Gurusamy
), the only viable solution is to simulate a human (e.g. pexpect module) Karthik Thanks, Noam -- http://mail.python.org/mailman/listinfo/python-list

Re: How to insert in a string @ a index

2007-09-11 Thread Karthik Gurusamy
re l1 = re.split('hello', t1) l1[0] = 'XYZ' + l1[0] l1[-2] += 'XYZ' 'hello'.join(l1) 'XYZhello world hello. hello. \nwhy world XYZhello' If there are less than two 'hello', you'll get exception and needs special handling. Karthik -a.m. -- http://mail.python.org/mailman/listinfo/python

Re: concise code (beginner)

2007-09-06 Thread Karthik Gurusamy
On Sep 5, 1:37 pm, James Stroud [EMAIL PROTECTED] wrote: Karthik Gurusamy wrote: On Sep 5, 11:17 am, James Stroud [EMAIL PROTECTED] wrote: for i in xrange(number_of_reads): for dev in devs: try: _reader = getattr(dev, 'read%d' % i) _reader() except

Re: concise code (beginner)

2007-09-05 Thread Karthik Gurusamy
e devs.remove(dev) I see in many of the solutions suggested above, the devs sequence/ iterator is being modified while iterating. I know it is not defined for interation over dictionary keys. Are they defined for other collections like lists? Karthik James -- James Stroud UCLA-DOE

Re: how can I find out the process ids with a process name

2007-09-04 Thread Karthik Gurusamy
\n31777\n8779\n2973\n5413\n13024\n13026' Your script can then use the output as its input. Karthik Thank you. -- http://mail.python.org/mailman/listinfo/python-list

How do i record and invert a sound wave in real time using Tkinter, tkSnack and wave modules?

2007-09-04 Thread Karthik
Hi, I want to record a sound wave from a mic and at the same time invert it and play the inverted wave.My code goes as follows, however nothing is written into the E:\inverted.wav file.Thanks in advance for any help. from Tkinter import * root = Tk() import tkSnack tkSnack.initializeSnack(root)

Re: Chaining programs with pipe

2007-08-21 Thread Karthik Gurusamy
? Is there a solution that works equally on all platforms? Not sure on non-unix platforms, but in unix like platforms it's best to reuse shell's power. import commands commands.getoutput('ls | wc') ' 4 4 24' Thanks, Karthik Thanks, Avishay -- http://mail.python.org/mailman

Re: Chaining programs with pipe

2007-08-21 Thread Karthik Gurusamy
On Aug 21, 8:33 pm, Grant Edwards [EMAIL PROTECTED] wrote: On 2007-08-22, Karthik Gurusamy [EMAIL PROTECTED] wrote: Not sure on non-unix platforms, but in unix like platforms it's best to reuse shell's power. import commands commands.getoutput('ls | wc') ' 4 4 24

Re: split a string of space separated substrings - elegant solution?

2007-08-01 Thread Karthik Gurusamy
/pexpect.html But I am surprised to see there is a standard module already doing this (shlex) Karthik -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/mailman/listinfo/python-list

Re: a=0100; print a ; 64 how to reverse this?

2007-07-17 Thread Karthik Gurusamy
/t 100 $30 = 1100100 (gdb) --Karthik -- http://mail.python.org/mailman/listinfo/python-list

In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Karthik Gurusamy
, the operator should be able to infer how to convert each of the argument into strings. If the above is the case, we could've avoided all those exceptions that happen when a %d is specified but say a string is passed. Thanks, Karthik -- http://mail.python.org/mailman/listinfo/python-list

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Karthik Gurusamy
On Jul 16, 5:18 pm, Dan Bishop [EMAIL PROTECTED] wrote: On Jul 16, 7:10 pm, Karthik Gurusamy [EMAIL PROTECTED] wrote: Hi, The string format operator, %, provides a functionality similar to the snprintf function in C. In C, the function does not know the type of each of the argument

Re: using subprocess for non-terminating command

2007-07-04 Thread Karthik Gurusamy
at some point. For ping, you can use '-c num' or some other application, you can try closing it's stdin (e.g. cat, bc, gdb) Thanks, Karthik Thanks, Senthil -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-03 Thread Karthik Gurusamy
and the scheduler can keep both P and C using two cores simulateanously. If that is the case, we don't incur this process-swap overhead and we may not see the stop-n-go performance drop. Thanks, Karthik Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-03 Thread Karthik Gurusamy
the overhead of context-switching is very significant (not negligible) in the final throughput. Thanks, Karthik Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-02 Thread Karthik Gurusamy
have gone thru' decades of performance tuning that this job is done really efficiently. Thanks, Karthik Thanks for the replies so far, I really appreciate you guys considering my situation and helping out. -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-02 Thread Karthik Gurusamy
On Jul 2, 3:01 pm, Steve Holden [EMAIL PROTECTED] wrote: Karthik Gurusamy wrote: On Jul 1, 12:38 pm, dlomsak [EMAIL PROTECTED] wrote: [...] I have found the stop-and-go between two processes on the same machine leads to very poor throughput. By stop-and-go, I mean the producer

Re: object references/memory access

2007-07-02 Thread Karthik Gurusamy
On Jul 2, 6:32 pm, Steve Holden [EMAIL PROTECTED] wrote: Karthik Gurusamy wrote: On Jul 2, 3:01 pm, Steve Holden [EMAIL PROTECTED] wrote: Karthik Gurusamy wrote: On Jul 1, 12:38 pm, dlomsak [EMAIL PROTECTED] wrote: [...] I have found the stop-and-go between two processes on the same

multiple python versions of a 3rd party application/libarary

2007-06-25 Thread Karthik Krishnamurthy
hi, I maintain applications/libraries which I upgrade often at a different location. For example if I maintain mercurial at /opt/sfw/mercurial/0.9.3 I have PYTHONPATH set to /opt/sfw/mercurial/0.9.3/lib/python2.4/site-packages. How can I get python to look into python2.4 and

Re: Newbie question regarding string.split()

2007-04-21 Thread Karthik Gurusamy
input is a reserved identifier). Note this solution will work for splitting on any sequence of chars..just strip them first. Note we still get empty elements in the middle of the string -- this probably we want to get in most cases. Karthik My question is, why is the first element of projectOptions

Re: Compare regular expressions

2007-04-16 Thread Karthik Gurusamy
turned up negative. You can even arrange all the Rs in a binary tree like fashion and skip checking a whole subtree if the sub-tree's root node gave negative for r.e. match. Karthik -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >