Tagged Questions
1
vote
0answers
21 views
Python mysql: how do loop through table and regex-replacing field?
I am trying to iterate a table, fetch the rows in which a field has a pattern, then update the same row with a match group.
The following code runs without error, the two print lines before update ...
0
votes
0answers
6 views
Python - EPFImporter script - change from MySQLdb to mysql.connector - utf8mb4 supported
I want to use itunes EPFImporter script. Unforunately I have nearly no knowledge of Python. By default the script is using MySQLdb which does not support uft8mb4 only uft8. So my idea was to use the ...
-1
votes
1answer
29 views
Using Django, South and Sqlite during development [on hold]
I'm new to Python (2.7) and Django (1.5) and am working through the Django book whilst making a hobby site. I'm using Sqlite3 as dev db, but in production I intend to us MySQL. South looks like a ...
1
vote
1answer
19 views
Trouble with a simple query PyODBC
I want to query the following:
The attribute Unknown Hrs is Yes if the employee works on at least one project with NULL
hours, and No otherwise.
And I do this by first making a list, theList ...
1
vote
0answers
18 views
Getting “OperationalError: 1366” from python script - MySQL 5.6 . MySQLdb 1.2.3
Environment:
MySQL-python-1.2.3.win-amd64-py2.7
python-2.7.amd64
mysql-installer-community-5.6.12.2
Windows Server 2008 R2 Datacenter
I am getting Operational Error 1366 when inserting data with a ...
1
vote
1answer
43 views
42000 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
I'm having trouble with my python odbc code. I don't get this following code to work:
temp=process_query("SELECT FName, LName FROM Employee WHERE SSN='%s'" %i)
known_hours=process_query("SELECT ...
0
votes
2answers
19 views
Pipeline.py showing exception
I am building a small project in Scrapy and am new to Scrapy.
When I am running my spider, it shows an exception error in my pipeline which says:
item['Number'][0], exceptions.IndexError: list ...
1
vote
1answer
38 views
cannot import name “Contact”
I am trying to develop my first Django application, this is my directory tree:
demo-project
|____(html)
|____(myproject)
|___db_dump.sql
|___manage.py
|___(myapp)
| |___(templates)
...
3
votes
2answers
40 views
Some crazy code and crazy data. Insert rows in mysql db (python)
I'm trying to insert some data (stored in a list of tuples) to my local database. The data is a little inconsistent - some timestamps are datetime.datetime while some can be strings. But I don't think ...
0
votes
2answers
41 views
Python web scraping tutorial. Connection to MySQL database issue
I'm learning a web scraping technique from series of tutorials from Chris Reeves. Really great stuff, you should check it out.
I ran onto issue with example from tutorial no. 10 where Chris explains ...
1
vote
2answers
35 views
Update a MySQL table from an HTML table with thousands of rows
I have an html file on network which updates almost every minute with new rows in a table. At any point, the file contains close to 15000 rows I want to create a MySQL table with all data in the ...
-1
votes
0answers
14 views
Couple of python questions incorporating sql
I have a plugin that runs in python for a game server of mine. I have an issue of getting the "error processing your command" in this part:
def cmd_cost(self, data, client=None, cmd=None):
"""
...
1
vote
1answer
24 views
Reference query results with outerjoin in Flask/SQLAlchemy/jinja
I have the following query:
last_entry = Table.query \
.group_by(Table.email) \
.order_by(Table.date) \
.subquery()
results = ...
0
votes
2answers
21 views
I use python mysql API to insert data into mysql but it didn't work when i didn't add statement 'with conn:'
#!/usr/bin/python
#Program:
# insert data into mysql and the display them
import MySQLdb as mdb
conn = mdb.connect(host = 'localhost', user = 'root', passwd = '8023xue0526', db ='contact')
cur = ...
0
votes
0answers
38 views
Working with Django: is it possible to let user add his own fields and that information`ll be saved in the database?
I am a real greenhorn in Django and I do not know many possibilities and impossibilities either.
But I have to work on a very important task: it is needed to let user with special privilegies ADD his ...