Questions tagged as 'python-3.x'

0
answers

Removing rows in PyQt

I need to remove a row in the Pyqt table. In fact it load the lines as per the filter. But at the time it's going to open it pulls the IDs of the lines out of the filter, how do I resolve this?     
asked by 20.04.2018 / 13:25
0
answers

Error trying to access ftp.debian.org using Python script: "OSError: [Errno 101] Network is unreachable"

The script: import os from getpass import getpass #nao ecoa o que digita na tela! from ftplib import FTP # Variavél que determina se devemos usar o modo ativo # para FTP nonpassive = False # Nome do arquivo a ser baixado nome_arquivo = 'READ...
asked by 08.04.2018 / 03:02
0
answers

I understand a parallel execution using _thread. Is there any more pythonic way of writing the same code?

import _thread def filho(tid): print('Ola da thread', tid) def pai(): i = 0 while True: i += 1 _thread.start_new_thread(filho, (i,)) if input() == 'q': break pai() Is there any more pythonic way of writing...
asked by 07.04.2018 / 22:36
2
answers

How to use the strip () function next to a list or tuple in python?

I am creating a script and in a snippet I create a list and then I use the strip () function next to upper () inside input v1, but at the time of calling the script and executing it it returns nothing, how can I to solve this? .... opcao_s...
asked by 31.03.2018 / 04:33
0
answers

Dataframe grouping with sorting

I'm having a hard time and I do not know how to go any further. I have a DataFrame where I am doing a grouping for a few columns and in the aggregate of it I take one of these columns and use the size to make a count, however I would like to dis...
asked by 31.03.2018 / 03:38
0
answers

(Socket) Client and Server Connection - how to get return from Cmd- Client (Python)

I want to run a command in the client's Cmd and return the values to the server. I've already been able to run the command in the client's Cmd ... Now how do I return the values to the server? The Server: import socket import os Host = "1...
asked by 31.03.2018 / 03:31
1
answer

Passing a GET parameter through the view in Django

I'm trying to pass a parameter via GET on the URL through the Django backend, but I'm not getting it. My url for the page I want to pass the parameter to is url(r'^(?P<short_name>\w+)/schedule/$', schedule_views.schedule, name='schedu...
asked by 01.03.2018 / 14:04
0
answers

How to check the tty ports connected in Python?

I have a device that is connected to the computer and I need to check which devices are connected and information about the device, then get the name of the port and start a communication. How can I do this in Python? Or at least check which por...
asked by 01.03.2018 / 15:11
0
answers

Python3.5 - Import multiple files from a folder

I have the following code: __author__ = 'Jones_Santos' # !/usr/bin/python3 import os from __init__ import mycursor, connection import csv import os from datetime import datetime, date, timedelta, datetime # Caminho do arquivo a ser importado...
asked by 28.12.2017 / 13:40
0
answers

Limit response time of a function

I made a script in python 3 that performs speed tests on my internet every 60 seconds and writes these results to a .txt file. Within this script I have a function called get_results which is the function responsible for performing the...
asked by 15.12.2017 / 02:53