Questions tagged as 'python'

1
answer

What does Traceback mean?

When creating some basic programs in Python, I occasionally run into errors that bring the word traceback , so I was curious to find out what traceback meant.     
asked by 05.11.2016 / 19:40
1
answer

Thread control to prevent lock

I'm starting a crawler project and the idea is to download all content from a particular website. It already has some "usable" features. What is killing me is, I am doing it multithread, however the threads in a moment stop and I do not know h...
asked by 30.03.2016 / 16:23
2
answers

How does the function int deal with the character \ n?

I've created a list: usuarios = ['123\n','123\n4'] I tried to convert index 0 to integer using int() int(usuarios[0]) Result: 123 But when I tried to do the same with index 1: int(usuarios[1]) result:    ValueError:...
asked by 02.12.2018 / 20:43
3
answers

For for incrementing in Python

I've learned that in Python , to loop% with for , from 1 to 10, we use range . More or less like this: for i in range(1, 10): print(i) Generally, in other languages, when we need to do a simple increment, we use the...
asked by 13.02.2015 / 16:03
2
answers

Are there static methods in Python?

Are there static methods in Python? If they exist how do I make a static method?     
asked by 20.10.2017 / 21:01
4
answers

How to detect the operating system with Python?

How can I do in Python to identify which operating system is being used?     
asked by 23.11.2016 / 13:20
3
answers

How do I assign the results of a function that returns a list of objects?

In R we can make a function return more than one object through a list. But how do you assign these objects to two different variables? Example: f<-function(){ primeiro<-1:10 segundo<-11:21 return (list(primeiro,segundo)) }...
asked by 07.03.2014 / 05:02
4
answers

Two "return" in a function

How does it work if there are two (+) return in a Python function? Would you like to return the second value, or just the first one? Example: def soma(a, b): x = a + b y = 'qualquer coisa' return x return y     
asked by 21.09.2018 / 02:36
4
answers

Receive json data in PHP

I'm having trouble receiving JSON data in PHP to save to the database, and this data is sent from a python script , I already tried json_decode using the $_REQUEST variable, but without success, when I write to a .txt I can...
asked by 09.11.2015 / 12:26
2
answers

What to Serve for Class in Python

I'm new to programming but there's one thing I do not understand. What is the class in Python? Because it seems to me that with function I can do everything without using class . I already ran the net, but I did not find anything...
asked by 20.02.2015 / 20:51