Questions tagged as 'python'

4
answers

How do I put a Python module in a folder other than my script?

I am trying to run a script in Python ( v2.4 and v2.7 ) and created a module with some methods. Unfortunately this module needs to be in a separate folder. At Python documentation and up to here in Stack Overflow I found numerous post tal...
asked by 25.04.2014 / 22:11
1
answer

Using variable in the chdir function (OS module)

Is it possible to use the data given in a variable in some other function other than the chdir () of the Python OS module? I noticed that it is not possible to use variables in directory exchange using this method. Was there another of the...
asked by 28.01.2018 / 05:43
0
answers

Python: Redeem html mysql text

I'm using Bottle.py for study and testing ... I'm having a problem retrieving a database information. The table looks like this: create table if not exists postagens ( idPostagem INTEGER NOT NULL auto_increment PRIMARY KEY, tituloPosta...
asked by 28.01.2018 / 04:47
0
answers

Poloniex API Problem

I'm having problems with the Poloniex API, when I run the code polo = poloniex.Poloniex('key', 'secret') polo.sell('BTC_MoedaX', 0.003, 3) polo.buy('BTC_MoedaX', 0.003, 3) Returns the error: {'error': 'Amount must be at least 0.000001.'}...
asked by 19.01.2018 / 00:49
1
answer

Add footer with xhtml2pdf in specific pages with Django

I have a default footer that is displayed on some pages when generating the PDF with xhtml2pdf using Django which should be positioned at the bottom of the page. But in some I do not want to display. With the current code I can position it at...
asked by 18.01.2018 / 23:04
0
answers

HayStack's Best Match Going Wrong

I'm learning Haystack and ElasticSearch to implement searches on a website and I've run some tests here, but I noticed that sqs.filter(content='Brazil') returns me all Brazil posts from the site, but the results are not going as I want: I...
asked by 17.01.2018 / 15:31
1
answer

Forms in Python

I needed a help with cgi forms in python. This code works normally when I do not enter accents: # !/Programas/Python36-32/python # -*- coding: utf-8 -*- import cgi print("Content-Type: text/html; UTF-8\n") form = cgi.FieldStorage() web_page=""...
asked by 21.01.2018 / 14:26
1
answer

Settings environment timezones django postgres linux

Good morning, everyone. I have a site (Django) on a linux hosting service with Postgre SQL bank that is in New Jersey (USA). Users are in Brazil, so I have a timezone difference. I'm pretty sure this is a silly thing, with an adjustment I...
asked by 16.01.2018 / 14:09
1
answer

Exercising order list

Good afternoon, I'm developing an exercise and at one point I have to sort a list and remove repeated elements, for this I perform the conversion to set and then convert to list again: def remove(lista): lista2 = set(lista)...
asked by 13.01.2018 / 18:25
1
answer

How to change an attribute in a list of objects and write this list in a file

I have a list of conList objects that I want to change an attribute of an object and then write that list to a file, where each line of the file is an attribute of each object in the list. How do I do this? Edit: Code that I have so...
asked by 12.01.2018 / 03:47