Re: Python and Cron

2007-09-08 Thread Amit Khemka
ut 2&>1 "2&>1", Is that a typo ? It should be "2>&1" . Are you *sure* that the cron job is running ? cheers, -- Amit Khemka website: www.onyomo.com wap-site: www.owap.in -- http://mail.python.org/mailman/listinfo/python-list

Parallel/Multiprocessing script design question

2007-09-12 Thread Amit N
Hi guys, I tend to ramble, and I am afraid none of you busy experts will bother reading my long post, so I will try to summarize it first: 1. I have a script that processes ~10GB of data daily, and runs for a long time that I need to parallelize on a multicpu/multicore system. I am trying to d

Re: Dictionary of Dictionaries

2007-03-05 Thread Amit Khemka
wo']['124'] = 4 > > This gives: > > {'two': {'121': 2, '123': 1, '124': 4}, 'one': {'121': > 2, '123': 1, '124': 4}} And hence the results ! HTH, --

Re: converting epoch time to string (and vice versa)

2007-03-12 Thread Amit Khemka
epochs = calendar.timegm((t[2], t[1], t[0], 0, 0, 0)) > Im also trying to convert that epoch time to the string format > previously. Can anyone help this one too? import time time.ctime(epochs) cheers, amit. -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd0037

Re: XML Parsing

2007-03-28 Thread Amit Khemka
called filecreate.xml > > As you might have guessed, I want to create files from this XML file > contents, so how can I do this? > What modules should I use? What options do I have? Where can I find > tutorials? Will I be able to put > this on the internet (on a googlepages ser

Re: Weird behavior in search in a list

2007-03-29 Thread Amit Khemka
d to 'break' when once the condition is met. def find(num): count=0 for elem in extend: if elem>num: break else: count+=1 return count Btw a concise way could be: def getfirstbigger(num): for i,x in enumerate(extend): if x>num:

Re: Weird behavior in search in a list

2007-03-29 Thread Amit Khemka
> On 29 Mar 2007 04:51:00 -0700, Su Y <[EMAIL PROTECTED]> wrote: > > I want find the first number in extend[] which is larger than num, so > On 3/29/07, Amit Khemka <[EMAIL PROTECTED]> wrote: > Btw a concise way could be: > def getfirstbigger(num): >

Re: Weird behavior in search in a list

2007-03-29 Thread Amit Khemka
num' not the smallest greater value in the list. cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the world's turn, endless the sun's Spinning, Endless the quest; I turn again, back to my own beginning, And here, find rest. -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system questions

2007-03-31 Thread Amit Khemka
test variable for "up", I don't get this script to > actually run. Everything else is tested and works. Why won't this script > run? os.system doesn't allow you to get the output of the program, use os.popen instead. example: import os up = os.popen('uptime'

Re: Question about text in Python

2007-04-02 Thread Amit Khemka
uot;__main__": userinp=raw_input("Query>") while userinp: callmyabbrvfunction(userinp) userinp=raw_input("Another Query>") print "Exit: You have entered empty string !" cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~c

Re: how to remove multiple occurrences of a string within a list?

2007-04-04 Thread Amit Khemka
tance of '0024' is removed. To remove all items with multiple occurances in myList: list(set(myList) - set([x for x in myList if myList.count(x)>1])) cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the world's turn, endless the sun

Re: Storing of folder structure in SQL DB

2007-04-05 Thread Amit Khemka
th+'/'+dir]=(tree[path][1], id) id+=1 It stores ids as a tuple (parent_id, id) in a dictionary(tree). Should be straight forward to modify to your requirements. Also you can make the following code more efficient by saving/caching some lookups ! Cheers, --

Re: Storing of folder structure in SQL DB

2007-04-05 Thread Amit Khemka
On 4/5/07, Amit Khemka <[EMAIL PROTECTED]> wrote: > On 5 Apr 2007 04:58:22 -0700, Sergei Minayev <[EMAIL PROTECTED]> wrote: > An Example: > > import os > root='/my/root/directory' > id =0 > tree={root:(-1, id)} > id+=1 > for path, dirs,

A general question

2007-04-11 Thread amit soni
general? and what are the areas it lacks behind and what improvements will make it appealing to more and more people? Thank you, Amit - Don't get soaked. Take a quick peak at the forecast with theYahoo! Search weather shortcut.--

