Questions tagged as 'python'

1
answer

Remove tags generated at the end of the string of a Text Editor

I'm using a text editor and like others I've used, it always generates some useless tags that I'd like to remove. I can remove the last one, but sometimes it generates more than once. My code: def remove_useless_tags(message): message =...
asked by 09.11.2018 / 21:06
3
answers

For with schedule in python

Good morning everyone! Can anyone help me if it is possible to create a for in Python that uses times? Example:    Set a start time of for and end term and every 1 hour this for to run again. from dateti...
asked by 24.12.2018 / 13:11
1
answer

Recursive function that returns the sum of the digits of a number

I need to create a recursive function that receives a number n integer and returns the sum of the digits of this number. I made the following code but it is giving None : def somadig(n, s = 0): if n > 10: d = n%10...
asked by 10.12.2018 / 15:42
1
answer

How to copy a file in Python?

How to copy a fonte file to a destino file in Python?     
asked by 30.08.2016 / 19:47
2
answers

Conditional structure does not work

Several times, especially when the second price is higher than the others, the program charges that it is the cheapest. #Faça um programa que pergunte o preço de três produtos e informe qual produto #você deve comprar, sabendo que a decisão é...
asked by 31.12.2018 / 20:05
2
answers

Sublime Text 2 - error message in python / usr / bin / python: can not find '__main__' module in ''

Using cmd+B (Tools -> Build) in Sublime Text 2, the following error message appears: /usr/bin/python: can't find '__main__' module in '' How to solve this?     
asked by 05.03.2014 / 04:32
2
answers

Date to String conversion in Pyhton

I'm trying to get a date from this next select in python select MAX(PAYMENT_DATE) from fact_cashflow WHERE DOCUMENT_ID = 'SALDO FINAL' and PAYMENT_AMOUNT > 0 But my answer on the console is this    (datetime.date (2017, 2, 1)) I w...
asked by 16.03.2017 / 19:19
2
answers

What is the difference between project (project) and application ("app") in Django?

I had done some testing as a Django framework a while ago, and only now that I've tested it again, I noticed that there are two commands that have confused me: django-admin startproject nome_do_projeto And we also have: django-admin start...
asked by 05.04.2017 / 03:09
2
answers

Replace string with regex in python 3

I have a code that overrides certain string by whitespace dados = '[{"Id":12345,"Date":"2018-11-03T00:00:00","Quality":"Goodão","Name":"X","Description":null,"Url":"x.com.br/qweqwe","ParseUrl":"x-art","Status":"Ativa","Surveys":0,"KeySearc...
asked by 05.11.2018 / 00:40
1
answer

Specify DNS server when resolving address

I would like to do something like an "nslookup" to resolve an address of a site through my DNS servers, because in the example below, I only get through DNS that I have in my machine. How could I tell the IP of my server to resolve the Google...
asked by 11.03.2017 / 20:05