Re: [sqlalchemy] Doesnt execute any thing at new pc

2023-09-12 Thread Richard Damon

On 9/12/23 12:31 AM, FURKAN bilgin wrote:

Hi,
I updated my PC and downloaded my old codes.
However, the SQLAlchemy execute function is not working.
but it works on Ubuntu. The code is basically like this:

My first suggestion is to make sure the directory path points to 
something that actually exists.


Your "username" may have changed.

--
Richard Damon

--
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper


http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/12f40a81-3c37-4c9a-a807-8a2f5167be98%40Damon-Family.org.


[sqlalchemy] Doesnt execute any thing at new pc

2023-09-12 Thread FURKAN bilgin
Hi,
I updated my PC and downloaded my old codes.
However, the SQLAlchemy execute function is not working.
but it works on Ubuntu. The code is basically like this:
--
from sqlalchemy import (
MetaData,
Table,
Column,
Integer,
String,
Boolean,
create_engine,
DateTime,
VARCHAR,
)
from datetime import datetime
from flask_sqlalchemy import SQLAlchemy
from flask import Flask, render_template, abort, request
from sqlalchemy.sql import select

engine = create_engine(
"sqlite:///C:/Users/furka/OneDrive/Masaüstü/programlama/Python/db3.db"
)

app = Flask(__name__)
app.secret_key = "#$#$#$"
app.config[
"SQLALCHEMY_DATABASE_URI"
] = "sqlite:///C:/Users/furka/OneDrive/Masaüstü/programlama/Python/db3.db"
meta = MetaData()
meta.reflect(bind=engine)
db = SQLAlchemy(app)
print(len(meta.tables))
if not ("application" in meta.tables):
Table(
"application",
meta,
Column("id", Integer, primary_key=True),
Column("name", VARCHAR(80)),
Column("password", VARCHAR(80)),
Column("anaSayfa", VARCHAR(80)),
Column("manuelSayfa", VARCHAR(80)),
Column("varsayilanlar", VARCHAR(80)),
Column("dinamik", VARCHAR(80)),
Column("dinamikSayfa", VARCHAR(80)),
Column("kitap", VARCHAR(80)),
Column("kalem", VARCHAR(80)),
Column("date", DateTime, default=datetime.utcnow),
)
meta.create_all(engine)

if 1:
if 1:

application = Table("application", meta)
conn = engine.connect()

app = application.insert().values(name = "name",
password = "password",
anaSayfa = "anaSayfa",
manuelSayfa  = "manuelSayfa",
varsayilanlar= "varsayilanlar",
dinamikSayfa = "dinamikSayfa",
dinamik  = "dinamik",
kitap= "kitap",
kalem= "kalem"
)
conn.execute(app)
conn.close()
print("crtd")
--
output:
--
1
crtd
--

application table is created but new values doesnt appear

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/ced6580a-c3d9-4586-84f7-36a539f4ead2n%40googlegroups.com.