Re: List objects are un-hashable

2007-04-27 Thread Ganesan Rajagopal
Andy == Andy [EMAIL PROTECTED] writes: if keyword.iskeyword(tempwords): print tempwords for word in tempwords: if keyword.iskeyword(word): print word Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Feature Request: Explicit variable declarations

2007-04-14 Thread Ganesan Rajagopal
variables only, or also to global variables and object attributes. None of the above links talk about variable declarations but object attributes are considered. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Pexpect: SSH, Command and Password

2007-04-04 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert to binary and convert back to strings

2007-02-21 Thread Ganesan Rajagopal
(base64.encodestring(text)) print base64.decodestring(open('sambleb.conf', 'r').read()) Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert to binary and convert back to strings

2007-02-21 Thread Ganesan Rajagopal
with messing around with some config settings, it's good enough. If the user can figure out that it's base64 encoded and takes pains to decode, modify, encode and save it back, then he's earned the right to mess around ;-). Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python

Re: problems loading modules

2007-02-04 Thread Ganesan Rajagopal
numpy.random module 'numpy.random' from '/usr/lib/python2.4/site-packages/numpy/random/__init__.pyc' === Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: maximum number of threads

2007-01-12 Thread Ganesan Rajagopal
at upper 1GB). 382 * 8 = 3056MB. Basically, you're running out of address space. I don't know if you have any control at python level. In C you can call pthread_attr_setstacksize(). Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmatically finding significant data points

2006-11-14 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: pexpect baudrate and mode settings

2006-09-21 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: mobile phone app

2006-09-08 Thread Ganesan Rajagopal
http://forum.nokia.com/python -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread Ganesan Rajagopal
binary is linking to a shared python library. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple file writing techiques ...

2006-07-19 Thread Ganesan Rajagopal
to worry about scalability when writing out :-). Have you considered the fileinput module? Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes wrapping libpam.so on FreeBSD 6.1 - Python Bus Error

2006-07-13 Thread Ganesan Rajagopal
) Note that pam_conv is a structure. Passing a string 'PAM_PROMPT_ECHO_ON' and not passing a pointer for getting the pam_handle_t are both candidates to cause a crash. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: don't need dictionary's keys - hash table?

2006-07-12 Thread Ganesan Rajagopal
I am a little surprised that hash(hash(s)) == hash(s), is that actually true? hash(42) 42 Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: How to terminate a main script?

2006-07-11 Thread Ganesan Rajagopal
Helmut Jarausch [EMAIL PROTECTED] writes: Using sys.exit(0) produces an error message which looks dangerous to an uninitiated user. What message? Your program should exit silently when you call sys.exit(0). Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python

Re: popen and password entry

2006-06-15 Thread Ganesan Rajagopal
= '/usr/bin/rsync config [EMAIL PROTECTED]:/tmp/.' #cmd = 'ssh [EMAIL PROTECTED]' child = pexpect.spawn(cmd) Add child.logfile = sys.stdout here and check what's going on. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: popen and password entry

2006-06-15 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: popen and password entry

2006-06-15 Thread Ganesan Rajagopal
don't need the second pattern, the first pattern will catch the second case also. You also need to break when i == 2 or i == 3. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: popen and password entry

2006-06-14 Thread Ganesan Rajagopal
sinan nalkaya [EMAIL PROTECTED] writes: i want to use rsync for remote file transfer via popen, but couldnt pass the Password yet. For interactive input try the pexpect module instead of popen (see http://pexpect.sf.net). Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman

Re: Python 411.

2006-06-13 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: memory error with zipfile module

2006-05-19 Thread Ganesan Rajagopal
it all into memory in a single string is not a good idea. The python zipfile module is obviously broken... Indeed. I am surprised that there is no API that returns a file object. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: pysqlite problem

2006-03-01 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: About undisclosed recipient

2006-02-13 Thread Ganesan Rajagopal
Liyana Robert [EMAIL PROTECTED] writes: Pls help me to know About undisclosed recipient. How we can sent mails to other like this. Use Bcc header instead of To or Cc. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: C regex equiv to Python implementation?

2006-01-06 Thread Ganesan Rajagopal
) implementation in the C library. However, it doesn't support many of the extensions that Python regexes support. Try http://www.pcre.org/. There are pre-build binaries for Windows also. Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org

