Questions tagged [python-2.3]

For issues relating to development in Python, version 2.3

The Python 2.3 release (introduced 2003, final version 2005) introduced several changes and speed improvements over version 2.2.

Use this tag if your question is specifically about . If your question applies to Python in general, use the tag . If your question applies to Python 2.x but not to Python 3, use the tag . If you aren't sure, tag your question and mention which version you're using in the body of your question.

29 questions
7
votes
4 answers

Sort a list of strings by last N characters in Python 2.3

In newer Python, I am able to use the sorted function and easily sort out a list of strings according to their last few chars as such: lots_list = ['anything'] print sorted(lots_list, key=returnlastchar) def returnlastchar(s): return…
Poker Prof
  • 169
  • 5
  • 15
3
votes
1 answer

Python 2.4 subproces.CalledProcessError substitute

I'm trying to add a try/except to my subprocess. try: mountCmd = 'mount /dev/%s %s%s' % (splitDevice, homeDir, splitDevice) dev = '/dev/%s' % splitDevice subprocess.check_call(mountCmd, shell=True) …
Adilicious
  • 1,643
  • 4
  • 18
  • 22
2
votes
2 answers

Python 2.3 multiprocessing

Is there any multiprocessing type module for Python 2.3? I am stuck using 2.3 for the programs I interface with and would like to be able to setup some multiprocessing as the tasks I do only use one CPU and are really inefficient. I would like…
2
votes
4 answers

How to merge only the unique lines from file_a to file_b?

This question has been asked here in one form or another but not quite the thing I'm looking for. So, this is the situation I shall be having: I already have one file, named file_a and I'm creating another file - file_b. file_a is always bigger than…
MacUsers
  • 2,091
  • 3
  • 35
  • 56
2
votes
1 answer

Capture value from shell script and use it in Python without using subprocess

I have a python script which requires a value from a shell script. Following is the shell script (a.sh): #!/bin/bash return_value(){ value=$(///some unix command) echo "$value" } return_value Following is the python script: Import…
user2475677
  • 149
  • 2
  • 5
  • 11
2
votes
1 answer

how to rsh ssh using python 2.3

I would like to write a script that performs the following Linux commands sequence: rsh rr01 ( here the system will ask for password ) ssh rr02 ( here the system will ask for password again) activate my app on some file I was naively (and…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
1
vote
1 answer

How do you get the directory name from the error object on IOError in python 2.3.4?

When trying to open a directory, an exception is thrown: >>> try: ... open( '/' ) ... except IOError, e: ... print e.filename None Is it possible (preferrably in python 2.3.4) for the handler of the exception to get the name of the directory…
William Pursell
  • 204,365
  • 48
  • 270
  • 300
1
vote
2 answers

Python - Accumulated Value of Annual Investment

I have a program (futval.py) that will calculate the value of an investment after 10 years. I want to modify the program so that instead of calculating the value of a one time investment after 10 years, it will calculate the value of an annual…
1
vote
0 answers

numpy for python 2.3

I am trying to install numpy for version 2.3 as I require the oldnumeric package for an old data reduction program. I tried pip and easy_install, but can't find how to install both for python 2.3 . Any suggestions?
jorgehumberto
  • 1,047
  • 5
  • 15
  • 33
1
vote
1 answer

How can I replace a large portion of a text in a file using Python?

I am required to use Python 2.3, and I have almost no programming experience. I have a large number of files that look exactly like the one below. I want to replace the lines following the "0 2" with other ones which look basically the same but have…
1
vote
1 answer

Easiest way to get pip on python 2.3.4 server

I'm working on a server with python 2.3.4 and cannot upgrade it. I don't have setuptools (and therefore easy_install), which I need to install pip. Looking through the easy_install docs it looks like you need 2.3.5 to be able to use easy_install. Is…
JonnyD
  • 487
  • 2
  • 7
  • 19
1
vote
2 answers

get line number which variable is defined in a different file

is it possible for me to get the line number which variable is defined in a different file. for example: file1.py x = 5 mylist = [ 1, 2, 3] file2.py execfile("file1.py") # TODO # get line number of 'x' or 'mylist' I assume each variable is…
idanshmu
  • 5,061
  • 6
  • 46
  • 92
0
votes
5 answers

Python - Number of word occurrences

I'm trying to do a function allowing to find the number of occurences of (whole) word(s) (case insensitive) in a text. Example : >>> text = """Antoine is my name and I like python. Oh ! your name is antoine? And you like Python! Yes is is true, I…
Pierre de LESPINAY
  • 44,700
  • 57
  • 210
  • 307
0
votes
1 answer

Sending mail with SSL with Python 2.3

I'm working with Python 2.3 and I need to send e-mails with SSL. According to the docs, SMTP_SSL was added in Python 2.6. Is there a way to use SSL also in Python 2.3 (maybe with a third-party module)?
Don
  • 16,928
  • 12
  • 63
  • 101
0
votes
1 answer

How to read HTML parameters from CherryPy?

i have an html file,
In mypgm.py i have to process the value entered in the text-box and respond with an…
Vinay C
  • 387
  • 1
  • 7
  • 16
1
2