Questions tagged as 'python'

1
answer

Variable reset

I am doing a search in the SQLITE3 data loop inside my program and it returns values into my variable, however when I make a condition to be executed for when the value is filled it returns empty, I am beginner in BD Python and Kivy: class St...
asked by 09.08.2017 / 00:30
0
answers

Plot user per week pandas

I have a csv file that basically follows below, I'm trying to separate user's iteration number by week and plot a graph for each user. Hora Nome completo 8/08/2017 19:00 Joao 8/08/2017 19:00 Joao 8/08/2017 19:00 Joao 8/08/2017 18:55 Lucas 8...
asked by 09.08.2017 / 22:48
2
answers

My while closing before it really should

I made a code that should take the number of rows from a txt file and then use this same number of rows in a while to convert the columns and rows to array. lines = 0 ln = 0 for line in dataset: line = line.strip() lines += 1 prin...
asked by 25.08.2017 / 01:58
0
answers

The browser displays my python code instead of executing it

When I access my browser page in Python, it displays the code and does not execute the script. Here is my code: #!/usr/bin/python # cabecalho que informa o browser para renderizar como HTML print "Content-Type: text/html\n\n" # o conteudo...
asked by 07.08.2017 / 03:47
1
answer

Python administrator privileges [closed]

Is there any way or command to run a Python script with admin privileges?     
asked by 02.01.2017 / 18:19
0
answers

Python session system

Is there, in Python, a session system as it exists in PHP? I need to do an access control for a Python application that uses the database. I have already developed a similar (but web) project with PHP and used its session feature and found it...
asked by 04.08.2017 / 18:37
1
answer

Count number of occurrences in a log file

I'm trying to count the number of occurrences of multiple text patterns in a log file. My code is counting all the lines in the file for all text patterns. Where am I going wrong? The log file looks like this:    Feb 1 00:00:02 bridg...
asked by 02.08.2017 / 17:01
1
answer

Erase certain rows from a .csv python [duplicate]

What would be the easiest way to just delete certain lines from the .csv file within several more? In the .csv below I would like only the lines of the Client (C) Cleiton and their movies (F) which in this case would be City of God and...
asked by 12.08.2017 / 06:29
1
answer

Widget Select in Django does not appear in form

My signup page is not showing up the selection fields, my code is as follows: forms.py class InscricaoForm(forms.Form): VINCULO = [ (u'b', u'Bolsista'), (u'e', u'Estagiário'), (u't', u'Terceiro'), (u's',...
asked by 03.08.2017 / 15:49
1
answer

Line break in a .txt file

How to break the line when passing my data to a .txt file? The code I'm using to open, write, and close .txt are these: arquivo = open("arquivo.txt", "a", newline="") arquivo.write("%s;" % nome_critico) arquivo.close() What I'm wanting i...
asked by 03.08.2017 / 02:49