Re: [Tutor] Suggestions for output on multiple platforms

2010-06-29 Thread Kushal Kumaran
On Tue, Jun 29, 2010 at 5:56 PM, Thomas C. Hicks wrote: > I am a beginner at all this and never expected to reach a point where > people other than myself may have to have access to the output of one > of my programs.  My problem is this - I have written a program that > uses xlrd to read a series

Re: [Tutor] Giving a name to a function and calling it, rather than calling the function directly

2010-09-04 Thread Kushal Kumaran
- Original message - > On 9/4/10, lists wrote: > > Hi folks, > > > > I'm new to Python, I'm working my way through some intro books, and I > > have a question that I wonder if someone could help me with please? > > > > This is my attempt at solving an exercise where the program is > > su

Re: [Tutor] Creating one file out of all the files in a directory

2010-11-11 Thread Kushal Kumaran
- Original message - > Hi, > > I'm trying to create a script to do the following. I have a directory > containing hundreds of text files. I need to create a single file with > the contents of all the files in the directory. Within that file, > though, I need to create marks that indicate

Re: [Tutor] Need some help on output

2011-03-03 Thread Kushal Kumaran
On Fri, Mar 4, 2011 at 6:48 AM, Becky Mcquilling wrote: > I am creating a dictionary by parsing a text file. > > The code is below: > backup_servers = {} > fo = open('c:/test/backup_shares.txt') > for line in fo: >   backup_server = line.split(',') >   backup_servers[backup_server[0]]=backup_serve

Re: [Tutor] help with re module and parsing data

2011-03-07 Thread Kushal Kumaran
On Mon, Mar 7, 2011 at 1:24 PM, vineeth wrote: > Hello all I am doing some analysis on my trace file. I am finding the lines > Recvd-Content and Published-Content. I am able to find those lines but the > re module as predicted just gives the word that is being searched. But I > require the entire

Re: [Tutor] (no subject)

