text stringlengths 200 200k | source stringclasses 2
values |
|---|---|
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do I convert local time to UTC in Python?
## Question
How do I convert a datetime string in local time to a string in UTC time?
I'm sure I've done this before, but can't find it and SO will hopefully help me (and others) do that in future.
Clarification: For example, if I have 2008-09-17 14:02:00 in my local ... | stackoverflow-qa |
# How do you design data models for Bigtable/Datastore (GAE)?
## Question
Since the Google App Engine Datastore is based on Bigtable and we know that's not a relational database, how do you design a database schema/*data model* for applications that use this type of database system?
## Answer
Designing a bigtable sch... | stackoverflow-qa |
# How do you design data models for Bigtable/Datastore (GAE)?
## Question
Since the Google App Engine Datastore is based on Bigtable and we know that's not a relational database, how do you design a database schema/*data model* for applications that use this type of database system?
## Answer
You can use www.web2py.c... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Split a string by spaces -- preserving quoted substrings -- in Python
## Question
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are go... | stackoverflow-qa |
# Btrieve without Pervasive?
## Question
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
## Answer
As far as I know that is not possible. It is not an open source database, so writing drivers for it is really hard.
Tags: c#, pyth... | stackoverflow-qa |
# Btrieve without Pervasive?
## Question
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
## Answer
If you download one of the trial versions, you can get/install the odbc client and connect that way.
In our version of pervasive (... | stackoverflow-qa |
# PubSub lib for c#
## Question
Is there a c# library which provides similar functionality to the Python PubSub library? I think it's kind of an Observer Pattern which allows me to subscribe for messages of a given topic instead of using events.
## Answer
These may be a bit heavy for you depending on your needs but:
... | stackoverflow-qa |
# PubSub lib for c#
## Question
Is there a c# library which provides similar functionality to the Python PubSub library? I think it's kind of an Observer Pattern which allows me to subscribe for messages of a given topic instead of using events.
## Answer
Note, if you have events for message notification, there are m... | stackoverflow-qa |
# Asychronous Programming in Python Twisted
## Question
I'm having trouble developing a reverse proxy in Twisted. It works, but it seems overly complex and convoluted. So much of it feels like voodoo...
Are there any simple, solid examples of asynchronous program structure on the web or in books? A sort of best pract... | stackoverflow-qa |
# How to skip sys.exitfunc when unhandled exceptions occur
## Question
As you can see, even after the program should have died it speaks from the grave. Is there a way to "deregister" the exitfunction in case of exceptions?
import atexit
def helloworld():
print("Hello World!")
atexit.register(helloworld)
raise... | stackoverflow-qa |
# PythonWin's python interactive shell calling constructors twice?
## Question
While answering http://stackoverflow.com/questions/68645/python-static-variable#81002
I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?
PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (... | stackoverflow-qa |
# PythonWin's python interactive shell calling constructors twice?
## Question
While answering http://stackoverflow.com/questions/68645/python-static-variable#81002
I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?
PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (... | stackoverflow-qa |
# PythonWin's python interactive shell calling constructors twice?
## Question
While answering http://stackoverflow.com/questions/68645/python-static-variable#81002
I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?
PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# Upload files in Google App Engine
## Question
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through db.TextProperty and db.BlobProperty.
I'll be glad anyone ca... | stackoverflow-qa |
# PyQt and PyCairo
## Question
I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?
## Answer
Qt's own OpenGL based surfaces (using QPainter) are known to be... | stackoverflow-qa |
# Python + DNS : Cannot get RRSIG records: No Answer
## Question
I get DNS records from a Python program, using DNS
Python
I can get various DNSSEC-related records:
>>> import dns.resolver
>>> myresolver = dns.resolver.Resolver()
>>> myresolver.use_edns(1, 0, 1400)
>>> print myresolver.query('sources.org', 'DNSKEY')... | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
Byteflow is a blog engine, written on Python, using Django
Tags: python, django | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
James Bennett has an interesting take on this question:
âwhere can I find a good Django-powered blogging applicationâ is probably at the top of the frequently-asked questions lis... | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
EDIT: Original link went dead so here's an updated link with extracts of the list sorted with the most recently updated source at the top.
Eleven Django blog engines you should know
by... | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
Django's powerful admin interface and easy ORM makes it a 30 minute job to build a blog that propably fits your needs; Why look for a 3rd party product when you can make it yourself very... | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
Nathan Borror has a great package of 'basic apps' that has a blog. These are well written, well documented apps that you should try out, get ideas from, etc.
http://code.google.com/p/dj... | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
The book Practical Django Projects provides a tutorial on how to create a Django blogging app.
Tags: python, django | stackoverflow-qa |
# Is there any list of blog engines, written in Django?
## Question
Is there any list of blog engines, written in Django?
## Answer
You should check django-blogango. http://agiliq.com/blog is run using this blogging engine.
https://github.com/agiliq/django-blogango
Tags: python, django | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
import os.path
if os.path.isfile(filename):
Tags: python, file, filesystems | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
import os
os.path.exists(filename)
Tags: python, file, filesystems | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You have the os.path.exists function:
import os.path
os.path.exists(file_path)
This returns True for both files and directories but you can additionally use os.path.isfi... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You can also use os.path.isfile
Return True if path is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same pat... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Additionally, os.access():
if os.access("myfile", os.R_OK):
with open("myfile") as fp:
return fp.read()
Being R_OK, W_OK, and X_OK the flags to test for perm... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Unlike isfile(), exists() will yield True for directories.
So depending on if you want only plain files or also directories, you'll use isfile() or exists(). Here is a simp... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Prefer the try statement. It's considered better style and avoids race conditions.
Don't take my word for it. There's plenty of support for this theory. Here's a couple:
... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Just to add to the confusion, it seems that the try: open() approach suggested above doesn't work in Python, as file access isn't exclusive, not even when writing to files,... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You could try this: (safer)
try:
# http://effbot.org/zone/python-with-statement.htm
# with is more safe to open file
with open('whatever.txt') as fh:
... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
import os
path = /path/to/dir
root,dirs,files = os.walk(path).next()
if myfile in files:
print "yes it exists"
This is helpful when checking for several files. Or you... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Use os.path.isfile() with os.access():
import os
import os.path
PATH='./file.txt'
if os.path.isfile(PATH) and os.access(PATH, os.R_OK):
print "File exists and is rea... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You should definitely use this one.
from os.path import exists
if exists("file") == True:
print "File exists."
elif exists("file") == False:
print "File doesn't e... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
This is the simplest way to check if a file exists. Just because the file existed when you checked doesn't guarantee that it will be there when you need to open it.
import... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
It doesn't seem like there's a meaningful functional difference between try/except and isfile(), so you should use which one makes sense.
If you want to read a file, if it... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
If you want to do what in bash would be
if [ -e '$FILE' ]; then
prog '$FILE'
fi
which I sometimes do when using Python to do more complicated manipulation of a list ... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Python 3.4 has an object-oriented path module: pathlib. Using this new module, you can check whether a file exists like this:
import pathlib
p = pathlib.Path('path/to/fil... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You can write Brian's suggestion without the try:.
from contextlib import suppress
with suppress(IOError), open('filename'):
process()
supress is part of Python 3.... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You can use following open method to check if file exists + readable
open(inputFile, 'r')
Tags: python, file, filesystems | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
If the file is for opening you could use one of the following techniques:
>>> with open('somefile', 'xt') as f: #Using the x-flag, Python3.3 and above
... f.write('Hel... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
To check if a file exists,
from sys import argv
from os.path import exists
script, filename = argv
target = open(filename)
print "file exists: %r" % exists(filename)
Ta... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You can use the "OS" library of python.
>>> import os
>>> os.path.exists("C:\\Users\\####\\Desktop\\test.txt")
True
>>> os.path.exists("C:\\Users\\####\\Desktop\\test.tx"... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Although I always recommend using try and except statements, here's a few possibilities for you (My personal favourite is using os.access:
Try opening the file:
Opening ... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
if os.path.isfile(path_to_file):
try:
open(path_to_file)
pass
except IOError as e:
print "Unable to open file"
Raising exceptions ... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
import os
#Your path here e.g. "C:\Program Files\text.txt"
if os.path.exists("C:\..."):
print "File found!"
else:
print "File not found!"
Importing os makes it... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
import os.path
def isReadableFile(file_path, file_name):
full_path = file_path + "/" + file_name
try:
if not os.path.exists(file_path):
print "... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
How do I check whether a file exists, using Python, without using a try statement?
Recommendations:
suppress
Python 3.4 gives us the suppress context manager (previousl... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Here's a 1 line Python command for the Linux command line environment. I find this VERY HANDY since I'm not such a hot Bash guy.
python -c "import os.path; print os.path.i... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
In Python 3.4 the language provides a new module to manage files:
import pathlib
path = pathlib.Path('path/to/file')
if path.is_file(): # if you want to check a directory:... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Demo:
try:
with open('my_settings.dat') as fp:
pass
except IOError as e:
print "Unable to open file" #Does not exist OR no read permissions
Handling mis... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
In 2016 the best way is still using os.path.isfile
>>> os.path.isfile('/path/to/some/file.txt')
Or in python3 you can use pathlib
import pathlib
path = pathlib.Path('/p... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
import os
iffile = os.system('ls filename') ##### returns 0 if success
if iffile == 0:
print 'file exists'
else:
print 'file does not exist'
Tags: python, file,... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
I'm the author of a package that's been around for about 10 years, and it has a function that addresses this question directly. Basically, if you are on a non-windows syst... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
You can use os.listdir to check if a file is in a certain directory.
import os
if 'file.ext' in os.listdir('dirpath'):
#code
Tags: python, file, filesystems | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Adding one more slight variation which isn't exactly reflected in the other answers.
This will handle the case of the file_path being None or empty string.
def file_exi... | stackoverflow-qa |
# How do I check whether a file exists using Python?
## Question
How do I check whether a file exists, without using the try statement?
## Answer
Testing for files and folders with os.path.isfile(), os.path.isdir() and os.path.exists()
Assuming that the "path" is a valid path, this table shows what is returned by ea... | stackoverflow-qa |
# How to programmatically enable/disable network interfaces? (Windows XP)
## Question
I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Th... | stackoverflow-qa |
# How to programmatically enable/disable network interfaces? (Windows XP)
## Question
I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Th... | stackoverflow-qa |
# How to programmatically enable/disable network interfaces? (Windows XP)
## Question
I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Th... | stackoverflow-qa |
# How to programmatically enable/disable network interfaces? (Windows XP)
## Question
I need to enable/disable completely network interfaces from a script in Windows XP. I'm looking for a python solution, but any general way (eg WMI, some command-line à la netsh, some windows call) is welcome and will be adjusted. Th... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Why isn't the 'len' function inherited by dictionaries and lists in Python
## Question
example:
a_list = [1, 2, 3]
a_list.len() # doesn't work
len(a_list) # works
Python being (very) object oriented, I don't understand why the 'len' function isn't inherited by the object.
Plus I keep trying the wrong solution si... | stackoverflow-qa |
# Running multiple sites from a single Python web framework
## Question
What are come good (or at least clever) ways of running multiple sites from a single, common Python web framework (ie: Pylons, TurboGears, etc)? I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specif... | stackoverflow-qa |
# Running multiple sites from a single Python web framework
## Question
What are come good (or at least clever) ways of running multiple sites from a single, common Python web framework (ie: Pylons, TurboGears, etc)? I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specif... | stackoverflow-qa |
# Running multiple sites from a single Python web framework
## Question
What are come good (or at least clever) ways of running multiple sites from a single, common Python web framework (ie: Pylons, TurboGears, etc)? I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specif... | stackoverflow-qa |
# Running multiple sites from a single Python web framework
## Question
What are come good (or at least clever) ways of running multiple sites from a single, common Python web framework (ie: Pylons, TurboGears, etc)? I know you can do redirection based on the domain or path to rewrite the URI to point at a site-specif... | stackoverflow-qa |
# Python - time.clock() vs. time.time() - accuracy?
## Question
Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?
for example:
start = time.clock()
... do something
elapsed = (time.clock() - start)
vs.
start = time.time()
... do something
elapsed = (time.t... | stackoverflow-qa |
# Python - time.clock() vs. time.time() - accuracy?
## Question
Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?
for example:
start = time.clock()
... do something
elapsed = (time.clock() - start)
vs.
start = time.time()
... do something
elapsed = (time.t... | stackoverflow-qa |
# Python - time.clock() vs. time.time() - accuracy?
## Question
Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?
for example:
start = time.clock()
... do something
elapsed = (time.clock() - start)
vs.
start = time.time()
... do something
elapsed = (time.t... | stackoverflow-qa |
# Python - time.clock() vs. time.time() - accuracy?
## Question
Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?
for example:
start = time.clock()
... do something
elapsed = (time.clock() - start)
vs.
start = time.time()
... do something
elapsed = (time.t... | stackoverflow-qa |
# Python - time.clock() vs. time.time() - accuracy?
## Question
Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?
for example:
start = time.clock()
... do something
elapsed = (time.clock() - start)
vs.
start = time.time()
... do something
elapsed = (time.t... | stackoverflow-qa |
# Python - time.clock() vs. time.time() - accuracy?
## Question
Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy?
for example:
start = time.clock()
... do something
elapsed = (time.clock() - start)
vs.
start = time.time()
... do something
elapsed = (time.t... | stackoverflow-qa |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.