Questions tagged as 'python-3.x'

1
answer

How to kill the process automatically with Popen?

I'm running a parallel process in python: process = subprocess.Popen(['python',path, title, uid]) The program takes + - 1 minute to finish and run normally. The process generates a PID that I can capture: process.pid . In one example...
asked by 06.09.2018 / 19:53
1
answer

NoReverseMatch Error in Django

Hello! Studying Django and developing in this Framework, I came across the following error:    NoReverseMatch at / Reverse for 'displayURL' with arguments '(' ',)' not   found . 1 pattern (s) tried: ['profiles / (? P \ d +) $'] For a...
asked by 27.01.2018 / 00:45
2
answers

How to join texts in a file?

I'm trying to develop a program, which does the following: From 1 to 100, it writes the word "test" in a text file. And after that, I want it to match the word "test" WITH EACH LINE with its lines from another text file. I ran the progr...
asked by 13.01.2018 / 16:49
1
answer

Python CSV How to rewrite only one line of the file?

I have a line that stores the following columns inside the file: ID Nome Telefone Descrição DataEntrada HoraEntrada The ID is basically the line number and it's through it that I'm going to search what line to rewrite. I know that p...
asked by 28.11.2017 / 14:45
1
answer

Second command does not work [closed]

I was testing the conditions, but when I use one command and then another, the second is not working. c=str(input('')) if c == '/tutorial': print('ok, como vc é um hacker vc hackea td por comandos, para saber seus status vc precisa digita...
asked by 18.10.2017 / 03:02
1
answer

Invalid syntax message with no apparent error

I'm trying to rename a folder that has a set of files, I want to remove all the digits from the file names. But when I try to run the code the error message appears: "invalid syntax", pointing specifically to the os module. Can anyone tell me th...
asked by 02.10.2017 / 22:39
2
answers

Transform string into operator

I have the following string '1 + 1', I have to transform the numbers into integers and perform the operation, you have to transform the string '+' into the + operator, or other operators like the '*' operation using if's, however how many operat...
asked by 22.09.2017 / 19:58
1
answer

Problem to show the value in the dictionary that corresponds to the user response

bebidas = {'Suco de laranja': 5.99, 'Suco de uva': 5.99, 'Suco de açaí': 5.99, 'Coca Cola(lata)': 6.50, 'Vitamina': 7.50 } simounão = int(input('Olá, gostaria de ver nosso menu\n\n[1]Sim\n[2]Não\n\n')) while simounão != 1: simounão = int(inpu...
asked by 07.10.2017 / 22:27
2
answers

Delete a particular row from a .csv using Python

What I would like to do is that when the user types the name of a person who was inside the .csv file, his line and the lines of movies that he evaluated were deleted (I used an identifier for that), the code is this: import csv with open("ar...
asked by 09.08.2017 / 23:29
2
answers

How to receive more than one user command at one time?

For example: nasc= input('INFORME SUA DATA DE NASCIMENTO: ') RESPOSTA= 15112002 How to separate this into DAY / MONTH / YEAR?     
asked by 15.10.2017 / 18:07