Questions tagged as 'python-3.x'

1
answer

Is it necessary to close MongoDB connections with PyMongo?

I'm working on a REST API with Python (Flask + MongoDB) and during development I found that in no part of the code had I freed the resources of the database. I've researched there but found nothing feasible about how to best approach this app...
asked by 14.07.2016 / 01:55
1
answer

Count elements of a column

How to count the number of occurrences in columns? File: luz NC luz mas ADV más blanquita ADJ blanco que CQUE que las ART el que CQUE que traía VLfin traer de PREP de serie NC serie mi PPO mi|mío coche NC coche...
asked by 30.08.2017 / 15:40
1
answer

I want to print a double strand of DNA in the python shell

I'm trying to print a nucleotide sequence with python as follows: tatatatatatatatatatatatatatatatatatatata |||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||| atatatatatatatatatatatatatatatatatatatat The proble...
asked by 31.10.2016 / 14:46
2
answers

Problem with accents, running in Windows Prompt

I'm creating software in Python , I'm having problems with string accents. The program is simple .. It asks questions to the user (name, version, description, etc.) and adds the answers of these questions in the middle of a text file .....
asked by 23.03.2015 / 15:01
1
answer

How to correctly use the styling of pandas?

Python code From the examples from documentation the following code was created: import pandas as pd import os import webbrowser import io def highlight_max(s): ''' highlight the maximum in a Series yellow. ''' is_max = s...
asked by 18.12.2018 / 20:04
0
answers

Unconfigured accents when passing data from a txt to a list in Python [closed]

I have a python script that takes words from a ".txt" file through the open method and puts them in a list. However, if the word in the text file has an accent, how long it has been passed to the list in python the accent becomes "Äe" for exampl...
asked by 27.12.2018 / 22:34
0
answers

Error executing pycuda code: "nvcc fatal: Value 'sm_61' is not defined for option 'gpu-architecture'

I just installed pycuda on Ubuntu 16.04 and am trying to verify that it is working. I'm trying to run: #https://documen.tician.de/pycuda/tutorial.html import pycuda.driver as cuda import pycuda.autoinit from pycuda.compiler import SourceModul...
asked by 26.08.2018 / 06:09
0
answers

How to make all possible combinations to arrive at a proposed result?

Well, let's start at the beginning, by the origin, the beginning of the beginning. I have this program: from itertools import combinations lis = [1,2,3,4,5,6,7,8,9] for i in (3, len(lis)): for comb in combinations(lis, i): if sum...
asked by 03.01.2018 / 00:02
0
answers

Counting the number of IP connections to a web server on port 80. Is the regex correct?

I would like to count the number of connections per IP per second (on port 80) to a web server whose IP is 192.168.1.216. The entry for the count is a network dump file in the PCAP format (.pcap file) generated with tcpdump. The output will be d...
asked by 02.09.2017 / 17:42
0
answers

Python + NFSe Prefecture of BH

I'm trying to integrate my system into Python with PBH on the NFSe issue. The file layout is correct, however, I can not sign the XML. The layout is here: <Signature Id="Ass_rps:ABCDZ"> <SignedInfo> <C...
asked by 26.10.2015 / 19:38