Questions tagged as 'python-2.7'

1
answer

Format characters need not be specified?

Do the format characters have to be specified? such as: x = "Get rekt m8" print "Eu disse: %r." % x So why did not I have to specify this one and it worked for me? hilarious = False joke_evaluation = "Isn't that joke so funny?! %r"     
asked by 18.03.2015 / 17:45
1
answer

Installing spyder in python

How do I install spyder in python 2.7 ?? I already have the pip installed in the python scripts and easy_install .. with the help of a friend but I do not know how to install spyder     
asked by 08.04.2015 / 00:08
1
answer

Bar graph generated with Python has become unreadable. How to improve it? How to work with a dataset of more than 1 million rows?

Friends, The following bar chart was generated (the first column of datasets is UNIX time): ThePythoncode(version3.5)usedwasasfollows:#-*-coding:utf-8-*-importmatplotlib.pyplotaspltimportmatplotlib.datesasdatesfromdatetimeimportdatetime,t...
asked by 26.08.2017 / 16:39
1
answer

help with Qlocale and format currency brazil

In c ++ I used to convert an integer value to the Brazilian currency format as follows: QLocale loc = QLocale::system(); QLocale brasil(QLocale::Portuguese); loc.setNumberOptions(brasil.numberOptions()); QLocale::setDefault(loc); cout <<...
asked by 28.01.2017 / 21:34
1
answer

Python - How to print multiple variables in loop?

I am collecting 7 different values through a while . Whenever while is rotated, a value is assigned to variable valor and is printado , but I would like to save each valor to a variable for later use. For exam...
asked by 13.04.2017 / 15:38
1
answer

Open set of texts in python to apply functions (len, set, colocations, etc.). UnicodeDecodeError

>>> import nltk >>> from nltk.corpus import PlaintextCorpusReader >>> meucorpus='C:\Users\dudu\Desktop\Artigos sem acentos' >>> meustextos=PlaintextCorpusReader(meucorpus,'.*') >>> meustexto...
asked by 09.08.2015 / 04:40
1
answer

How to run this script in a more sophisticated way?

Good morning. I am using this code to update the firmware of my company's servers. However, I wanted to use this same code to update a list of servers, not just one. Follow the original code: #!/usr/bin/python from paramiko import SS...
asked by 06.09.2018 / 11:23
1
answer

Plotting circles on different planes

I need to plot circles in the zy and zx planes, but I can only plot in the xy plane, because by changing the variables x, y and z, I forget the shape of the circle. How can I fix this? import numpy as np from matplotlib import pyplot as plt im...
asked by 04.10.2018 / 01:57
1
answer

Error in accent in Python 2.7

During the encoding (below) there is an error appearing in the accent of some words: Note: I am using notepad ++ and run python 2.7 on windows cmd Code: # encoding: utf-8 import os, sys print "EXPEDIÇÃO DE DESPACHO" Exit: λ pyt...
asked by 30.08.2018 / 02:18
1
answer

Error in def function

How can I calculate salary value with number of hours above 40 as defined in if, I try to run with 41 hours but give me this error salario = float(40*valor_hora+(h_excd*(1.5*valor_hora)))#valor salario com horas extras TypeError: can't multip...
asked by 20.06.2018 / 13:09