Re: newbie question: how to read back the dictionary from a file?

2007-04-16 Thread Amit Khemka
", then > loop read a int, then read a ":", then a float etc etc... Since it is > written out with standard python builtin functions, I guess there may > be some more direct method than this, say a function in some modules? > Could someone give me a hint? &g

Re: How to generate a continuous string

2007-04-16 Thread Amit Khemka
str = mychar*n n: Integer (number of times you want to duplicate) Cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the world's turn, endless the sun's Spinning, Endless the quest; I turn again, back to my own beginning, And here, find rest.

Re: mass editing for keys in a dictionary

2007-09-14 Thread Amit Khemka
ne liner would be : >>> dict_2 = dict([(k.split('_')[0], v) for (k,v) in dict_1.iteritems()]) It would split the keys by '_' and use first part of split as the new key ! You must be aware be careful in cases where there are keys like 'customer_1' , 'cust

Re: global name is not defined - but this is actually a function's name

2007-09-20 Thread Amit Khemka
NavBut2.grid (row=10, column=25, padx=6, pady=6, columnspan=3) > #widget bindings > NavBut2.bind('', lambda e:GoPrev(ctr)) > > > > my problem is at the 6th line: showbuttons() > the error says "global name "showbuttons" is not de

Re: sorting a list numbers stored as strings

2007-09-24 Thread Amit Khemka
> Hi, >>> l = ["1", "11", "2", "22"] >>> sorted(l, cmp = lambda x, y: cmp(int(x), int(y))) # provide your own compare function ! >>> l ['1', '2', '11', '22'] Cheers, -- Amit Khemka website: www.onyomo.com wap-site: www.owap.in -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a list numbers stored as strings

2007-09-24 Thread Amit Khemka
On 9/24/07, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-09-24 at 16:53 +0530, Amit Khemka wrote: > > On 9/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > >>> l = ["1", "11", "2", "22"]

Re: generating range of numbers

2007-10-03 Thread Amit Khemka
comprehension, for more have a look at http://docs.python.org/tut/node7.html#SECTION007140000 Cheers, -- Amit Khemka website: www.onyomo.com wap-site: www.owap.in -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP me Am very new one To python

2007-10-04 Thread Amit Khemka
e that you like and suits your needs. If you still get struck , please post specific issues. I wish and hope learning python would be a pleasing experience ! Cheers, amit. -- Amit Khemka website: www.onyomo.com wap-site: www.owap.in -- http://mail.python.org/mailman/listinfo/python-list

Re: Last value of yield statement

2007-10-10 Thread Amit Khemka
doing this please? > Well the basic trouble is that the yield statement you see there > causes it to print the list over and over again when a string > containing "msgid" is found and the subsequent conditions are > satisfied. I just want the last list the yield sta

Re: use lines as argument to a command

2007-10-15 Thread Amit Khemka
gument. Have a look at subprocess module http://docs.python.org/lib/module-subprocess.html If there is some else that you meant, please specify . Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: use lines as argument to a command

2007-10-15 Thread Amit Khemka
uting a linux command "dmesg>>stat.txt")? Since subprocess module allow you to call programs through (linux) shell , you can use the same syntax in your command. example: >>> from subprocess import call >>> call("echo foo >> bar.txt", shell=True) Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: easy but difficult

2007-10-16 Thread Amit Khemka
bc_file'): data = line.strip().split('#') # add the numbers to the 'alphabet' key as a list d[data[0]] = d.get(data[0], []) + [data[1]] Now you can just iterate over the dictionary and write it into a file Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: importing modules question

2007-10-18 Thread Amit Khemka
ike this: import loadee if __name__ == "__main__": l = loadee.loadee() Alternatively you can directly import the objects defined in a module by : from loadee import loadee if __name__ == "__main__": l = loadee() cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to generate alternate toggling values in a loop?

