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
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,
--
--
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
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
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
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
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
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
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
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.
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
> 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
> 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
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
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
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
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
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
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
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
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"]
>
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
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
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
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
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
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
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
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
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/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
;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
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
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
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
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
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.
...
>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,
--
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
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
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
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
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.
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.
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
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.
", 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
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,
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,
--
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
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
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'
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
> 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):
>
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:
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
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
wo']['124'] = 4
>
> This gives:
>
> {'two': {'121': 2, '123': 1, '124': 4}, 'one': {'121':
> 2, '123': 1, '124': 4}}
And hence the results !
HTH,
--
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,
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
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
--
---
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
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
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.
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
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
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/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
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
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
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
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
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
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
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
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
vals = []
for val in mydict.values():
try: vals.extend(val)
except: vals.append(val)
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
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
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'
if now(hours) in runat:
> act()
> sleep(60)
> sleep(10)
>
>
> Please enlighten me!
>
> Best regards,
> Yves
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.
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
> objects and 1,3,4,2 are their instance ids and they are unique e.g. a.1
> and b.1 cannot exist together. From this list i want to generate
> multiple lists such that each list must have one and only one instance of
> every object.
> Thus, for the above list, my output should be:
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
)
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
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)
?
>
> 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
ectory. Why don't you try that
> way?
> Reading some help gives more details of its use.
>
> F
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's turn
for project engineering. Are they added or fixed in
> the lastest version of BSBXML?
>
>
> Thank you for help.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Amit Khemka -- onyomo.com
Home Page: www.cse.iitd.ernet.in/~csd00377
Endless the world's
.
--
Amit Khemka -- onyomo.com
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
gt;
> --
> Andrew Gwozdziewycz <[EMAIL PROTECTED]>
> http://ihadagreatview.org
> http://plasticandroid.org
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Amit Khemka -- onyomo.com
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
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
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:
>
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
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 PROTECTED]
<[EMAIL PROT
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
cheers,
amit.
t; lot back.
> http://twistedmatrix.com/projects/words/
>
> Good Luck!
> Linsong
>
>
> Amit Khemka wrote:
>
> >Hello,
> >I am trying to write an IM Bot, which automatically replies to a
> >message, in Python.
> >I was wondering If there are python modul
Hello,
I am trying to write an IM Bot, which automatically replies to a
message, in Python.
I was wondering If there are python modules for connecting to Yahoo!,
msn networks ...
ideally I would like to have a multithreaded module.
This is one I found for msn, if anyone has used it please comment,
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:
<[EMAIL PROTECTED]> wrote:
> Amit Khemka wrote:
>
> > Well actually the problem is I have a list of tuples which i cast as
> > string and then put in a html page as the value of a hidden variable.
> > And when i get the string again, i want to cast it back as lis
, 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,
1 - 100 of 101 matches
Mail list logo