Tagged Questions
0
votes
1answer
20 views
Lock records in innoDB MySQL whilst python is processing
I have a table called "unprocessed" where I want to read 2000 rows, send them over HTTP to another server and then insert the rows into a "processed" table and remove them from the "unprocessed" ...
0
votes
1answer
27 views
The quickest way to write two dictionaries within each other into a MySQL table with Python?
I have a the below dictionary format:
{ File1:{name1:2,name2:4},
File2:{name3:3, name2:5},
File3:{name5:6} }
I want to insert them in a MySQL table with the below format:
...
0
votes
1answer
22 views
Inserting message parameters into MySQL database using Python
Here's some code that I am using to try and insert data into a MySQL database.
break_down(s) is a function that I am using to parse message parameters. These parameters are getting parsed as ...
0
votes
0answers
19 views
weakly-referenced object no longer exists error on creating a function
I am working with MySQL connector and Python 3.3. I am creating a script that consists of functions that frequently access database server. So for all the functions I have created, I am trying to ...
1
vote
1answer
44 views
sqlalchemy + flask , getting all post by day
I have a table, posts.
which consist of :
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(200))
content = db.Column(db.Text())
time = db.Column(db.DateTime)
this is ...
0
votes
0answers
19 views
Writing message parameters read from a GSM modem into MySQL using Python
I'm reading some data in a message that I receive from a GSM modem in Python.
I need to extract these data parameters before I write them into my MySQL database.
Before I do this, I parse the ...
0
votes
0answers
12 views
How to decrease the timeout for my python application connecting to mysql server
We have a python application running with uwsgi, nginx.
We have a fallback mechanism for DBs. ie., if one server refuses to connect, we connect to the other server. But the issue is that the ...
0
votes
1answer
30 views
SyntaxError: invalid syntax (connections.py, line 36) when running python manage.py syncdb
I'm on Windows 7, i have Mysql 5.5 installed after a lot of problems and python 3.3 and django 1.5.1, i created the db in mysql and when i run python manage.py syncdb for the first time i get ...
0
votes
2answers
36 views
passing in a le or ge sign in python
I hope this has not been asked previously, I was not sure what keywords to use.
Suppose I want to write a function that can take a less than or equal to statement for a query...
import MySQLdb
def ...
-1
votes
0answers
43 views
Inserting data to database with valid encoding
I have text file (UTF-8 encoding) like this:
• Tooling experience is an advantage • Automotive experience is as must
I am reading this file in Python 2.7.
I am inserting above string to ...
1
vote
1answer
31 views
Python and MySql - can't get geometry object
Well, I have a python programm which parses files. The data in these files looks like this:
Type=0x21
Label=2428
Data1=(54.67346,59.00001),(54.67415,59.00242),(54.67758,59.00001)
This is my ...
0
votes
1answer
42 views
ImportError: No module named MySQLdb - Debian 6.0
I got a problem in Python while try to import mysql. The beginning of my code is (I'm using monkeyrunner to run script) :
#!/usr/bin/env python
import sys
import MySQLdb
.
.
.
etc
Each time I ...
0
votes
1answer
29 views
Python MySQLdb query returns error when quotes added to the arguments
I am running the following code, which gives me an error
import MySQLdb as mdb
source_sentence = "%Barack Obama%"
filterquery = ""
try:
con = mdb.connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, ...
-2
votes
2answers
31 views
Comparing a python date variable with timestamp from select query
I want to take some action based on comparing two dates. Date 1 is stored in a python variable. Date 2 is retrieved from the database in the select statement. For example I want to retrieve some ...
-1
votes
0answers
57 views
Python-devel for python 2.7 on CentOS
Ok, i want to run django web-application on production VPS. Operation system of the VPS is CentOS. Application code written on Python 2.7. I have already installed Python 2.7 with configured virtual ...