2011-03-30 Thread Kushal Kumaran
2011/3/30 "Andrés Chandía" : > > > I'm new to this list, so hello everybody!. > Hello Andrés > The stuff: > > I'm working with > regexps and this is my line: > > contents = re.sub("l<\/u>", > "le" ,contents) > > in perl there is a way to reference previous registers, > i.e. > > $text =~ s/(l|L|n|

Re: [Tutor] ValueError

2011-05-03 Thread Kushal Kumaran
On Tue, May 3, 2011 at 5:31 PM, Peter Otten <__pete...@web.de> wrote: > > > Also you should make the try...except as narrow as possible > > try: >    centimeters = float(centimeters) > except ValueError as e: >    print e > > is likely to catch the float conversion while with many statements in th

Re: [Tutor] ValueError

2011-05-07 Thread Kushal Kumaran
On Wed, May 4, 2011 at 3:13 PM, Peter Otten <__pete...@web.de> wrote: > Kushal Kumaran wrote: > >> On Tue, May 3, 2011 at 5:31 PM, Peter Otten <__pete...@web.de> wrote: >>> >>> >>> Also you should make the try...except as narrow as possib

Re: [Tutor] Using os.path.walk

2011-06-22 Thread Kushal Kumaran
On Thu, Jun 23, 2011 at 9:02 AM, Becky Mcquilling wrote: > I have a bunch of files I need to remove in dirs and subdirs when they are > older than 7 days. > I was looking at os.path.walk, to recurse the directories, but I'm having > some difficulties with getting it to return the directory names o

Re: [Tutor] what is 'doubleword alignment'?

2011-07-17 Thread Kushal Kumaran
On Sun, Jul 17, 2011 at 9:15 PM, Walter Prins wrote: > > > On 17 July 2011 15:26, Lisi wrote: >> >> Sorry to be slow.  Blame virtually no sleep last night ;-(  But even were >> the >> power of two bit correct (and I see subsequently that it is not), how is >> 18 a >> power of two? >> > > The 18 b

Re: [Tutor] Reg Ex Parentheses

2012-01-18 Thread Kushal Kumaran
On Wed, Jan 18, 2012 at 9:53 AM, Chris Kavanagh wrote: > Hey guys, girls, hope everyone is doing well. > > Here's my question, when using Regular Expressions, the docs say when using > parenthesis, it "captures" the data. This has got me confused (doesn't take > much), can someone explain this to

Re: [Tutor] (no subject)

2012-03-27 Thread Kushal Kumaran
On Tue, Mar 27, 2012 at 6:38 AM, thao nguyen wrote: > Dear Support Team, > > I have built a function (enclosed here) to merge many files (in this example > is 2 files: "a1.txt" and "a2.txt") lines by lines. The output file is called > "final_file". However, i could not have it run successfully. >

Re: [Tutor] VirutalEnv not working on Ubuntu server 9.10

2012-05-03 Thread Kushal Kumaran
On Sun, Apr 29, 2012 at 7:34 PM, Marco Mistroni wrote: > HI all >  i have a VPS which is running Ubuntu server 9.10 > > i have downloaded virtualenv 1.4.2 and installed it in a tmp directory > > i have created a environment for using googlemaps.. > > i am able to download googlemaps package,  but

Re: [Tutor] IPcount = 0 when used with subprocess.call (use something to convert to integer?)

2012-05-07 Thread Kushal Kumaran
On Tue, May 8, 2012 at 8:39 AM, Rogelio wrote: > I am wrapping a Python wrapper script to "wc -l" (count lines) of a > list of IP addresses > > *** > > import subprocess > IPcount = subprocess.call(['wc -l file.txt | awk \'{print $1}\''], shell=True) > print

Re: [Tutor] How can I overwrite the previous version on linux ?

2012-12-19 Thread Kushal Kumaran
Dae James writes: > My linux distribution is CentOs 6.3. And python attached to the OS is 2.6. > How can I overwrite the previous version with python 2.7 ? Or how can I > uninstall the previous version? > This is not recommended. The python version supplied with your OS might be used by a num

Re: [Tutor] Set Reply-To field to Tutor@python.org

2013-01-29 Thread Kushal Kumaran
Oscar Benjamin writes: > I have both sent and received messages on this list that went off-list > by mistake. It's an easy mistake to make that you use reply instead of > reply-all and then the message goes just to one person instead of the > whole list. > > This problem is not unique to the pyth

Re: [Tutor] os.system() with imbeded quotes

2013-04-04 Thread Kushal Kumaran
cevyn e writes: > I get the example os.system('ls -al') no problem. > > i'm trying to create a variable with my command built but needs to include > quotes. > Portion of code is as follows: > someip = '192.168.01.01' > > var1 = 'lynx -dump http://' + someip + > '/cgi-bin/.log&.submit=+++G

Re: [Tutor] Socket Programming

2013-04-08 Thread Kushal Kumaran
Mousumi Basu writes: > I want to perform binding between two computers having ip addresses > 172.18.2.11 and 172.18.2.95.So i wrote the following code(on the computer > having IP address 172.18.2.95):- > > > import socket > import sys > s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) > try: >

Re: [Tutor] sqlite3 import problem

2014-01-02 Thread Kushal Kumaran
Matthew Ngaha writes: > im having problems importing sqlite3 on ubuntu python3. > > File "/usr/local/lib/python3.3/sqlite3/__init__.py", line 23, in > from sqlite3.dbapi2 import * > File "/usr/local/lib/python3.3/sqlite3/dbapi2.py", line 26, in > from _sqlite3 import * > ImportError

Re: [Tutor] ssh socks proxy

2012-05-16 Thread kushal . kumaran+python
Adam Gold wrote: >I'm trying to write a 'simple' script that will set up a socks proxy >over ssh and maintain the connection until manually terminated. It's >not possible to use key-based authentication so a password will need to >be supplied. Also, note, the user is presented with a list of s

Re: [Tutor] ssh socks proxy

2012-05-16 Thread kushal . kumaran+python
kushal.kumaran+pyt...@gmail.com wrote: >Adam Gold wrote: > >>I'm trying to write a 'simple' script that will set up a socks proxy >>over ssh and maintain the connection until manually terminated. It's >>not possible to use key-based authentication so a password will need >to >>be supplied. Als