FAQ Database Discussion Community


Display given datetime in reverse order in python

python,datetime,python-2.4
I have a date timestamp like "2013-12-20 23:40:33". Now, my requirement is to re-format this date in reverse order like : <seconds><minutes><hr><day><month><year> in python. Please suggest...

Unpickling a python 2 object with python 3

python,python-3.x,pickle,python-2.4,2to3
I'm wondering if there is a way to load an object that was pickled in Python 2.4, with Python 3.4. I've been running 2to3 on a large amount of company legacy code to get it up to date. Having done this, when running the file I get the following error:...

Python/regex: Elegant way to check if a string contains ONLY numbers and periods

regex,python-2.4
For example, '5243412..32.432242' would yield true, while '2132100345abcdefgh--#$#' would be false. Thanks in advance!...

Calling python 2.7 opens python 2.4 [closed]

python,linux,python-2.7,python-2.4
I'm a bit of a Linux newbie, and I ssh into a remote Linux server where I have no root access. The system has Python 2.4.3 available and I have Python 2.7.9 installed locally in ~/usr/bin. I tried unsuccessfully to setup a virtual environment using this python script. After I...

How to check if a file is checked out (Clearcase / Python)

python,clearcase,python-2.4
I guess the title sufficiently sums up my question. I have working code to automatically check out a file: p = Popen(['cleartool', 'co', pathname], stdin = PIPE) p.communicate('comment for checkout') I'm wondering how to check if the file is already checked out before executing this. Thanks in advance everyone!...

Python 2.4 subproces.CalledProcessError substitute

python,python-2.4,python-2.3
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) except subprocess.CalledProcessError: continue The above snipet works, but if the host executes the code on a Python version below 2.5 the code will fail...