interpreter, and implement a lock on it so it can't
be called simultaneously by multiple threads?
Thanks
Amit
--
http://mail.python.org/mailman/listinfo/python-list
to handle/catch python exceptions in the
embedding Python code?
Forgive me if I have asked too many questions in one eMail, it is
becuase I don't really know where to start learning this subject from.
Thanks
Amit
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
Is there any kind of performance differences to the different ways of
embedding python?
PyEval_EvalCode()
PyRun_SimpleFile()
PyObject_CallObject()
Thanks
Amit
--
http://mail.python.org/mailman/listinfo/python-list
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
Make money to share your videos
Goodtolove.com is sharing their 50% adsense revenue with you to post
videos of anything.
Just keep up logging in and start posting now to make money...
--
http://mail.python.org/mailman/listinfo/python-list
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
n
the 'make clean' command.
Any help is appreciated.
Thanks,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
Its an indentation error
--
A-M-I-T S|S
--
http://mail.python.org/mailman/listinfo/python-list
ng in pure
python code (Eg. if ' '.join(biglist)) etc.
Regards,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
Hello Group,
i just start python is it necessary indentation in python ?
thanks in advance ...
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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://
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
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
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
;|^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
Can I find those modules in the FreeBSD ports?
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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\
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
==
Open Source Developers' Conference,
26-28 February, 2006, Netanya, Israel
==
Announcement and Call for Papers
http://www.osdc.org.il/call_for_paper.html
About
--
The Open Source Developers' Conferences (OSDCs) are gras
==
Open Source Developers' Conference,
26-28 February, 2006, Netanya, Israel
==
Announcement and Call for Papers
http://www.osdc.org.il/call_for_paper.html
About
--
The Open Source Developers' Conferences (OSDCs) are gras
mple string and check the
condition, I
was wondering if there is any smarter way of doing the same, may be
using regular-expressions.
Thanks,
amit.
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
, 2, 'foobar1', (3, 1)),
('foo2', 2, 'foobar2', (3, 2))"
output: [('foo', 1, 'foobar', (3, 0)), ('foo1', 2, 'foobar1', (3, 1)),
('foo2', 2, 'foobar2', (3, 2))]
I hope that explains it better...
cheers,
Fredrik, thanks for your suggestion. Though the html page that are
generated are for internal uses and input is verified before
processing.
And more than just a solution in current context, actually I was a
more curious about how can one do so in Python.
cheers,
amit.
On 11/22/05, Fredrik Lundh
thanks for you suggestions :-) ..
cheers,
On 11/23/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> I wrote:
>
> > if you cannot cache session data on the server side, I'd
> > recommend inventing a custom record format, and doing your
> > own parsing. turning your data into e.g.
> >
> >"foo:1:
rd"
How do I manage to create an account usign the AddAccount() Python
function ??
--
-Amit
http://www.geocities.com/broamit
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQBC3HHp/u1Xr7tKTYARAv6eAJoDpKVv45v/M7NSH+xekpX6jasBJACeLcB/
lSIVQ0AMXFQrKPLZFOd6Qno=
=Tltk
--
I am a total newbie learning the very basics
I would like to excute a script and upon completion, how can I just a python
prompt with the functions and variables already defined.
I know you can do this in the window gui(IDLE). I was wondering if this can
be done in POSIX systems as well.
--
htt
Thanx Fredrik, that works and thats what I wanted.
Amit
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Amit Dhingra wrote:
>
> > I would like to excute a script and upon completion, how can I just a
python
> > prompt with the funct
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
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
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
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
http://www.techdarting.com/2014/03/why-different-flavors-of-python.html
--
https://mail.python.org/mailman/listinfo/python-list
,
Amit Goutham
Ph:+91-8867801035
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
oup/comp.lang.java.programmer/browse_thread/thread/1927322accdb6e6e/223e1c7cd208a86c
Please suggestion...
regards, Amit J.
--
http://mail.python.org/mailman/listinfo/python-list
,
- http://users.auriga.wearlab.de/~alb/msnlib/
cheers,
amit.
--
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
thank you all for ur suggestions .. I got msnp and curfoo(for yahoo)
customized and working :-) .. though they are pretty slow in
responding to messages ... will try jabber based
protocols,
cheers,
amit.
On 12/14/05, Linsong <[EMAIL PROTECTED]> wrote:
>Why not twisted.word
One way would be to use 'signal' s ... something like this should work
import signal
TIMEOUT = 5 # number of seconds your want for timeout
signal.signal(signal.SIGALRM, input)
signal.alarm(TIMEOUT)
def input():
try:
foo = raw_input()
return foo
except:
# timeout
return
ch
Ideally, I would have made a wrapper to add/delete/modify/read from
the dictionay.
But other than this, one way i can think straight off is to "pickle"
the dict, and to see if the picked object is same as current object.
cheers,
amit.
On 12 Jan 2006 01:15:38 -0800, [EMAIL PROTECTE
its "Python 2.4.1" .. on linux
On 12 Jan 2006 06:34:08 -0800, Thierry Lam <[EMAIL PROTECTED]> wrote:
> Is there a windows equivalent for that solution?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Endless the world's turn, endless the sun's spinning
Endless the quest;
I
I tried it on "Python 2.4.1" on '2.6.11-1.1369_FC4smp with gcc version
4.0.0' .. which works fine .. may be it could be an issue with some
other combinations ..
cheers,
amit
On 12 Jan 2006 07:35:57 -0800, Paul Rubin
<"http://phr.cx"@nospam.invalid> wrote:
>
Another thing that can be tried is:
import threading
a=""
def input():
global a
a = raw_input()
T = threading.Thread(target=input)
T.start()
T.join(2) ## does the trick
...
I have not tested it but i guess should work.
cheers,
amit.
On 1/12/06, Amit Khemka <[EM
On 7/20/06, Dara Durum <[EMAIL PROTECTED]> wrote:
> Hi !
>
> I want to encode filenames to safe format, like in browser url (space ->
> %20, etc.).
> What the module and function name that helps me in this project ?
>
import urllib
urllib.quote('file name'
sys
sys.path.append("/path/to/Base")
import file1
cheers,
amit.
--
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
if isinstance(_v, types.ListType):
> vals.extend(_v)
> else:
> vals.append(_v)
> # now we can safely iterate through acts
> for val in vals:
> .
how about:
oops ! my mistake :-D
On 7/31/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote:
> Amit Khemka wrote:
> > how about:
> >
> > vals = []
> > for val in mydict.values():
> > try: vals.extend(val)
> > except: vals.append(val)
>
> >>> l
2.0: "clean" the PIL build
2.1 In setup.py that comes with PIL, set the JPEG_ROOT to the jpeg-lib path
3.0 run setup.py
I hope that should help ..
cheers,
amit
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's turn, endless the
a python module "t1.py". And its very
logical that all the (global) variables in "t1.py" have the value
which one would expect after execution of the "t1.py" otherwise. And
hence you see value of counter as 1. (or in other words you are
accessing two different instan
nsidered using some native XML database like BDB XML.
1. It allows you to retain hierarchical structure of data.
2. It also has support for precompiled queries.
3. You can open a persistent connection.
cheers,
amit.
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd0037
uot;python" in the shell?
There could be various ways of doing so, like:
Option 1: open your shell preference file ( ex. for bash ~/.bashrc)
and add an alias: alias
python="/path/to/python/version/of/your/choise"
Option 2: make /usr/local/bin/python a symlink to python2.3.5
cheers
n submitting a request, client-server agree upon a port on which
client will listen for the results.
2. Registering a callback function.
(Googling would point to more elaborate discussions on pros and cons )
cheers,
amit.
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
E
er you want changes to the
NAME and then write the 'block' to a temperory file.
If you want the output to be written to same file just 'move' this
temperory file to the input file once you are done.
Note: if there is other stuff in the input file, apart from such
'blo
g.Logger.manager.loggerDict.values():
> .>>> l.handlers = []
You can "close" the logger by just removing the handler from the logging object
# first creater a logger and file handler
fooLogger = logging.getLogger('FOO')
fooLogger.setLevel(logging.INFO)
)
return module
But It looked like an overkill, Is there a more elegant and better way
of doing it ?
Thanks in advance,
cheers,
amit.
--
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
n script exits, the process 'bar' is
> still running and I have to issue ps -ef | grep 'bar' and then kill
> it.
>
> Is there any better way of doing this?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Amit Khemka -- onyomo.com
Home
f = output[:]
## ugly hack to work around references +
for i in range(len(l)-1):
for j in dfdf:
k = j[:]
output.append(k)
# hack -
for i in range(0, len(l)):
for l1 in
output[i*len(output)/len(l):((i+1)*len(output)/len(l))]:
l1.append(l[i])
print output
--
t; method.
Btw, did you looked at cElementTree module ? It claims to be much
'faster' and has very similar api as ElementTree Module.
link: http://effbot.org/zone/celementtree.htm
cheers,
amit.
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless t
did you considered using signals ?! I guess that could well serve the purpose ..
more of signals: http://docs.python.org/lib/module-signal.html
cheers,
amit.
On 7/6/06, Yves Glodt <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a daemon which runs permanently, and I want it
a particular network service, to
allow you to "distribute the database". In such case you can use
"nmap" with -p option, to find all the machines which are listening on
the particular port.
hth,
amit.
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
On 8/24/06, Amit Khemka <[EMAIL PROTECTED]> wrote:
> On 23 Aug 2006 21:46:21 -0700, damacy <[EMAIL PROTECTED]> wrote:
> > hi, sandra.
> >
> > no, it's not as complicated as that. all i want to do is to load a
> > database onto different machines residin
go about it?
You can use the parser constructor to specify the field seperator:
Python >>> parser(ms_double_quote = 1, field_sep = ',', auto_clear = 1)
cheers,
amit.
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's turn, endles
On 8/30/06, Amit Khemka <[EMAIL PROTECTED]> wrote:
> sonald <[EMAIL PROTECTED]> wrote:
> > Hi,
> > Can anybody tell me how to change the text delimiter in FastCSV Parser
> > ?
> > By default the text delimiter is double quotes(")
> > I want to chan
python code. ( In my network "nmap
-osscan_limit -p 22 -T5 Class_D_Network" completes in 1.5 seconds !)
cheers,
amit.
--
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
t csv # standard csv module distributed with python
inputFile = "csv_file_with_pipe_as_quotchar.txt"
reader = csv.reader(open(inputFile), quotechar='|')
for row in reader:
# do what ever you would like to do
cheers,
amit.
Amit Khemka -- onyomo.com
Home Page: www.
tup = map(int,date.split('/'))
l = (tup[2], tup[0], tup[1], 0, 0, 0)
epochs = calendar.timegm(l)
return (int(epochs))
HTH,
amit.
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's turn, endless the sun's Spin
return statement in
functions with two arguments.
for example:
def foo(self, value):
try:
a.x = value
return True, ''
except ValueError: return False, 'Float conversion error: %s' %(value)
and when ever u call the function, check the first return va
import urllib2
req = urllib2.Request('http://www.google.com')
# add 'some' user agent header
req.add_header('User-Agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:1.7.8) Gecko/20050524 Fedora/1.5 Firefox/1.5')
up = urllib2.urlopen(req)
cheers,
amit
--
---
..
cheers,
amit
On 2/9/06, Andrew Gwozdziewycz <[EMAIL PROTECTED]> wrote:
> On 2/7/06, Steve Holden <[EMAIL PROTECTED]> wrote:
> > [EMAIL PROTECTED] wrote:
> > > Someone out there must surely know - please!
> > >
> > > Peter
> > >
>
>
Hello, Is there a *direct* way of doing set operations on lists which
preserve the order of the input lists ?
For Ex. l1 = [1, 5, 3, 2, 4, 7]
l2 = [3, 5, 10]
and (l1 intersect l2) returns [5, 3] (and (l2 intersect l1)
returns [3, 5])
thanks in advance,
amit
...
>1299}
> End sels
>
> And turn it into an output file for each of the "sels" in the input file, i.e
> sel1.txt:
Once you have read Bruno's pointers ! Have a look at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/521877
cheers,
--
ogging up my python directory
Yes. You can tell python where all to look for importing modules.
import sys
sys.path.append("/this/is/my/modules/path")
> Thanks
Welcome !
cheers,
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
Home Page: www.cse.iitd.ernet.
ags" in the XML
May be you can use the above to check the xml and catch the "bogus" ones !
cheers,
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's turn, endless the sun's Spinning, Endle
hat is the exact syntax for to use it.
Thank you,
Amit
--
http://mail.python.org/mailman/listinfo/python-list
his? Thanks!
Were there any exceptions/error-messasges ?
Do you jpeg libraries installed for hadling jpeg format ?
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, b
On 23 May 2007 18:58:28 -0700, Bruce <[EMAIL PROTECTED]> wrote:
> On May 23, 5:31 pm, "Amit Khemka" <[EMAIL PROTECTED]> wrote:
> > On 23 May 2007 00:02:34 -0700, Bruce <[EMAIL PROTECTED]> wrote:
> >
> > > Hi, I want to compress a jpg file. e.g.
nd(path)
> else:
> f1(path)
> f1(start)
> return stack
>
>
> i feel s stupid right now
> forgot to call f1
>
> any comments how to make this better?
os.walk is just the way for you !
Cheers,
Amit Khemka -- onyomo.com
Home Page: www.cse.
n that tuple ?!
Or do you want to store the unicode string as one of the member in a
tuple ? In which case you can just do it the obvious way (though i
guess thats not the question you asked)!
Cheers,
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's
t (example)... i don't know if this is
> possible and how can this be implemented... any help is aprreciated...
Read the documentation of the framework ( if any) you choose to work
with you may find templating system useful.
For standalone app you can look at wxPython, which can communicate to
you
On 5/24/07, ashish <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I want to know weather is there any api available in python for parsing
> xml(XML parser)
Checkout cElementTree .
Cheers,
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the wor
cards = []
for card in file(filename):
cards.append(cards.split()) # i assume that suit and rank is
separated by white space
return cards
or better still
cards = [card.split() for card in file(filename)]
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
27;)
for line in file("myrecords.txt"): # iterate over the records
if line.startswith("//-+"+alnum): # check your condition
# write the matches to a file
outfile.write(line)
outfile.close()
However rather than looping over the file for each alnum you
remove the handler once you are done
applog.removeHandler(hdl)
Cheers,
amit.
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
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 b
lly I was thinking how do I
> access the index inside a for statement? Can you help
Have a look at "enumerate", You can iterate over a list like:
for i,x in enumerate(['a', 'b', 'c']):
print i, x
It prints:
0 a
1 b
2 c
cheers,
amit
Amit Khemka
;Step" defined IN the module "Step"
example 2:
from Step import Step # You directly import the class ( and make the
name visible in your name space)
a = Step("magn")
Also have a look at:
http://effbot.org/zone/import-confusion.htm
http://docs.python.org/ref/import.html
Cheers,
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
--
http://mail.python.org/mailman/listinfo/python-list
On 9/3/07, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Amit Khemka a écrit :
> (snip)
> > The exception is being raised as you are being confused about the
> > names ie: you have a class named "Step" in a module named "Step.py" .
>
>
&g
t is:
>>> l = ['1', '2', '3', '4']
you can do:
>>> print "\t".join(l) # lookup join method in string module,
assuming "\t" as the delimiter
or,
>>> for i in l:
print i, '\t' , # note the
On 9/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On Sep 4, 11:24 am, "Amit Khemka" <[EMAIL PROTECTED]> wrote:
> > On 9/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > > Thanks guys. Changing to how Python does things has a l
This is an example of "generator" functions, to understand what they
are and how they work you can:
1. web-search for "python generators"
2. have a look at "itertools" module, for more generators
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
--
http://mail.python.org/mailman/listinfo/python-list
ow away) f.readline() a single time before
> looping.
> If the lenght of the first line is fixed, you can also use f.seek to start
> reading from the second row.
>
> francesco
Btw, if you are trying to read a csv file and parse it, you can save
some work .. have a look at "c
x27;artica']
To know more about list comprehensions, have a look at:
http://docs.python.org/tut/node7.html#SECTION00714
Methods on strings:
http://docs.python.org/lib/string-methods.html#string-methods
Btw, not all of names in your list are countries !
Cheers,
--
Amit Khemka
website: www.onyomo.com
wap-site: www.owap.in
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 196 matches
Mail list logo