import datetime
start = datetime.datetime(2009, 1, 31)
end = datetime.datetime(2009, 2, 1)
print end-start
>>1 day, 0:00:00//output
How to get the output in minutes
Thanks,
When I start apache I am getting those errors:
[Tue Jun 14 02:28:58 2011] [error] python_init: Python version mismatch, expected '2.6.5', found '2.6.6'.
[Tue Jun 14 02:28:58 2011] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Jun 14 02:28:58 2011] [error] python_init: Python path being used…
With the release of SALT 11gR1, you can now develop Python/Ruby services/applications on Oracle Tuxedo platform. Python functions or Ruby classes can be invoked as Tuxedo services by other Tuxedo services or clients and, in addition, Python/Ruby applications can invoke existing Tuxedo services. SALT 11gR1…
Hi i am trying to fix this for a long time but without success. When i open my zsh terminal i get this error: (terminal is working but error appear)
Welcome to the world of tomorrow!
virtualenvwrapper_run_hook:12: permission denied:
virtualenvwrapper.sh: There was a problem running the initialization…
I receive following Traceback:
Traceback (most recent call last):
File "tkinter_basic_frame.py", line 4, in <module>
from Tkinter import Tk, Frame, BOTH
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in
raise ImportError, str(msg) + ', please install the python-tk package'…
I've recently purchased a new hard drive and installed a clean copy of OS X Mavericks. I installed python using homebrew and i need to create a python virtual environment. But when ever i try to run any command using pip, I get this error. I haven't been able to find a solution online for this…
Hello, everyone
I am using a piece of self-modifying code for a college project.
Here it is:
import datetime
import inspect
import re
import sys
def main():
# print the time it is last run
lastrun = 'Mon Jun 8 16:31:27 2009'
print "This program was last run at ",
print…
I changed to zsh from the default (by changing the "Shells open with" preference in Terminal to "command (complete path)" set to /bin/zsh
While most things seem to work, I tried to see the man page for a command and got a "permission denied" message. When I tried sudo, I got "man: command…
I am amazed by python on how tidy the code is, so i decided to learn it, and 2 days pass and I am completely in love withpython, but I just code it for hobby thing like chatting robot, uploading to file hosting scripts, etc that small tools for my own daily internet life, and not much for…
I have many times seen various benchmarks that show how a bunch of languages perform on a given task.
Always these benchmarks reveal that Python is slower then Java and faster than PHP. And I wonder why is that the case.
Java, Python, and PHP run inside a virtual machine
All three…
Erlang and Ruby both come with functions for flattening arrays. It seems like such a simple and useful tool to add to a language. One could do this:
>>> mess = [[1, [2]], 3, [[[4, 5]], 6]]
>>> mess.flatten()
[1, 2, 3, 4, 5, 6]
Or even:
>>> import…
I am running Cygwin Python version 2.5.2.
I have a three-line source file, called import.py:
#!/usr/bin/python
import xml.etree.ElementTree as ET
print "Success!"
When I execute "python import.py", it works:
C:\Temp>python import.py
Success!
When I run the python…
I tried to install python wrappers for OpenKinect on Ubuntu 12.04, but I can't due this error:
$ sudo apt-get install python2.7-dev
python2.7-dev : Depends: libexpat1-dev but it is not going to be installed
Depends: libssl-dev but it is not going to be…
I have python 2.7 installed
[user@localhost google_appengine]$ pythonPython 2.7 (r27:82500, Sep 16 2010, 18:03:06)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
I want to use the…
I have a CentOS server (rel6) that had python installed (2.6), but I needed a few features in 3.3+. I installed 3.3 into a seperate folder and made a symbolic link to execute it:
I installed setup tools:
yum install python-setuptools
I installed a needed…
I'm looking to get into application development, such as Facebook or Android apps and games. I am doing this for fun and to learn. Once my skills are to par I would like to have some side income from the apps, but I'm not banking on living off that (just so…
In a project I work on we use a Python C module compiled from Fortran with f2py. I've had no issues building it on Windows 7 32bit (using mingw32) and on the servers it's built on 32bit Linux.
But I've recently installed Ubuntu 10.04 LTS 64bit on my laptop…
Over on SO I came across a question regarding which platform, Java or Python is best for developing on Google AppEngine. Many people were boasting of the increased productivity gained from using Python over Java. One thing I would say about the Python vs…
Over on SO I came across a question regarding which platform, Java or Python is best for developing on Google AppEngine. Many people were boasting of the increased productivity gained from using Python over Java. One thing I would say about the Python vs…
I am experiencing an annoying problem with sshuttle running it on 10.7.3, MBA with the latest firmware update -- after I stop it (ctrl+c twice), or loose connection, or close the lid, I cannot restore it until I restart the system. The restarting takes…
Hi, i'm looking for a way to ship the python interpreter with my application (also written in python), so that it doesn't need to have python installed on the machine.
I searched google and found a bunch of results about how to embed the python…
Hello, I followed the "official" tutorial and others but still don't manage to expose this pure virtual method (getPeptide) :
ms_mascotresults.hpp
class ms_mascotresults {
public:
ms_mascotresults(ms_mascotresfile …
I'm very new to python, as i'm embedding it (in form of a static lib) in an ios project. It's not possible for me to dynamically load python modules, so i would like to compile my modules along withpython.
For modules shipped with…
Hi all
I have decided to take the time out after work to learn Python. Python appeals to me because at work (Web and eLearning Company), I have to follow out very repetitive tasks like delete all these tags, rename all these tasks…
Please advise me good wrapper/library for python. I need to implement simple scripting in c++ app; Under "good" I mean pretty understandable, well documented, no memory leaking, fast. For creating base interface of GameObject on…