Re: [OT] How can I change Debian's default Python version?

2006-01-04 Thread Ganesan Rajagopal
alternatives: 1. Compile the python packages manually. 2. Debian already has python 2.4. Install python2.4 using synaptic. Also install any required python2.4-* packages. You will need a symlink to make sure you get python2.4 by default. Ganesan Ganesan -- Ganesan Rajagopal (rganesan

Re: Regex anomaly

2006-01-02 Thread Ganesan Rajagopal
-- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex anomaly

2006-01-02 Thread Ganesan Rajagopal
mike klaas [EMAIL PROTECTED] writes: Thanks guys, that is probably the most ridiculous mistake I've made in years g I was taken too :-). This is quite embarassing, considering that I remember reading a big thread in python devel list about this a while back! Ganesan -- Ganesan Rajagopal

Re: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Ganesan Rajagopal
= eval(u'%s' % (unicodeStrFromNetwork,)) Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Ganesan Rajagopal
Fredrik == Fredrik Lundh [EMAIL PROTECTED] writes: Ganesan Rajagopal wrote: unicodeStrFromNetwork = '\u5927' unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) How about unicodeStrNative = eval(u'%s' % (unicodeStrFromNetwork,)) unicodeStrFromNetwork = ' + str(__import__('os

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Ganesan Rajagopal
/j2se/1.4.2/docs/api/java/util/SortedMap.html C++ STL map container is also a Sorted Associative container. See http://www.sgi.com/tech/stl/Map.html Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Ganesan Rajagopal
Alex Martelli [EMAIL PROTECTED] writes: Ordered *by order of key insertion*: Java, PHP Ordered *by other criteria*: LISP, C++ Java supports both ordered by key insertion (LinkedHashMap) as well as ordered by key comparison (TreeMap). Ganesan -- Ganesan Rajagopal (rganesan

Re: Hi, from my login i want to login as a other user ,

2005-11-10 Thread Ganesan Rajagopal
commands as teh new user? In any case, take a look at pexpect (http://pexpect.sourceforge.net) and see if it fits your purpose. Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http

Re: hello, I want to change n bytes of a binary file

2005-11-02 Thread Ganesan Rajagopal
python would soon get a byte array type. For now I find numarray to be very convenient to do stuff like this. import numarray b = (numarray.array(a, type = 'u1') ^ 255).tostring() It's also significantly faster for large byte array sizes. Ganesan -- Ganesan Rajagopal (rganesan at debian.org

Re: Flat file, Python accessible database?

2005-11-02 Thread Ganesan Rajagopal
would personally stick with SQLite. Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: popen4

2005-10-18 Thread Ganesan Rajagopal
billie == billie [EMAIL PROTECTED] writes: Piet van Oostrum wrote: I think you need something like pyexpect for this. PyExpect seems to be no more mantained. Try pexpect instead. http://pexpect.sourceforce.net/ Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D

Re: C#3.0 and lambdas

2005-09-23 Thread Ganesan Rajagopal
. Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: C#3.0 and lambdas

2005-09-23 Thread Ganesan Rajagopal
-- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: pexpect question....

2005-07-02 Thread Ganesan Rajagopal
effectively want to detach from it. How about just calling close(), i.e. without wait=1? No need to spawn a new thread. Ganesan -- Ganesan Rajagopal (rganesan at debian.org) | GPG Key: 1024D/5D8C12EA Web: http://employees.org/~rganesan| http://rganesan.blogspot.com -- http

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-02 Thread Ganesan Rajagopal
I am stuck on level 3. I've tried every re that I can think of. Some body give me a clue. Ganesan -- Ganesan Rajagopal -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Challenge ahead [NEW] for riddle lovers

2005-05-02 Thread Ganesan Rajagopal
darren == darren kirby [EMAIL PROTECTED] writes: quoth the Ganesan Rajagopal: I am stuck on level 3. I've tried every re that I can think of. Some body give me a clue. Ganesan -- Ganesan Rajagopal t = /text of page source.../ re.findall('[a-z][A-Z]{3}[a-z]{1}[A-Z]{3}[a-z]', t) You