text stringlengths 200 200k | source stringclasses 2
values |
|---|---|
# Using Python's ftplib to get a directory listing, portably
## Question
You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is:
# File: ftplib-example-1.py
import ftplib
ftp = ftplib.FTP("www.python.org")
ftp.login("anonymous", "ftplib-example-1")
data = []
... | stackoverflow-qa |
# Using Python's ftplib to get a directory listing, portably
## Question
You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is:
# File: ftplib-example-1.py
import ftplib
ftp = ftplib.FTP("www.python.org")
ftp.login("anonymous", "ftplib-example-1")
data = []
... | stackoverflow-qa |
# Using Python's ftplib to get a directory listing, portably
## Question
You can use ftplib for full FTP support in Python. However the preferred way of getting a directory listing is:
# File: ftplib-example-1.py
import ftplib
ftp = ftplib.FTP("www.python.org")
ftp.login("anonymous", "ftplib-example-1")
data = []
... | stackoverflow-qa |
# python.array versus numpy.array
## Question
If you are creating a 1d array in Python is there any benefit to using the NumPy package?
## Answer
It all depends on what you plan to do with the array. If all you're doing is creating arrays of simple data types and doing I/O, the array module will do just fine.
If, on... | stackoverflow-qa |
# How do I overlap widgets with the Tkinter pack geometry manager?
## Question
I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background.
Is it possible to have two states for the pack manager: one for one set of widgets and another for anothe... | stackoverflow-qa |
# How do I overlap widgets with the Tkinter pack geometry manager?
## Question
I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background.
Is it possible to have two states for the pack manager: one for one set of widgets and another for anothe... | stackoverflow-qa |
# How do I overlap widgets with the Tkinter pack geometry manager?
## Question
I want to put a Canvas with an image in my window, and then I want to pack widgets on top of it, so the Canvas acts as a background.
Is it possible to have two states for the pack manager: one for one set of widgets and another for anothe... | stackoverflow-qa |
# Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?
## Question
I'm specifically looking for one that lets me display a map of US states with each one as it's own "object" in the sense that I can control the color, on click, and on mouseover of each one individually. G... | stackoverflow-qa |
# Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?
## Question
I'm specifically looking for one that lets me display a map of US states with each one as it's own "object" in the sense that I can control the color, on click, and on mouseover of each one individually. G... | stackoverflow-qa |
# Does anyone know of a widget for a desktop toolkit(GTK, Qt, WX) for displaying a map of US states?
## Question
I'm specifically looking for one that lets me display a map of US states with each one as it's own "object" in the sense that I can control the color, on click, and on mouseover of each one individually. G... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# List all words in a dictionary that start with <user input>
## Question
How would a go about making a program where the user enters a string, and the program generates a list of words beginning with that string?
Ex:
User: "abd"
Program:abdicate, abdomen, abduct...
Thanks!
Edit: I'm using python, but I assume t... | stackoverflow-qa |
# How do I use genshi.builder to programmatically build an HTML document?
## Question
I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, what ... | stackoverflow-qa |
# How do I use genshi.builder to programmatically build an HTML document?
## Question
I recently discovered the genshi.builder module. It reminds me of Divmod Nevow's Stan module. How would one use genshi.builder.tag to build an HTML document with a particular doctype? Or is this even a good thing to do? If not, what ... | stackoverflow-qa |
# py2exe - generate single executable file
## Question
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does som... | stackoverflow-qa |
# py2exe - generate single executable file
## Question
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does som... | stackoverflow-qa |
# py2exe - generate single executable file
## Question
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does som... | stackoverflow-qa |
# py2exe - generate single executable file
## Question
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does som... | stackoverflow-qa |
# py2exe - generate single executable file
## Question
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does som... | stackoverflow-qa |
# py2exe - generate single executable file
## Question
I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your setup.py file, and what command line options you used?
Basically I'm thinking of it giving me a single executable file that does som... | stackoverflow-qa |
# How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie?
## Question
(ClientCookie is a module for (automatic) cookie-handling: http://wwwsearch.sourceforge.net/ClientCookie)
# I encode the data I'll be sending:
data = urllib.urlencode({'username': 'mandark', 'password':... | stackoverflow-qa |
# How would one log into a phpBB3 forum through a Python script using urllib, urllib2 and ClientCookie?
## Question
(ClientCookie is a module for (automatic) cookie-handling: http://wwwsearch.sourceforge.net/ClientCookie)
# I encode the data I'll be sending:
data = urllib.urlencode({'username': 'mandark', 'password':... | stackoverflow-qa |
# Python - When to use file vs open
## Question
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
## Answer
You should always use open().
As the documentation states:
When opening a file, it's preferable
to use open() instead of invoking this
constructor d... | stackoverflow-qa |
# Python - When to use file vs open
## Question
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
## Answer
Functionally, the two are the same; open will call file anyway, so currently the difference is a matter of style. The Python docs recommend using open.
... | stackoverflow-qa |
# Python - When to use file vs open
## Question
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
## Answer
Two reasons: The python philosophy of "There ought to be one way to do it" and file is going away.
file is the actual type (using e.g. file('myfile.txt') is... | stackoverflow-qa |
# Python - When to use file vs open
## Question
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
## Answer
Only ever use open() for opening files. file() is actually being removed in 3.0, and it's deprecated at the moment. They've had a sort of strange relationshi... | stackoverflow-qa |
# Python - When to use file vs open
## Question
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
## Answer
According to Mr Van Rossum, although open() is currently an alias for file() you should use open() because this might change in the future.
Tags: python, fi... | stackoverflow-qa |
# Python - When to use file vs open
## Question
What's the difference between file and open in Python? When should I use which one? (Say I'm in 2.5)
## Answer
file() is a type, like an int or a list. open() is a function for opening files, and will return a file object.
This is an example of when you should use op... | stackoverflow-qa |
# Writing to the windows logs in Python
## Question
Is it possible to write to the windows logs in python?
## Answer
Yes, just use Windows Python Extension, as stated here.
import win32evtlogutil
win32evtlogutil.ReportEvent(ApplicationName, EventID, EventCategory,
EventType, Inserts, Data, SID)
Tags: pyth... | stackoverflow-qa |
# What are the Python equivalents of the sighold and sigrelse functions found in C?
## Question
It appears the Python signal module doesn't have anything similar to the sighold and sigrelse functions found in C, using signal.h. Are there Python equivalents of any sort?
Many thanks!
## Answer
There is no way to ``blo... | stackoverflow-qa |
# What are the Python equivalents of the sighold and sigrelse functions found in C?
## Question
It appears the Python signal module doesn't have anything similar to the sighold and sigrelse functions found in C, using signal.h. Are there Python equivalents of any sort?
Many thanks!
## Answer
There are no direct bind... | stackoverflow-qa |
# How do I use owfs to read an iButton temperature logger?
## Question
I've installed owfs and am trying to read the data off a iButton temperature logger.
owfs lets me mount the iButton as a fuse filesystem and I can see all the data. I'm having trouble figuring out what is the best way to access the data though. ... | stackoverflow-qa |
# How do I use owfs to read an iButton temperature logger?
## Question
I've installed owfs and am trying to read the data off a iButton temperature logger.
owfs lets me mount the iButton as a fuse filesystem and I can see all the data. I'm having trouble figuring out what is the best way to access the data though. ... | stackoverflow-qa |
# How do I use owfs to read an iButton temperature logger?
## Question
I've installed owfs and am trying to read the data off a iButton temperature logger.
owfs lets me mount the iButton as a fuse filesystem and I can see all the data. I'm having trouble figuring out what is the best way to access the data though. ... | stackoverflow-qa |
# Python-passing variable between classes
## Question
I'm trying to create a character generation wizard for a game. In one class I calculate the attributes of the character. In a different class, I'm displaying to the user which specialties are available based on the attributes of the character. However, I can't reme... | stackoverflow-qa |
# Python-passing variable between classes
## Question
I'm trying to create a character generation wizard for a game. In one class I calculate the attributes of the character. In a different class, I'm displaying to the user which specialties are available based on the attributes of the character. However, I can't reme... | stackoverflow-qa |
# Python-passing variable between classes
## Question
I'm trying to create a character generation wizard for a game. In one class I calculate the attributes of the character. In a different class, I'm displaying to the user which specialties are available based on the attributes of the character. However, I can't reme... | stackoverflow-qa |
# Python-passing variable between classes
## Question
I'm trying to create a character generation wizard for a game. In one class I calculate the attributes of the character. In a different class, I'm displaying to the user which specialties are available based on the attributes of the character. However, I can't reme... | stackoverflow-qa |
# Is there a function in Python to split a string without ignoring the spaces?
## Question
Is there a function in Python to split a string without ignoring the spaces in the resulting list?
E.g:
s="This is the string I want to split".split()
gives me
>>> s
['This', 'is', 'the', 'string', 'I', 'want', 'to', 'spli... | stackoverflow-qa |
# Is there a function in Python to split a string without ignoring the spaces?
## Question
Is there a function in Python to split a string without ignoring the spaces in the resulting list?
E.g:
s="This is the string I want to split".split()
gives me
>>> s
['This', 'is', 'the', 'string', 'I', 'want', 'to', 'spli... | stackoverflow-qa |
# Is there a function in Python to split a string without ignoring the spaces?
## Question
Is there a function in Python to split a string without ignoring the spaces in the resulting list?
E.g:
s="This is the string I want to split".split()
gives me
>>> s
['This', 'is', 'the', 'string', 'I', 'want', 'to', 'spli... | stackoverflow-qa |
# Is there a function in Python to split a string without ignoring the spaces?
## Question
Is there a function in Python to split a string without ignoring the spaces in the resulting list?
E.g:
s="This is the string I want to split".split()
gives me
>>> s
['This', 'is', 'the', 'string', 'I', 'want', 'to', 'spli... | stackoverflow-qa |
# Is there a function in python to split a word into a list?
## Question
Is there a function in python to split a word into a list of single letters? e.g:
s="Word to Split"
to get
wordlist=['W','o','r','d','','t','o' ....]
## Answer
>>> list("Word to Split")
['W', 'o', 'r', 'd', ' ', 't', 'o', ' ', 'S', 'p', 'l',... | stackoverflow-qa |
# Is there a function in python to split a word into a list?
## Question
Is there a function in python to split a word into a list of single letters? e.g:
s="Word to Split"
to get
wordlist=['W','o','r','d','','t','o' ....]
## Answer
The easiest way is probably just to use list(), but there is at least one other o... | stackoverflow-qa |
# Is there a function in python to split a word into a list?
## Question
Is there a function in python to split a word into a list of single letters? e.g:
s="Word to Split"
to get
wordlist=['W','o','r','d','','t','o' ....]
## Answer
The list function will do this
>>> list('foo')
['f', 'o', 'o']
Tags: python, fu... | stackoverflow-qa |
# Is there a function in python to split a word into a list?
## Question
Is there a function in python to split a word into a list of single letters? e.g:
s="Word to Split"
to get
wordlist=['W','o','r','d','','t','o' ....]
## Answer
Abuse of the rules, same result:
(x for x in 'Word to split')
Actually an it... | stackoverflow-qa |
# Deploying Django: How do you do it?
## Question
I have tried following guides like this one but it just didnt work for me.
So my question is this: What is a good guide for deploying Django, and how do you deploy your Django.
I keep hearing that capastrano is pretty nifty to use, but i have no idea as to how to wor... | stackoverflow-qa |
# Deploying Django: How do you do it?
## Question
I have tried following guides like this one but it just didnt work for me.
So my question is this: What is a good guide for deploying Django, and how do you deploy your Django.
I keep hearing that capastrano is pretty nifty to use, but i have no idea as to how to wor... | stackoverflow-qa |
# Deploying Django: How do you do it?
## Question
I have tried following guides like this one but it just didnt work for me.
So my question is this: What is a good guide for deploying Django, and how do you deploy your Django.
I keep hearing that capastrano is pretty nifty to use, but i have no idea as to how to wor... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Class method differences in Python: bound, unbound and static
## Question
What is the difference between the following class methods?
Is it that one is static and the other is not?
class Test(object):
def method_one(self):
print "Called method_one"
def method_two():
print "Called method_two"
a_test =... | stackoverflow-qa |
# Where can a save confirmation page be hooked into the Django admin? (similar to delete confirmation)
## Question
I want to emulate the delete confirmation page behavior before saving
certain models in the admin. In my case if I change one object,
certain others should be deleted as they depend upon the object's n... | stackoverflow-qa |
# Where can a save confirmation page be hooked into the Django admin? (similar to delete confirmation)
## Question
I want to emulate the delete confirmation page behavior before saving
certain models in the admin. In my case if I change one object,
certain others should be deleted as they depend upon the object's n... | stackoverflow-qa |
# What is the fastest way to scale and display an image in Python?
## Question
I am required to display a two dimensional numpy.array of int16 at 20fps or so. Using Matplotlib's imshow chokes on anything above 10fps. There obviously are some issues with scaling and interpolation. I should add that the dimensions of th... | stackoverflow-qa |
# Is a Python dictionary an example of a hash table?
## Question
One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is it?
## Answer
Yes, it is a hash mapping or hash table.... | stackoverflow-qa |
# Is a Python dictionary an example of a hash table?
## Question
One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is it?
## Answer
Yes. Internally it is implemented as op... | stackoverflow-qa |
# Is a Python dictionary an example of a hash table?
## Question
One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is it?
## Answer
If you're interested in the technical de... | stackoverflow-qa |
# Is a Python dictionary an example of a hash table?
## Question
One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is it?
## Answer
To expand upon nosklo's explanation:
a ... | stackoverflow-qa |
# Is a Python dictionary an example of a hash table?
## Question
One of the basic data structures in Python is the dictionary, which allows one to record "keys" for looking up "values" of any type. Is this implemented internally as a hash table? If not, what is it?
## Answer
There must be more to a Python dictionar... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# How can I consume a WSDL (SOAP) web service in Python?
## Question
I want to use a WSDL SOAP based web service in Python. I have looked at the Dive Into Python code but the SOAPpy module does not work under Python 2.5.
I have tried using suds which works partly, but breaks with certain types (suds.TypeNotFound: Typ... | stackoverflow-qa |
# What is the simplest way to offer/consume web services in jython?
## Question
I have an application for Tomcat which needs to offer/consume web services. Since Java web services are a nightmare (xml, code generation, etc.) compared with what is possible in Python, I would like to learn from your experience using jyt... | stackoverflow-qa |
# Which is more pythonic, factory as a function in a module, or as a method on the class it creates?
## Question
I have some Python code that creates a Calendar object based on parsed VEvent objects from and iCalendar file.
The calendar object just has a method that adds events as they get parsed.
Now I want to crea... | stackoverflow-qa |
# Which is more pythonic, factory as a function in a module, or as a method on the class it creates?
## Question
I have some Python code that creates a Calendar object based on parsed VEvent objects from and iCalendar file.
The calendar object just has a method that adds events as they get parsed.
Now I want to crea... | stackoverflow-qa |
# Which is more pythonic, factory as a function in a module, or as a method on the class it creates?
## Question
I have some Python code that creates a Calendar object based on parsed VEvent objects from and iCalendar file.
The calendar object just has a method that adds events as they get parsed.
Now I want to crea... | stackoverflow-qa |
# How do I configure the ip address with CherryPy?
## Question
I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and cherry... | stackoverflow-qa |
# How do I configure the ip address with CherryPy?
## Question
I'm using python and CherryPy to create a simple internal website that about 2 people use. I use the built in webserver with CherryPy.quickstart and never messed with the config files. I recently changed machines so I installed the latest Python and cherry... | stackoverflow-qa |
# Convert mysql timestamp to epoch time in python
## Question
Convert mysql timestamp to epoch time in python - is there an easy way to do this?
## Answer
Why not let MySQL do the hard work?
select unix_timestamp(fieldname) from tablename;
Tags: python, mysql, time, timestamp | stackoverflow-qa |
# Convert mysql timestamp to epoch time in python
## Question
Convert mysql timestamp to epoch time in python - is there an easy way to do this?
## Answer
If you don't want to have MySQL do the work for some reason, then you can do this in Python easily enough. When you get a datetime column back from MySQLdb, you g... | stackoverflow-qa |
# Convert mysql timestamp to epoch time in python
## Question
Convert mysql timestamp to epoch time in python - is there an easy way to do this?
## Answer
I use something like the following to get seconds since the epoch (UTC) from a MySQL date (local time):
calendar.timegm(
time.gmtime(
time.mktime(
... | stackoverflow-qa |
# Convert mysql timestamp to epoch time in python
## Question
Convert mysql timestamp to epoch time in python - is there an easy way to do this?
## Answer
converting mysql time to epoch:
>>> import time
>>> import calendar
>>> mysql_time = "2010-01-02 03:04:05"
>>> mysql_time_struct = time.strptime(mysql_time, '%Y-%... | stackoverflow-qa |
# What would be the simplest way to daemonize a python script in Linux?
## Question
What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
## Answer
nohup
Creating a daemon the Python way
Tags: python, scri... | stackoverflow-qa |
# What would be the simplest way to daemonize a python script in Linux?
## Question
What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
## Answer
See Stevens and also this lengthy thread on activestate whic... | stackoverflow-qa |
# What would be the simplest way to daemonize a python script in Linux?
## Question
What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
## Answer
If you do not care for actual discussions (which tend to go ... | stackoverflow-qa |
# What would be the simplest way to daemonize a python script in Linux?
## Question
What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools.
## Answer
I have recently used Turkmenbashi :
$ easy_install turkmenb... | stackoverflow-qa |
# Using Pylint with Django
## Question
I would very much like to integrate pylint into the build process for
my python projects, but I have run into one show-stopper: One of the
error types that I find extremely useful--:E1101: *%s %r has no %r
member*--constantly reports errors when using common django fields,
for e... | stackoverflow-qa |
# Using Pylint with Django
## Question
I would very much like to integrate pylint into the build process for
my python projects, but I have run into one show-stopper: One of the
error types that I find extremely useful--:E1101: *%s %r has no %r
member*--constantly reports errors when using common django fields,
for e... | stackoverflow-qa |
# Using Pylint with Django
## Question
I would very much like to integrate pylint into the build process for
my python projects, but I have run into one show-stopper: One of the
error types that I find extremely useful--:E1101: *%s %r has no %r
member*--constantly reports errors when using common django fields,
for e... | stackoverflow-qa |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.