Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
岳巧源
/
jd_data_process
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2898159d
authored
Oct 14, 2024
by
larosa
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add test
parent
5bdf6cfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
test3.py
test4.py
test3.py
View file @
2898159d
import
redis
import
pymysql
config_prod
=
{
"mysql"
:
{
...
...
@@ -17,10 +18,19 @@ config_prod = {
conf
=
config_prod
# if __name__ == '__main__':
# host = conf["redis"]["host"]
# port = conf["redis"]["port"]
# password = conf["redis"]["password"]
# db = redis.Redis(host=host, port=port, password=password, decode_responses=True)
# ans = db.hgetall("shop_distribution")
# print(ans)
if
__name__
==
'__main__'
:
host
=
conf
[
"redis"
][
"host"
]
port
=
conf
[
"redis"
][
"port"
]
password
=
conf
[
"redis"
][
"password"
]
db
=
redis
.
Redis
(
host
=
host
,
port
=
port
,
password
=
password
,
decode_responses
=
True
)
ans
=
db
.
hgetall
(
"shop_distribution"
)
print
(
ans
)
\ No newline at end of file
query_sql
=
"select * from lie_shop_push_sku_log"
db
=
pymysql
.
connect
(
host
=
conf
[
"mysql"
][
"host"
],
port
=
3306
,
user
=
conf
[
"mysql"
][
"user"
],
password
=
conf
[
"mysql"
][
"password"
],
database
=
conf
[
"mysql"
][
"database"
])
cursor
=
db
.
cursor
()
cursor
.
execute
(
query
=
query_sql
)
results
=
cursor
.
fetchall
()
print
(
results
[
0
][
4
])
\ No newline at end of file
test4.py
0 → 100644
View file @
2898159d
File mode changed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment