Questions tagged as 'python'

1
answer

What is the difference between sorted () and .sort ()?

Why is the sorted() function considered more direct than the .sort() method used in lists with tuples?     
asked by 29.04.2016 / 19:32
1
answer

Urllib2, exception handling

I'm a beginner in the art of programming. I'm learning to program in Python through a book,    Learn to Program: The Art of Teaching the Computer (Cesar Brod - Novatec Editora) In one of the exercises, I should use the Urllib2 function li...
asked by 16.04.2015 / 01:42
1
answer

Collect shared URL statistics on Facebook using Python

To collect statistics from a shared URL on Facebook in PHP, I'm making use of cURL to query the following URI: // URL para submeter $pageUrl = 'http://www.example.com/my-new-article-is-neat'; // URI a consultar $uri = 'https://graph.facebook....
asked by 09.04.2015 / 14:37
1
answer

Monitoring REST API status

I am learning and trying to resolve a case of a POST request where a large body is being sent to be processed by the API and return is a job ID to access the result. It turns out that the time the API takes to process can vary depending...
asked by 22.12.2014 / 14:06
1
answer

Find all instances of a pattern in a text

I need to write a program that identifies a lowercase letter surrounded by three uppercase letters on each side. For example: "AEIoSDE" == "o" I wrote the code as follows: # coding: utf-8 letra = raw_input() for i in range(1, len(letr...
asked by 15.08.2014 / 18:15
1
answer

Problem in sublime to run code in python

Decode error - output not utf-8] [cmd: [u'python', u'-u', u'C:\Users\Rosangela\Desktop\Leo\Estudo\Exercicios_Python\teste14.py']] [dir: C:\Users\Rosangela\Desktop\Leo\Estudo\Exercicios_Python] [path: C:\Program Files (x86)\CollabNet;C:...
asked by 12.06.2014 / 04:15
1
answer

Store password in database

I have an application that needs to store passwords and get them again, ie is not just for login verification because the stored passwords will be used to provide access to another system (there is no access token for this system). A hash func...
asked by 10.02.2017 / 07:31
2
answers

How to define a header with a JWT token in a request made by the Requests library?

I am using the Requests Python library to make HTTP requests. I was able to make a post request quietly in order to get a JWT token. But now I need to send this token through a header, but I have no idea how to do it. The code I cur...
asked by 27.10.2016 / 13:58
2
answers

Make changes to lists local to Python?

In Python how do I do to the function below change the list locally, that is, only in the scope of the function f without changing x set outside of f ? x = [1, 2] def f(x): x[1] = "novo valor" return x f(x) ''' f alterou...
asked by 25.09.2014 / 05:13
2
answers

load independent process

I'm having trouble loading processes from a python application. Before I was using subprocess.Popen but it creates subprocesses of the main application and in my case, I need to create processes that run independently, in the sense that, if...
asked by 24.06.2014 / 15:16