Questions tagged as 'python-3.x'

1
answer

How to print a .txt file in Python

I try to print this part of my work in a .txt file (code below), but I can not, because at the time of giving Run in the file that whole part goes out blank: Itisworthmentioningthatevenleavingblank,thefileissavedanyway,butallthefieldsthatwereto...
asked by 23.02.2017 / 17:24
1
answer

Set as default User logged in on the model | Django + Python3

I'm trying to learn Django, and with that I'm trying to create a simple ticket system. I've made a lot of progress in my studies, but now I'm packing on the following problem. How to do by default when saving a ticket, does Django save the...
asked by 23.02.2017 / 15:12
0
answers

Problem when making python script request administrator permission

I use Python 3.5 on Windows 8 and a simple script presented problem: I want to copy a file from my desktop to the C: \ Windows folder. First I tried this: from shutil import copy path1='C:\Users\username\Desktop\registro.py' path2='C:\Windows...
asked by 14.02.2017 / 15:27
1
answer

How to make the program write all information?

print('Bem-vindo!') print() numero_contas = int(input('Deseja registrar quantas contas: ')) x = 0 while x < numero_contas: x = x + 1 conta = str(input('A conta é de qual site:'))...
asked by 06.02.2017 / 20:08
2
answers

Rename application in Django Admin

Good night guys, I'm trying to rename the application in django admin according to the documentation, but it did not work, I think I'm doing something wrong, the code is as follows: players control / apps.py from django.apps import AppCon...
asked by 10.02.2017 / 22:28
0
answers

Sqlite3 terminates INSERT without error

In my code I execute a loop where I download some images from a URL and then save the image name in sqlite3 , however after a few% with% the code simply ignores the line where it is the inserts . if hasattr(card, 'image_url'):...
asked by 16.01.2017 / 14:29
1
answer

Jupyter notebook and Pyspark

The problem is this: When I enter Jupyer notebok with the command $ pyspark I create a new notebook and type: print(sc) it returns me the following error: NameError Traceback (most recent call last) <ipython-input-1-01cf0a34ba...
asked by 09.01.2017 / 20:28
0
answers

Is there a way to connect to a socket server hosted as localhost by CMD?

I would like to know if there is any way to run my server in python socket and connect to it using the command prompt. Is there any way to do this?     
asked by 03.01.2017 / 16:08
1
answer

How can I use pip in a version of python installed by pyenv?

I installed version 3.6.0rc2 on pyenv and I really need pygame in this version. I tried to use sudo pip uninstall pygame and sudo pip install pygame and also tried sudo pip3 uninstall pygame and sudo pip3 install pygame...
asked by 20.12.2016 / 21:12
1
answer

Type of a data structure Dictionaries

I'm trying to count how many dictionaries there are in a list. But the condition is always false in if. >>> type(record['TranslationStack'][0]) <class 'Bio.Entrez.Parser.DictionaryElement'> >>> record['TranslationStack'...
asked by 22.11.2016 / 01:21