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) por
27;message' : 'Allowed file types are txt, pdf, png, jpg,
jpeg, gif'})
resp.status_code = 400
return resp
if __name__ == "__main__":
app.run()
I am doing a POST using curl as follows.
curl -X POST --data-binary @/home/user/testfile.txt http://
127.0.0.1:5000/file-u
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
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 R
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? T
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 R
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? T
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
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
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
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 11MAI
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
x27;message {} \n\n'.format(message['Message']))
I get the following error.
Traceback (most recent call last):
File "test_json.py", line 23, in
print('message {} \n\n'.format(message['Message']))
TypeError: list indices must be intege
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
\",\"Message\":\"tdetails:{\\\"Product\\\"
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 data
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 dat
Now Its working
Thanks a lot Steven
--
https://mail.python.org/mailman/listinfo/python-list
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 lo
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 err
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 g
..
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 .
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 ..
On Saturday, 23 November 2013 14:37:09 UTC-8, Roy Smith wrote:
> In article <8445e47e-7efe-4f37-9b40-db2896d58...@googlegroups.com>,
>
> Bhanu Karthik wrote:
>
>
>
> > data = sock.recv(RECV_BUFFER)
>
> >
On Saturday, 23 November 2013 14:23:08 UTC-8, Chris Angelico wrote:
> On Sun, Nov 24, 2013 at 9:15 AM, Bhanu Karthik
>
> wrote:
>
> > data = sock.recv(RECV_BUFFER)
>
> > username = str(sock.getpeername())
>
> >
On Saturday, 23 November 2013 14:23:08 UTC-8, Chris Angelico wrote:
> On Sun, Nov 24, 2013 at 9:15 AM, Bhanu Karthik
>
> wrote:
>
> > data = sock.recv(RECV_BUFFER)
>
> > username = str(sock.getpeername())
>
> >
data = sock.recv(RECV_BUFFER)
username = str(sock.getpeername())
username = usernames[username]
if command == "/quit":
print data
sock.send("bye"
On Friday, 22 November 2013 18:15:10 UTC-8, Roy Smith wrote:
> In article ,
>
> Bhanu Karthik wrote:
>
>
>
> > please help me.. what does the following line do?
>
> >
>
> > read_sockets,write_sockets,error_sockets =
>
> > select.select
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_socke
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
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 a<5:
Line3:print a
Line4:a=a+1
Desired output:
Start of a loop Line2
End of a loop Line4
Current p
s
Linux-3.5.0-23-generic-x86_64-with-Ubuntu-12.04-precise
INFO:core:POX 0.1.0 (betta) is up.
DEBUG:openflow.of_01:Listening on 0.0.0.0:6633
INFO:openflow.of_01:[00-00-00-00-00-02 1] connected
DEBUG:tutorial:Controlling [00-00-00-00-00-02 1]
got info from the database
ERROR:c
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
On Jun 18, 6:29 pm, Nick Craig-Wood wrote:
> Karthik 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:
>
> > ===
struct foo {
unsigned long 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
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
On Mar 14, 3:03 am, Roman Medina-Heigl Hernandez
wrote:
> Karthik Gurusamy escribió:
>
>
>
> > On Mar 13, 6:39 pm, Roman Medina-Heigl Hernandez
> > wrote:
> >> Hi,
>
> >> I'm experimenting with Python and I need a little help with this. Wh
> 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.
>
> --
>
> Saludos,
> -Roman
>
> PGP Fingerprint:
> 09BB EFCD 21ED 4E79 25FB 29E1 E47F 8A7D EAD5 6742
> [Key ID: 0xEAD56742. Available at KeyServ]
--
http://mail.python.org/mailman/listinfo/python-list
uot;" This signal stuff may not work in non unix env """
raise Exception("timeout")
signal.signal(signal.SIGALRM, alarm_handler)
try:
signal.alarm(timeout) # say timeout=60 for a max wait of 1
minute
data = proc.stdout.read()
except Exception, e
d = fout
I am not very sure if you can do the logging to two different files at
the same time (ie 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
= cmds['cwd'] . etc
other args)
runs.append(run)
# Now wait for all the processes to finish
for run in runs:
run.wait()
Note 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 ru
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 "", line 1
python main_test.py
Syntax Error: invalid syntax
My ma
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 wakin
Probably commands module is a better choice for your problem:
>>> import commands
>>> commands.getoutput('fortune')
"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
eneric Cron_Event.
Say how do I know the exact time in future that will satisfy a
constraint 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
nums= []
>for e in l:
> colours.append(e['colour'])
> nums.append(e['num'])
>
> #def m3():
> # colours, nums = [ e['colour'], e['num'] for e in l ]
>
Looks like m1 is the cleanest; if you really want to run list-
comprehension once, one possible way:
>>> p = [ (e['colour'], e['num']) for e in l ]
>>> import operator
>>> map(operator.itemgetter(0), p)
['black', 'brown', 'red', 'orange', 'yellow', 'green', 'blue',
'violet', 'grey', 'white']
>>> map(operator.itemgetter(1), 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
is being used interactively (such as being prompted from
password), look into pexpect module.
http://www.noah.org/wiki/Pexpect
Else try the subprocess module (or even commands module); these are
lot simpler 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
[EMAIL PROTECTED]
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':
except KeyError:
pass
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)
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 pyth
.
How do i set python2.5 as the default version?
-Karthik
--
http://mail.python.org/mailman/listinfo/python-list
ime, 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.
>
> Kevin
--
http://mail.python.org/mailman/listinfo/python-list
s[1] == 'L':
clique.add(node)
if s[1] == 'R':
# below is O(k) where k is clique size (overlaps per
interval)
new_edges = [(node, i) for i in clique if i != node]
edges += new_edges
clique.remove(node)
return
dule. It solves the exact problem you have. You can
give a r.e. for prompt and it will take care to wait until collecting
all output. It basically simulates a human typing to an interpreter.
Karthik.
>
> > Unless there is some way to differentiate between the last line
> > and al
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 stil
is on-demand only when the request is made.
Thanks,
Karthik
--
http://mail.python.org/mailman/listinfo/python-list
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 (remov
tup_design.py, do an exec call[1] to fire the user's
shell (note that even if you use popen or other ways of forking a new
process, things will work just fine) Whatever changes you made to the
process environment will get propagated to the new shell. User must
explicitly finish the new shell (say typing 'exit' 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
e in child:" line in the iterator is
the culprit. The iterator does something like a child.readlines()
underneath (in it's __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
d the second pattern. You want to use raw strings.
r'\$' or else the re sent down is a plain $ which re interprets as end
of buffer.
Most important here is your prompt doesn't end with a $ (it's
something like [EMAIL PROTECTED] ~]). Thus make it,
child.expect(r'.*]')
g 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
--
http://mail.python.org/mailman/listinfo/python-list
t de passe :')
> child.sendline(pwd+"\r\n")
With sendline no need for the trailing "\r\n". Just do
child.sendline(pwd)
Here you may want to do something like
prompt = '.*#' # assumes your shell prompt for root ends in #
child.expect(prompt)
> child.sendline(
t silently
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 +=
;E3': '1163'}
>
> This should be pretty easy, but somehow with all my googling I've
> not found a hint.
One possible solution (read list-comprehension if you not familiar
with it):
>>> record={'BAT': '14.4', 'USD': '24', 'DIF': '45', 'OAT': '16',
... 'FF': '3.9', 'C3': '343', 'E4': '1157', 'C1': '339',
... 'E6': '1182', 'RPM': '996', 'C6': '311', 'C5': '300',
... 'C4': '349', 'CLD': '0', 'E5': '1148', 'C2': '329',
... 'MAP': '15', 'OIL': '167', 'HP': '19', 'E1': '1137',
... 'MARK': '', 'E3': '1163', 'TIME': '15:43:54',
... 'E2': '1169'}
>>> egt = dict([(k, record[k]) for k in record if k.startswith('E')])
>>> egt
{'E5': '1148', 'E4': '1157', 'E6': '1182', 'E1': '1137', 'E3': '1163',
'E2': '1169'}
Karthik
>
> Thanks in advance
>
> --
> Frank Stutzman
--
http://mail.python.org/mailman/listinfo/python-list
exit code; second gives signal info if
any
>>>
In any case, the best approach is to use the os module to interpret it
as given in other post (os.WEXITSTATUS(1280))
Karthik
>
> Thanks,
> --Steve
--
http://mail.python.org/mailman/listinfo/python-list
;>> 2.0577473119894969j ** 2
(-4.234324+0j)
>>>
Karthik
--
http://mail.python.org/mailman/listinfo/python-list
e like 3120 De la Cruz Boulevard. Any
> > > hints?
>
> Also, that pattern can be easily modified to have any number of words
> at the end:
> patt = "\d+ (\w+){1,}"
> This would take care of 3120 De la Cruz Boulevard.
\w doesn't take care of white-space. Following will work.
patt = r"\d+ (\w+\s*){1,}"
BTW {1,} is same as +. So
patt = 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
y A
ssh machine-B run_jobs.py B
ssh machine-B run_jobs.py C
...
You may want to fire all these at once so that they all execute in
parallel.
Karthik
>
> Thanks,
>
> JD
--
http://mail.python.org/mailman/listinfo/python-list
>>> m2 = r.search('bcdefff')
> >>> m2 == None
> True
>
> So, it matches 'def' but only if it is immediately preceded by 'abc'.
Any idea what this positive lookbehind achieves which can't be done
without it.
I remember cases where posit
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 s
other process, while you
are looping here copying one-by-one the files.
So a file 'x' could be present at the time you enter loop, but gone by
the time you try the shutil.copy2. Again this is just a guess...
Yet another possibility is 'x' is not a r
> >>> proc.stdout.read()
>
> But it just hangs at read()
>
> proc.communicate() also just hangs. What am I doing wrong? Please
> advise.
Since your 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
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
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, ho
line's
a?.. so
why not allow similar behavior with lists/other sequence/even other
collections. As long as two objects compare equal the hash-result must
be the same. I guess this takes us to defining the equality operation
for lists-- which I think has a very obvious definition (i
gt;
> You can also use fnmatch:
>
> from fnmatch import fnmatch
> files = [file for file in os.listdir(os.getcwd()) if not fnmatch(file,
> '*.py') and not fnmatch(file, '*.pyc')]
Another option is to use glob.
import glob
p1 = glob.glob('*.py
p
session (where the stdin depends on process's prior stdout), the only
viable solution is to simulate a human (e.g. pexpect module)
Karthik
>
> Thanks,
> Noam
--
http://mail.python.org/mailman/listinfo/python-list
Yet another solution using re
>>> t1 = 'hello world hello. hello. \nwhy world hello'
>>> import re
>>> l1 = re.split('hello', t1)
>>> l1[0] = 'XYZ' + l1[0]
>>> l1[-2] += 'XYZ'
>>> 'hello'.joi
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:
> >>
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 Institute for Genomics and Proteomics
> Box 951570
> Los Angeles, CA 90095
>
> http://www.jamesstroud.com/
--
http://mail.python.org/mailman/listinfo/python-list
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)
t=
lot
simpler for simple shell like tasks.
>>> import commands
>>> commands.getoutput("ps -ef | grep emacs | awk '{print $2}'")
'21739\n15937\n15287\n5097\n14797\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
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.
>
> >>&
t; I tie them together? 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
//pexpect.sourceforge.net/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
ing to know we can go from binary to int, the OP
wanted the other way.
I think it will be a nice enhancement to add to % operator (like %x,
something for binary, %b or %t say) or something like a.__bin__ as
suggested by the OP.
FWIW, gdb has a /t format to print in binary.
(gdb) p 100
$28 = 100
(gdb) p /x 100
$29 = 0x64
(gdb) p /t 100
$30 = 1100100
(gdb)
--Karthik
--
http://mail.python.org/mailman/listinfo/python-list
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
efinition is string formatting, 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
ng subprocess, instead of os.system because
> at anypoint in time, I need access to stdout and stderr of execution.
>
Using subprocess is good. Just ensure your child stops data generation
at some point. For ping, you can use '-c ' 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
. But if the data is
large and several processes are involved, I am fairly sure 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
a, we allow P to
run a lot bigger time-slice. Assuming huge file-system buffering, it's
very much possible P gets one-go on the CPU and finishes it's job of
data generation.
Note that all these become invalid, if you have a more than one core
and the scheduler can keep both P and C usin
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:
> >&g
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
porary
file for IPC. This is not as efficient as real shared memory -- but it
does avoid the IPC stop-n-go. The producer can generate the multi-mega
byte file at one go and inform the consumer. The file-systems have
gone thru' decades of performance tuning that this job is done really
efficie
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 python2.4/site-packa
don't get leading/trailing
empty list items.
So just add input = input.strip('2') after the input assignment (BTW
someone had
pointed 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 element
hts.
If you know already R2 >= R1 (that is you precompute and remember),
then it's a trivial to skip checking for R1 if R2 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
On Apr 14, 7:54 pm, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> On Sat, 14 Apr 2007 16:49:22 -0700, Karthik Gurusamy wrote:
> > I'm wondering if there is a cleaner approach -- something like
> > parser.opt_seen("-i")
>
> What do dir(parser) a
er can
ever
enter a None value, I can be sure that the user didn't provide -i.
I'm wondering if there is a cleaner approach -- something like
parser.opt_seen("-i")
Thanks,
Karthik
--
http://mail.python.org/mailman/listinfo/python-list
a trick.
Make your script write it's output unbuffered to a file. Since the
file is mounted and available on both the machines.. start reading the
file from this main python script (note that you may need a thread to
do it, as your script will anyway be stuck waiting for the ssh to
complete).
ssing your implementation; but from what you say
(peer-to-peer), I feel there is a O(N^2) requirements. Also try
experimenting with small N (100 nodes say).
Thanks,
Karthik
> Thanks
>
>
> bruno at modulix wrote:
> > [EMAIL PROTECTED] wrote:
> > > I have a python code w
1 - 100 of 103 matches
Mail list logo