2007-10-18 Thread Amit Khemka
> Rather than spelling out the final result, I'll give you hints: Look at > itertools.cycle and itertools.izip. > Why not just use enumerate ? clvalues = ["Even", "Odd"] for i, (id, name) in enumerate(result): stringBuffer.write(''' %d %s ''' % (clvalues[i % 2], id, name)) Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: Order by value in dictionary

2007-10-18 Thread Amit Khemka
> backitems=heapq.nlargest(1000, backitems, operator.itemgetter(1)) > a=[ backitems[i][0] for i in range(0,len(backitems))] > a.reverse() > return a > Btw, there are specialized algorithms called "Selection Algorithms" for finding k largest items in a collection. http://en.wikipedia.org/wiki/Selection_algorithm Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: vote for Python - PLEASE

2007-10-20 Thread Amit Khemka
ven if the poll results do not accurately reflect the intended purpose, they may be, just may be, give an idea of size of community and just how much that 'one' lie they will live with to see 'their' language ahead ;-) ! cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi to every one

2007-10-22 Thread Amit Khemka
ches in my existed cluster at my college. Just > look for python development held in this area. > Hey i was active member of this from last 2 year, i had just changed my > email address. Have a look at : http://cheeseshop.python.org/pypi?%3Aaction=browse Cheers, -- Amit Khemka -- http://mail.

Re: Iteration for Factorials

2007-10-22 Thread Amit Khemka
7;t it surprise you if the code that you posted goes in infinite loop ?! 2. why do you use condition: n < 100 3. How do you think that your function will calculate the factorial ? 4. Instead of "input" use "raw_input", and then "cast" the input as integer . Cheers, amit. -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: How can i protect text format ?

2007-10-23 Thread Amit Khemka
ine 1 hi line 2 how r u".. > How can i protect \n characters ? I don't think the issue has anything to do with python. I guess while you are displaying the text into an HTML page the "\n" characters should be replaced by "" to appear as newlines. Cheers, -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists and Sublists

2007-10-24 Thread Amit Khemka
age'] = ['line noise', 'cryptic'] > keywords['python'].append('readable') > To add you may want to have a look at "shelve" module , in case you want to store this object to a file. It can be useful if the data set is large and does not change frequently and you would want to save on some startup time . cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: Which persistence is for me?

2007-11-01 Thread Amit Khemka
nction (c.insert?). > > Is there some other interface/database that I might like better? Why you can always look at some "pure" database solutions. If persistence is all you require, have a look at "anydbm" and or "shelve" modules . Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: Explanation about for loop

2007-01-11 Thread Amit Khemka
On 11 Jan 2007 20:48:19 -0800, raghu <[EMAIL PROTECTED]> wrote: > can any one help me explaining for loop and its execution and its > syntax with a simple example. Well Guido did that: http://docs.python.org/tut/node6.html#SECTION00620 -- Amit Khemka -- ony

Re: How to find out if another process is using a file

2007-01-19 Thread Amit Khemka
http://www.physiol.ox.ac.uk/Computing/Online_Documentation/lsof-quickstart.txt cheers, -- Amit Khemka -- onyomo.com Home Page: www.cse.iitd.ernet.in/~csd00377 Endless the world's turn, endless the sun's Spinning, Endless the quest; I turn again, back to my own beginning, And here,

Re: Trouble with for loop

2007-11-06 Thread Amit Khemka
at each of the variables namely a, b, > c, ## can take value from 1 to 9. > How do I go about this ? An ugly code for it would be ;-) : for (a, b, c, d, e, f) in zip(*[range(1, 10)]*6): print a, b, c, d, e, f Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: manually cutting a picture

2007-11-06 Thread Amit Khemka
uot; operations can be optimized calculating a factor "m*m/N" and doing all merges together. 2. You can also maintain a 'size' attribute with each piece, so that all the pieces generated are of approximately same size. Please let me know if you have other ideas. Cheers, -- -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

Re: manually cutting a picture

2007-11-08 Thread Amit Khemka
On 11/7/07, Cameron Walsh <[EMAIL PROTECTED]> wrote: > Amit Khemka wrote: > > > Cut image by "m X m" grid (bigger the m, the more varied shapes you > > would be able to generate), this will give you m*m square pieces. With > > each piece store a vector whic

Re: What is python?????

2007-11-17 Thread Amit Khemka
On 11/17/07, Cope <[EMAIL PROTECTED]> wrote: > > In our place we eat pythons for curry. Its delicious. > And how about your python? > > Cope Not much of the difference here, it is just a bit more flexible. My python goes and brings me whatever I wish to eat. Cheers, -- --

Re: How do I not make a list?

2007-11-29 Thread Amit Khemka
rator or whatever it's called, with a passed in > operation? Well I think what you want is to use "()" instead of "[]" >>> l = (i for i in range(1,20)) >>> l Cheers, -- Amit Khemka -- http://mail.python.org/mailman/listinfo/python-list

using pdb and catching exception

2007-12-01 Thread Amit Gupta
Py'ites I am using pdb to check my code, and I would like to put a statement like equivalent of "C++gdb>catch throw". Basically, I would like debugger to start as soon as an exception is thrown. How may I do it? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: using pdb and catching exception

2007-12-03 Thread Amit Gupta
On Dec 1, 11:14 pm, Frank Millman <[EMAIL PROTECTED]> wrote: > See this post from less than a week ago. > > http://tinyurl.com/2zyr7u > > I think that the message from Diez B. Roggisch has what you are > looking for. > > Frank Millman Thanks Frank. But again, this results into stack-track when the

Re: using pdb and catching exception

2007-12-03 Thread Amit Gupta
On Dec 3, 11:10 am, Amit Gupta <[EMAIL PROTECTED]> wrote: > > > Thanks Frank. But again, this results into stack-track when the > exception is caught. On the other hand, I would like the debug-trace > just before throwing the exception. As a case, I might be debugging > co

getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
Hi How do I get user defined attributes of a class? e.g Class A(object) : self.x = 1 -- I want something like: for userattrib in A.getAllUserAttribute() : print userattrib My question is, is there a builtin function, called getAllUserAttributes? Thanks -- http://mail.p

Re: getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > > Class A(object) : > > self.x = 1 > > This is not valid Python code. > > > I want something like: > > for u

Re: getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
On Feb 6, 2:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Amit Gupta schrieb: > > > > > On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > &

loading dictionary from a file

2008-02-06 Thread Amit Gupta
Need a python trick, if it exists: I have a file that stores key, value in following format -- "v1" : "k1", "v2" : "k2" -- Is there a way to directly load this file as dictionary in python. I could do (foreach line in file, split by ":" and then do dictionary insert). Wondering, if some python bu

Re: loading dictionary from a file

2008-02-06 Thread Amit Gupta
On Feb 6, 5:33 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Amit Gupta <[EMAIL PROTECTED]> writes: > > Need a python trick, if it exists: > > > I have a file that stores key, value in following format > > -- > > "v1" : "k1", > > &

Re: re question

2008-02-07 Thread Amit Gupta
On Feb 7, 10:38 am, Amit Gupta <[EMAIL PROTECTED]> wrote: > Python'ites > > I searched around "google" to find the answer to this question, but I > can't: > > I have a named regexp : x = re.compile("(?P[a-z]+)") > > What I want is an

re question

2008-02-07 Thread Amit Gupta
Python'ites I searched around "google" to find the answer to this question, but I can't: I have a named regexp : x = re.compile("(?P[a-z]+)") What I want is an iterator, that can return me both the "groupname" and the matched string, e.g: m = x.search("aa") Somehow, I want to get {"me" : "aa"

Re: getting all user defined attributes of a class

2008-02-07 Thread Amit Gupta
On Feb 7, 12:28 am, grflanagan <[EMAIL PROTECTED]> wrote: > On Feb 6, 11:07 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > > > Hi > > > How do I get user defined attributes of a class? e.g > > > Class A(object) : > > self.x = 1 > > ---

seperate directory for .pyc files

2008-02-15 Thread Amit Gupta
Python'ites Is there an environment variable or some settings, that python can use to know the directory name for dumping .pyc files. Not a hard-requirement, I just don't like pyc files alongwith py files in my work area. Thanks A -- http://mail.python.org/mailman/listinfo/python-list

packing things back to regular expression

2008-02-20 Thread Amit Gupta
Hi I wonder if python has a function to pack things back into regexp, that has group names. e.g: exp = ([a-z]+) compiledexp = re.compile(exp) Now, I have a dictionary "mytable = {"a" : "myname"} Is there a way in re module, or elsewhere, where I can have it match the contents from dictionary to

Re: packing things back to regular expression

2008-02-20 Thread Amit Gupta
Before I read the message: I screwed up. Let me write again >> x = re.compile("CL(?P[a-z]+)") # group name "name1" is attached to the match of lowercase string of alphabet # Now I have a dictionary saying {"name1", "iamgood"} # I would like a function, that takes x and my dictionary and return "C

unitests don't run under pdb

2008-02-20 Thread Amit Gupta
do "python -m pdb testnames.py": I get ython -m pdb testnames.py > /s/nd6/amit/pyiglu/testnames.py(1)() -> import unittest (Pdb) c -- Ran 0 tes

Re: packing things back to regular expression

2008-02-24 Thread Amit Gupta
> "CL(?P[a-z]+)XY(?:AB)[aeiou]+(?PCD(?P..)\?EF)" > > Good luck. > > -- > Steven This is what I did in the end (in principle). Thanks. A -- http://mail.python.org/mailman/listinfo/python-list

Re: unitests don't run under pdb

2008-03-14 Thread Amit Gupta
On Feb 20, 8:51 pm, Miki <[EMAIL PROTECTED]> wrote: > Hello Amit, > > > > > python testname.py : the unitests runs as usual and I get the > > following results: > > -

Error with SOAPpy

2008-12-13 Thread Amit Goyal
and the following versions. >>> xml.__version__ '0.8.4' >>> fpconst.__version__ '0.7.2' >>> SOAPpy.__version__ '0.12.0' Regards, Amit -- http://mail.python.org/mailman/listinfo/python-list

ctype question

2009-06-04 Thread Amit Gupta
ctypes.cdll.LoadLibrary("A.so"), it gives errors about the undefined Symbols. Even if I load B.so before loading A.so, the error remains the same (which is expected). Can someone help me to find out, how to load A.so by telling it to look for undefined symbols in B.so as well? Thanks, Amit -- http://mail.

SImple python print question

2008-05-16 Thread amit . uttam
he "-#- executing: 0053" statement. e.g. -#- executing: 0053 FAIL Some tests take a long time to finish thus the screen is blank until the entire test finishes and the above statement is outputted. Thanks for any help. Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: SImple python print question

2008-05-16 Thread amit . uttam
On May 16, 4:02 pm, Hans Nowak <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hey there, > > > I have a simple question about python print statement. Take the > > following code snippet for example... > > > 1 print "-#- executing: %s" % section, > > 2 tests[section] = test.testcase(name=

Re: SImple python print question

2008-05-16 Thread amit . uttam
ma: > > print "whatever", > sys.stdout.flush() > > 2. Run Python in unbuffered mode, by using the -u switch: > > python -u yourscript.py > > Carl Banks Thanks for the reply. This worked as expected. I did not know about the -u switch, this is good stuff. Amit -- http://mail.python.org/mailman/listinfo/python-list

Separate output for log file and stdout

2008-05-16 Thread amit . uttam
ogging? Thanks, Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: Separate output for log file and stdout

2008-05-19 Thread amit . uttam
stores all the output of the commands being run (e.g. tcl scripts, etc). Will this be possible using the built in python logging module? Thanks, Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: Separate output for log file and stdout

2008-05-21 Thread amit . uttam
>> to meet your listed requirements, without need of external > >> dependencies. > > > Hmm..Yeah I didn't realize python had its own standard logging > > facility. I took a look at it and it seems to do the job. However, the > > output seems to be syslog style o

Re: Separate output for log file and stdout

2008-05-21 Thread amit . uttam
>> to meet your listed requirements, without need of external > >> dependencies. > > > Hmm..Yeah I didn't realize python had its own standard logging > > facility. I took a look at it and it seems to do the job. However, the > > output seems to be syslog style o

would this be called bug?

2008-05-23 Thread Amit Gupta
The code is attached below. Basically I am taking a substring of variable m, and using "buffer" instead of slicing. However, the application of int on that buffer start correctly from the offset, but it scans all the way to the end, instead of stopping at the length of the buffer. It works howeve

python scripts to standalone executable

2008-03-31 Thread Amit Gupta
python on linux (ActiveState has nothing)? Any other related commets are also welcome. Thanks Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question - Overloading ==

2008-03-31 Thread Amit Gupta
On Mar 31, 10:23 am, xkenneth <[EMAIL PROTECTED]> wrote: > > class A: > def __eq__(self,other): > return self.a == other.a and self.b == other.b > > class B: > def __eq__(self,other): > return self.a == other.a and self.c == other.c > > Thanks! > > Regards, > Kenneth Mille

Re: python scripts to standalone executable

2008-03-31 Thread Amit Gupta
On Mar 31, 10:37 am, John Henry <[EMAIL PROTECTED]> wrote: > On Mar 31, 10:24 am, Amit Gupta <[EMAIL PROTECTED]> wrote: > > > > > Hi > > > I am looking for a some tool that can convert python scripts to > > executable on Linux. > > > I found f

Re: python scripts to standalone executable

2008-03-31 Thread Amit Gupta
ays it works for python until version 2.4. I am using 2.5.1. Not sure if it will work seamlessly, but I will try. If anyone has experience to share on using pyinstaller on 2.5.1 or higher, please share. Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question - Overloading ==

2008-03-31 Thread Amit Gupta
On Mar 31, 11:00 am, xkenneth <[EMAIL PROTECTED]> wrote: > Yeah, this is what I'm talking about: > > > def __eq__(self, other) : > > try : > > return <> > > except AttributeError: > > return False > > That seems a bit nasty to me. One thing about python (IMO); you can't just say this

Re: python scripts to standalone executable

2008-03-31 Thread Amit Gupta
On Mar 31, 1:52 pm, Mike Driscoll <[EMAIL PROTECTED]> wrote: > > What about creating a setup.py and using the distutils command to > build rpms or tarballs? > > http://docs.python.org/dist/built-dist.html > > Mike My quick look: The link you sent is under the header "Distributing Python Modules".

Re: Does anyone know where is the Berkeley XML Database documentation for its Python API?

2006-04-04 Thread Amit Khemka
ammer.html ) for details. You may also find http://blog.gmane.org/gmane.comp.db.dbxml.general useful. cheers, amit. On 4 Apr 2006 01:34:25 -0700, Sullivan WxPyQtKinter <[EMAIL PROTECTED]> wrote: > I have been looking for python API documentation of BDBXML for quite a > few days b

Re: Splitting a string with extra parameters

2006-04-06 Thread Amit Khemka
I guess you should use "re" module ... In this case re.split("\D,\D", YOUR_STRING) should work. (splits only when "," is between two non-digits). for details and more options see python-docs. cheers, amit. On 4/6/06, Fulvio <[EMAIL PROTECTED]> wrote:

Re: reading files in small chunks?

2006-04-14 Thread Amit Khemka
? > > Thank You. It has basically to do with disk seeks and cache+memory utilization. and you can look around for the same for details on any of your fav search engine. cheers, amit. > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Amit Khemka -- o

Re: Calling multiple programs with subprocess

2010-04-23 Thread Amit Uttamchandani
On Thu, Apr 22, 2010 at 10:12:47PM -0400, Dave Angel wrote: > amit wrote: > >How does one go about calling multiple programs using subprocess? > > > >This is the program flow: > > > >C:\> wrenv.exe > >C:\> make clean > >.. > >.. > &

Re: [SOLVED] Calling multiple programs with subprocess

2010-04-30 Thread Amit Uttamchandani
On Sat, Apr 24, 2010 at 08:22:14AM +0530, Kushal Kumaran wrote: [snip] > > Run a shell (cmd.exe, I think) using subprocess and send it the > commands you want to run using the communicate() method. > Actually, I ended up using stdin.write('...\n'), and it works as expected: # #

[no subject]

2010-06-03 Thread Amit Sethi
Hi , I wish to execute some user submitted python code and have absolutely no other way out . I saw that there used to be a module called rexec which could define which modules can be imported and which cannot however exec doesn't have that kind of feature . Please if you could tell me what would

sandboxing python code

2010-06-03 Thread Amit Sethi
On Thu, Jun 3, 2010 at 9:12 PM, Shashwat Anand wrote: > I have not much idea but Online Judges like SPOJ/codechef have regular > programming-contests and python is one of allowed languages. So yes, it's I am trying to make an online test for Python . P.S Sorry ,I did not realize I sent the mail

Re: Extract sigle file from zip file based on file extension

2017-02-10 Thread Amit Yaron
On 10/02/17 10:35, loial wrote: I need to be able to extract a single file from a .zip file in python. The zip file will contain many files. The file to extract will be the only .csv file in the zip, but the full name of the csv file will not be known. Can this be done in python? Yes, you can

Re: int vs. float

2017-02-10 Thread Amit Yaron
On 10/02/17 04:33, adam14711...@gmail.com wrote: Hello, My computer programming professor challenged me to figure out a way to manipulate my program to display one error message if the user input is a zero or a negative number, and a separate error message if the user input is a decimal numbe

Re: int vs. float

2017-02-10 Thread Amit Yaron
On 10/02/17 21:15, Peter Pearson wrote: On Fri, 10 Feb 2017 13:59:45 +0200, Amit Yaron wrote: On 10/02/17 04:33, adam14711...@gmail.com wrote: Hello, My computer programming professor challenged me to figure out a way to manipulate my program to display one error message if the user input is

Re: int vs. float

2017-02-11 Thread Amit Yaron
On 11/02/17 09:47, boB Stepp wrote: On Sat, Feb 11, 2017 at 1:00 AM, Amit Yaron wrote: On 10/02/17 21:15, Peter Pearson wrote: On Fri, 10 Feb 2017 13:59:45 +0200, Amit Yaron wrote: On 10/02/17 04:33, adam14711...@gmail.com wrote: My computer programming professor challenged me to

Re: Unsubscribe to Python email list

2017-03-10 Thread Amit Yaron
On 10/03/17 04:38, Pablo Lozano wrote: Good day, I would like to unsubscribe this e-mail to the Python e-mail list. Kind regards You can set "Mail Delivery" to "disable" if you want to read posts on the Usenet, but not to receive e-mails. -- https://mail.python.org/mailman/listinfo/python-li

Re: i got error while writing data to file

2017-03-13 Thread Amit Yaron
You open the file more than once for which row with score greater than 3. Every time you open a file for writing it truncates an existing one with the same name. On 13/03/17 13:25, Madhusudhanan Sambath wrote: hi to all, this is madhu...i am new to python this is my python code, where i label

Re: Python27.dll module error from Python 2.7.15/PCbuild/get_externals.bat

2018-06-30 Thread Amit Kumar Singh
Yes pylauncher was installed when I installed 3.6.4. Moreover, the python in externals\pythonx86 is supposed to be able to parse it's own code but it errors out in my case. Can you provide me the list of all the external modules with it's dependencies if possible ? I will pull those separately a

Python Speech tools

2007-04-10 Thread Amit K Saha
Hi list I intend to design a Speech Recognition system.Can I have some pointers to the available Python speech tools? Till date I am aware of only Python bindings for a speech tool called Snack (http://www.speech.kth.se/snack/) Any help will be appreciated. -- Amit K Saha <[EMAIL PROTEC

Re: Python-list Digest, Vol 43, Issue 155

2007-04-10 Thread Amit K Saha
Hi mike! > > I've played with the win32 module's text-to-speech abilities a little. > > You may be able to get ideas from that. Here's a link to more info: > > http://surguy.net/articles/speechrecognition.xml > > > > http://www.cs.unc.edu/~parente/tech/tr02.shtml > > I forgot to mention that I am

Writing Object Data to Disk

2007-09-21 Thread Amit Kumar Saha
nly way of writing it to disk for persistent storage. Also, do we have a concept similar to "array of objects" in Python? The number of objects is only known at "run-time". Thanks, -- Amit Kumar Saha me blogs@ http://amitksaha.blogspot.com URL:http://amitsaha.in.googlepages.co

Re: Re: Writing Object Data to Disk

2007-09-22 Thread Amit Kumar Saha
> > From: Lawrence D'Oliveiro <[EMAIL PROTECTED]> > > In message <[EMAIL PROTECTED]>, > > Amit Kumar > > Saha wrote: > > > > > I would like to know if "Pickling" the class object is the only > > way of > > > w

Re: [Bulk] Re: Writing Object Data to Disk

2007-09-23 Thread Amit Kumar Saha
s of now I am ready-to-roll with Python specific pickling. XML will be used in a later version of my code! Regards, Amit -- Amit Kumar Saha me blogs@ http://amitksaha.blogspot.com URL:http://amitsaha.in.googlepages.com -- http://mail.python.org/mailman/listinfo/python-list

Printing dictionary values rather than references

2009-06-10 Thread Amit Dor-Shifer
classA, "attr-1", "val-1") dict['a']= classA print classA ''' Desired output: {'attr-1': 'val-1'}''' print dict ''' Actual output: {'a': <__main__.MyClass instance at 0x79cfc8>}''' Thanks, Amit -- http://mail.python.org/mailman/listinfo/python-list

Potential Security Bug

2019-03-20 Thread Laish, Amit (GE Digital)
Hello, I’m Amit Laish, a security researcher from GE Digital. During one of our assessments we discovered something that we consider a bug with security implications which can cause a denial of service by disk exhausting, and we would like to share it with you, and hear you opinion about it

<    1   2