Re: Problem in importing pandas

2020-04-24 Thread Amit Jain
For the same problem, The solution, I found is to install package spicy. Then *import spicy* along with *import pandas. * It really works - But the instructions should be - *import spicy* *import pandas* On Fri, 24 Apr 2020, 01:12 MRAB, wrote: > On 2020-04-23 18:57, Amit Jain wr

Problem in importing pandas

2020-04-23 Thread Amit Jain
Dear Sir/Madam, After *successful installation of PIP for PANDAS *when I try to *import pandas*, It gives error as given below - >>> import pandas as pd Traceback (most recent call last): File "", line 1, in import pandas as pd File "C:\Users\Amit\AppData\Local\

Regarding problem faced to run pandas

2020-04-20 Thread Amit Jain
ards * *Amit Kumar Jain* *Jaipur, Rajasthan* *India* -- *Thanks & Regards * *Amit Kumar Jain* *PGT(CS)* *KVS, (Under **Ministry of HRD)* -- https://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

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

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

2018-06-29 Thread amit . singh2241
nto the same trap though it goes ahead and compiles but then compiler throws error due to half-baked external modules. Any help will be highly appreciated ! --Amit Kumar Singh -- https://mail.python.org/mailman/listinfo/python-list

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: 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: 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: 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-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: 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

Numpy and Scipy for Python3.5

2017-02-03 Thread Amit Yaron
Can I find those modules in the FreeBSD ports? -- https://mail.python.org/mailman/listinfo/python-list

Re: argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Amit Ramon
r program to decide what to do with the arguments it receives (So in your examples, rm would actually try to remove the "foo" directory). And although stripping the '--' is easy, why should the user of argparse need to handle it? Still unclear to me. Cheers, Amit -- https://mail.python.org/mailman/listinfo/python-list

argparse: use of double dash to separate options and positional arguments

2015-11-06 Thread Amit Ramon
t easy to check for it and remove it if it exists, but it still seems like it shouldn't be there - it is not really an argument, just a delimiter. Am I doing anything wrong, or is this a bug? I hope someone here can shed some light on this. Thanks, Amit -- -- https://mail.python.org/mailman/listinfo/python-list

Re: Calling Python Script from an SQL Proceudre

2015-06-04 Thread Amit Goutham
Hi Laura, Thanks a Lot for the reply. I wanted to know if calling a Python script from SAP HANA database is possible. Thanks! On Jun 3, 2015 9:43 PM, "Laura Creighton" wrote: > In a message of Wed, 03 Jun 2015 15:17:16 +0530, Amit Goutham writes: > >Hi All, > >I a

Calling Python Script from an SQL Proceudre

2015-06-03 Thread Amit Goutham
, Amit Goutham Ph:+91-8867801035 -- https://mail.python.org/mailman/listinfo/python-list

Have you ever wondered why there are so many flavors of python. This post answers all your queries.

2014-03-25 Thread Amit Khomane
http://www.techdarting.com/2014/03/why-different-flavors-of-python.html -- https://mail.python.org/mailman/listinfo/python-list

Re: input() on python 2.7.5 vs 3.3.2

2013-12-12 Thread Amit Saha
line 1 > Hello there > ^ > SyntaxError: unexpected EOF while parsing In Python 2, input() expects valid Python as it's input. If you provide your input as 'Hello there' (a Python string), it won't complain. HTH, Amit. -- http://echorand.me -- https://mail.python.org/mailman/listinfo/python-list

Re: Python application for rpm creation

2013-11-26 Thread Amit Saha
elf writing > something. > > if you guys ( others ) got something else for Redhat Linux rpm creation do > let me know. I played with creating a RPM SPEC file "generator" for Sphinx documentation: https://github.com/amitsaha/sphinx_doc_packaging It's written in Python, so

Re: Using try-catch to handle multiple possible file types?

2013-11-18 Thread Amit Saha
haps you would be better off using MIME types instead. Assuming you go ahead with using MIME type, how about using python-magic to detect the type and then look in your dictionary above, if there is a corresponding file_opener object. If you get a KeyError, you can raise an exception saying t

Re: How can I get the variable to subtract the input please?

2013-11-18 Thread Amit Saha
have to convert the input into a data type such as an integer or a float and then try to do any mathematical operation: >>> int(age) - 10 0 >>> float(age)-10 0.0 Hope that helps. Best, Amit. -- http://echorand.me -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASED] Python 3.3.0

2012-09-29 Thread Amit Saha
On Sat, Sep 29, 2012 at 10:37 PM, Dave Angel wrote: > On 09/29/2012 08:23 AM, Amit Saha wrote: >> On Sat, Sep 29, 2012 at 10:18 PM, Georg Brandl wrote: >>> >>> >>> For a more extensive list of changes in 3.3.0, see >>> >>> http://docs

Re: [Python-Dev] [RELEASED] Python 3.3.0

2012-09-29 Thread Amit Saha
ons such as "sendfile()" > * Hash randomization, introduced in earlier bugfix releases, is now >switched on by default > > In total, almost 500 API items are new or improved in Python 3.3. > For a more extensive list of changes in 3.3.0, see > > http://docs.python.org/3.3/whatsnew/3.3.html Redirects to http://docs.python.org/py3k/whatsnew/3.3.html: 404 Not Found. Cheers, Amit. -- http://echorand.me -- http://mail.python.org/mailman/listinfo/python-list

