Questions tagged as 'python'

2
answers

Execute an .exe from the windows start with batch

I have a problem that I can not solve. I have an .exe that I want to start every time Windows starts. It is loaded in the windows registers: REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v Iniciarsoft/t REG_SZ /d "C:...
asked by 16.12.2016 / 16:02
2
answers

Help with program to ask words

I'm doing a little program to ask me French words. Actually, I tried something but I think it's all wrong. I want to ask:  - How many words do you want me to ask you? This is to set Palabra: user_input ; Traduccion: user_input a...
asked by 22.11.2016 / 09:11
2
answers

Django: show all the variables in a template

I have the following function that returns a JSON: class HotelService(models.Model): def get_avail_and_rates(self, rq): cabeceras = { 'Content-Type': 'application/json', 'action': 'getavailandrates',...
asked by 26.10.2016 / 09:04
1
answer

Create file in another directory that is not the current one (Python)

I want to create the file inside the folder of line 1 that is created at the same level where the file.txt is created os.mkdir(svnombreRP.get()) archi = open('%s.txt' % svnombreRP.get(), 'wb') archi.close() I tried to put it like this: os...
asked by 22.10.2016 / 22:40
1
answer

Update parameters b, and with loop

I have the following code, I need b, and they are updated try a for in the end of the code to update the values of the beginning but it did not give a good result. Code import scipy.optimize from scipy import optimize import numpy as np fro...
asked by 25.03.2017 / 05:11
2
answers

File name change script in python 3.5

I have to make a script in python 3.5 to rename the files in a folder, but the script does not run, I do not know why. Thank you for your attention: Here is the code: import os def rename_files (): # 1) Vamos a obtener el nombre de...
asked by 14.07.2016 / 16:14
1
answer

Doubt with reals and dictionaries in Python

You see, I'm in Codecademy doing this exercise: link And I can not think of any way to add 50 to the 'gold' value. My code is as follows: inventario = { 'oro' : 500, 'morral' : ['piedra', 'soga', 'piedra preciosa'], 'mochila' : ['xilofon'...
asked by 12.07.2016 / 20:41
1
answer

How to download a file uploaded using a form using FileField

in my model I use a field of type FileField to upload a file using a form. The model is as follows: from django.db import models from apps.agenda.models import TimeStampModel class Evidencia(TimeStampModel): Temas= models.TextFiel...
asked by 11.05.2016 / 01:26
2
answers

Error implementing Django REST Framework

I have the project on the production server, and I'm passing certain scripts from a local project to the server. And it gives me an error that I can not isolate. ImportError at / No module named viewsets Request Method: GET Request URL: htt...
asked by 11.05.2016 / 11:56
2
answers

Classes, attributes, objects and dictionaries in python

I have a question with the following code: class Prueba(): atributo = {} p = Prueba() p.atributo['a'] = 1 z = Prueba() z.atributo {'a':1} How is it possible that by creating a new object, it has the dictionary that was assigned to the...
asked by 16.11.2016 / 22:10