Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
I'm being followed by an army of spammy Python accounts on Twitter. What's going on?

Over the last few days a number of suspicious looking accounts have started to follow me on twitter. They all pretend to be some sort of generic Python related account. Yet they all have more or less the same bio and all tweets link to very suspicious websites.

I've blocked and reported all of them, but more and more are coming and I'm seeing legitimate Python accounts following some of them, probably without double checking.

Did anyone else notice this? Does anyone have an idea of what's going on? Should I report this to twitter and if yes how?

Here's a list of the accounts I've seen so far if someone want's to check them out. **Be careful with clicking any of the links in their tweets and bio!**

* [@learn_pythonx](https://www.twitter.com/learn_pythonx)
* [@python_codecs](https://www.twitter.com/python_codecs)
* [@PythonCodeademy](https://www.twitter.com/PythonCodeademy)
* [@The_PythonTutor](https://www.twitter.com/The_PythonTutor)
* [@Python_Codingz](https://www.twitter.com/Python_Codingz)
* [@Python_4coders](https://www.twitter.com/Python_4coders)
* [@Learn_Python_2z](https://www.twitter.com/Learn_Python_2z)
* [@python_0toHero](https://www.twitter.com/python_0toHero)
* [@ThePythonTutor_](https://www.twitter.com/ThePythonTutor_)
* [@python_4coder](https://www.twitter.com/python_4coder)
* [@Python\_Master_](https://www.twitter.com/Python_Master_)
* [@Python_programz](https://www.twitter.com/Python_programz)
* [@pythonbeginner_](https://www.twitter.com/pythonbeginner_)
* [@PythonsTraining](https://www.twitter.com/PythonsTraining)
* [@LearnsPython](https://www.twitter.com/LearnsPython)
* [@PythonDailyNews](https://www.twitter.com/PythonDailyNews)
* [@python_news_4u](https://www.twitter.com/python_news_4u)
* [@python\_academy_](https://www.twitter.com/python_academy_)
* [@pythonmaster_](https://www.twitter.com/pythonmaster_)
* [@PythonDev_AtoZ](https://www.twitter.com/PythonDev_AtoZ)
* [@LearnPython_toZ](https://www.twitter.com/LearnPython_toZ)
* [@Python_AtoZ](https://www.twitter.com/Python_AtoZ)
* [@Python4Tutorial](https://www.twitter.com/Python4Tutorial)

/r/Python
https://redd.it/7wl2hc
Using SelectFields with flask-wtforms !HELP!

I'm having issues using Select Field in flask . I'm unable to submit get data from the select fields , also when i use them with normal input fields none of the fields return any data . But the input fields work and return data if I remove the selectFields . Here's the code :

Models and form :

class City(db.Model):
id = db.Column(db.Integer, primary\_key=True)
city = db.Column(db.String(30), unique=True, nullable=False)
state = db.Column(db.String(30), nullable=False)
country = db.Column(db.String(30), nullable=False)
class CityForm(FlaskForm):
city = StringField('city', validators=\[InputRequired()\])
state = SelectField('state' , validators=\[InputRequired()\] , coerce = str)
country = SelectField('country' , validators=\[InputRequired()\] , coerce = str)

the select fields are populated in the views , like this :

form\_city.state.choices = \[(row\[0\],row\[0\]) for row in db.session.query(login\_model.State.state)\]
form\_city.country.choices = \[(row\[0\],row\[0\]) for row in db.session.query(login\_model.Country.country)\]

\~\~\~\~\~

if form\_city.validate\_on\_submit():
mssg = ""
prod = login\_model.City.query.filter\_by(city=form\_city.city.data).first()
print('okaaay')
if prod :
mssg = "Duplicate Data "
flash(mssg)
return redirect(url\_for('basic\_master'))
else:
new\_data = login\_model.City(city=form\_city.city.data.upper())
try:
db.session.add(new\_data)
db.session.commit()
mssg = "Data Successfully added 👍"
flash(mssg)
return redirect(url\_for('basic\_master'))

except Exception as e:
mssg = "Error occured while adding data 😵. Here's the error : "+str(e)
flash(mssg)
return redirect(url\_for('basic\_master'))
Nothing works if I have selectfields in my Form class , and If i remove them the normal input field works .

Any help is much appreciated thanks.

\#flask #sqlalchemy #wtforms #python

/r/flask
https://redd.it/8srquo