Re: Invalid syntax error

2012-03-10 Thread Amit Sethi
Its an indentation error -- A-M-I-T S|S -- http://mail.python.org/mailman/listinfo/python-list

BaseHTTPServer ThreadMixIn not working

2011-10-03 Thread amit
Hi everyone, I am really stuck in a very simple problem and wanted to know if you could take some time to check it out - My code is simple. Using BaseHTTPServer and ThreadInMix I want to run a python script (Script1.py) for every request made simultaneously. My code-> from subprocess import PIPE

Default Admin user on weblogic domain deleted after executing create command using WLST

2011-09-12 Thread Amit Jain
oup/comp.lang.java.programmer/browse_thread/thread/1927322accdb6e6e/223e1c7cd208a86c Please suggestion... regards, Amit J. -- http://mail.python.org/mailman/listinfo/python-list

Re: about if __name == '__main__':

2011-08-28 Thread Amit Jaluf
On Aug 28, 12:51 pm, Ian Kelly wrote: > On Sun, Aug 28, 2011 at 9:34 AM, Amit Jaluf wrote: > > hello group > > > i have one question about this > > > if __name == '__main__': sorry dear for this and thanks all of you for this -- http://ma

about if __name == '__main__':

2011-08-28 Thread Amit Jaluf
hello group i have one question about this if __name == '__main__': is it same as other languages like[c,c++] main function. because of i google and read faqs and also " http://docs.python.org/faq/programming#how-do-i-find-the-current-module-name"; this and i am confused. thanks -- http://m

Re: indentation

2011-08-11 Thread Amit Jaluf
On Aug 11, 8:15 am, MRAB wrote: > On 11/08/2011 13:56, Amit Jaluf wrote:> Hello Group, > > i just start python is it necessary indentation in python ? > > Yes, indentation is part of the language. > > Even in programming languages where it isn't necessary, it's

indentation

2011-08-11 Thread Amit Jaluf
Hello Group, i just start python is it necessary indentation in python ? thanks in advance ... -- http://mail.python.org/mailman/listinfo/python-list

MemoryError vs malloc error

2011-07-15 Thread Amit Dev
ng in pure python code (Eg. if ' '.join(biglist)) etc. Regards, Amit -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory Usage of Strings

2011-03-16 Thread Amit Dev
;|^USER\\>' amdev 6906 0.0 0.1 3508 1424 p0 R+9:57PM 0:00.00 egrep \\<6903\\>|^USER\\> (sh) Regards, Amit On Thu, Mar 17, 2011 at 3:21 AM, Dan Stromberg wrote: > > On Wed, Mar 16, 2011 at 8:38 AM, Amit Dev wrote: >> >> I'm observing a strange m

Re: Memory Usage of Strings

2011-03-16 Thread Amit Dev
sum(map(len, l)) => 8200 for 1st case and 9100 for 2nd case. Roughly 100MB as I mentioned. On Wed, Mar 16, 2011 at 11:21 PM, John Gordon wrote: > In Amit Dev > writes: > >> I'm observing a strange memory usage pattern with strings. Consider >> the followi

Memory Usage of Strings

2011-03-16 Thread Amit Dev
he string size, it remains high till it reaches around 1000. In that case it is back to 100MB usage. Python 2.6.4 on FreeBSD. Regards, Amit -- http://mail.python.org/mailman/listinfo/python-list

Reference Cycles with instance method

2011-03-08 Thread Amit Dev
ppears to be a cycle (between method m2 and A). I would expect this to behave the same as having another method "def m2(self): self.m1()", but unfortunately its not. In above case m2 seems to be in a.__dict__ which is causing the cycle. Any idea why this is so? Regards, Amit -- http://ma

Re: Executing js/ajax in a sandboxed environment

2011-02-27 Thread Amit Sethi
On Sun, Feb 27, 2011 at 10:26 AM, Rohan Malhotra wrote: > BeautifulSoup library only fetches source of page. I need the access > to DOM after js execution with url as input parameter. > > Any pointers? > I am not sure but in case you need to make some ajax requests mechanize might help. http://

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

[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

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: # #

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 > >.. > >.. > &

Calling multiple programs with subprocess

2010-04-22 Thread amit
n the 'make clean' command. Any help is appreciated. Thanks, Amit -- http://mail.python.org/mailman/listinfo/python-list

compilation problem of python on AIX 6.1

2009-07-12 Thread Amit
Hello I want to intsall python on my AIX 6.1 Box. I couldn't get any rpm for python 2.5.x for AIX 6.1. THen I decided to compile python 2.5.4 on my AIX box. I downloaded the python source code from www.python.org and tried to compile on my AIX both using gcc. step 1 ./configure --with-gcc config

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

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.

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

Simple Python Project Structure

2008-10-10 Thread amit
have to be in the same directory. For example, project/ util/ config/ tests/ start.py I have a module in util/console.py, how do I import that. In start.py I have: from project.util.console import filetest but I get an ImportError. Thanks! Amit -- http://mail.python.org

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

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

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

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: 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

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=

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: 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: 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
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: 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: 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

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: 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: > > -

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

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-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

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

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

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: 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 > > ---

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: 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", > > &

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: 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: > &

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

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: 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

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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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

  1   2   >