Questions tagged as 'python'

1
answer

How do I use several files in python?

I'm doing a program, and I have a file, which is the main part of the program. What happens is that I have a snippet code for the credits and I would like to put it in another file so as not to have a single very long file, since the snippet...
asked by 20.10.2018 / 22:52
1
answer

Language under python [closed]

I wanted to ask if anyone knows if the python interpreter is programmed directly in assembly or performed in C for example or in what ?. It's a question that I could not find an answer on Google.     
asked by 15.03.2017 / 10:06
1
answer

How to use the conditions with the contents of a txt file in python [closed]

data = open("archivo.txt", "r") o_data = data.readlines() data.close() if "hola" == o_data[2]: print("si") else: print("no") The problem is that I do not know if the word hello is equal to the hello that is written in the file. Thanks...
asked by 05.08.2017 / 17:17
1
answer

Error autopy python module [closed]

The error appears even in python:                import autopy       Traceback (most recent call last):         File "", line 1, in       ImportError: No module named autopy         version python 2.7.1     
asked by 01.08.2016 / 17:33
1
answer

COUNT in postgresql

In the example shown on the following link link , what should the query we do be like so that the result have 2 columns, the first being the 21 countries and the second being the number of clients in each country? Thank you very much in adva...
asked by 17.10.2018 / 11:37
1
answer

Count characters within a string in Python [closed]

I have a small function that counts occurrence of characters in a string. It works for me in some places, but not in others. Specifically in Jupyter is not going well and I do not know the reason. Thanks. def char_frequency(str1): dict = {} fo...
asked by 15.08.2018 / 09:43
2
answers

Random about a CSV in python?

I want to get a row randomly from the 31 that my CSV file contains. This is my code: import csv import random path="/home/eocampo/Escritorio/porque_pregunta_6.csv" file=open(path,newline='') reader=csv.reader(file) data=[row for row...
asked by 25.05.2018 / 15:19
1
answer

Compare item list one in list one, python

I'm new to Python, I'm just learning. I try to make a program that asks the user 5 data and store them in a list; then you have to compare if there are repeated elements and the elements that are not repeated include them in a new list to be pri...
asked by 01.12.2018 / 04:03
1
answer

that I must modify since it tells me that it is out of range in python

# -*- coding: utf-8 -*- import csv class Contact: def __init__(self, name, phone, email): self.name = name self.phone = phone self.email = email class Agenda: def __init__(self): self._contacts = []...
asked by 22.08.2018 / 19:25
1
answer

Create a public web server on a PC [closed]

I have some questions since I want to make a website, but I do not decide whether to do it at home or in a Hosting and I want to know the good and the bad of making a web in "home" The website will be published 24 hours Traffic will make t...
asked by 19.05.2017 / 18:48