Skip to content

Tag: python

Django percentage field

I’m trying to create a percentage field in Django, where the user just fills in 40 for 40%. There will be a percentage sign on the right of the input box so that they know they should fill in a percentage. 0.4 must be stored in the DB. So far I’ve tried the following: It works, but the problem is,

How to convert CRLF to LF on a Windows machine in Python

So I got those template, they are all ending in LF and I can fill some terms inside with format and still get LF files by opening with “wb”. Those templates are used in a deployment script on a windows machine to deploy on a unix server. Problem is, a lot of people are going to mess with those tem…

how can i write comments on some cells of excel sheet using pandas

I didn’t find anything that enable me to write comments on some specific cell while writing excel sheet using panadas.to_excel . Any help is appreciated. Answer After searching for some time, I think the best way to handle comments or other such properties like color and size of text at cell or sheet le…

Django download a file

I’m quite new to using Django and I am trying to develop a website where the user is able to upload a number of excel files, these files are then stored in a media folder Webproject/project/media. The document is then displayed in a list along with any other document they have uploaded, which you can cl…

run a crontab job using an anaconda env

I want to have a cron job execute a python script using an already existing anaconda python environment called my_env. The only thing I can think to do is have the cron job run a script called my_script.bash which in turn activates the env and then runs the python script. Trying to execute this script from th…