Skip to content

Tag: python

Login script using Python and SQLite

I’m trying to create a login script using SQLite to store the user data. Any ideas on how to to that? I have research over hours and found nothing of the kind. I would appreciate any help! 🙂 This is what I got so far: But it always returns Login failed… I want to check the input “user”…

How to enable unicode for Python on Fedora?

I am trying to compile MGTAXA on Fedora 23, but I get this error about python needs to be 2.2 or higher (2.7.10 is installed) and that unicode needs to be enabled. Question Can anyone tell me, what I need to do to enable unicode for Python in Fedora 23 and how to make it see that Python is at

passing bash array to python list

I’m trying to pass an array from bash to python using the old getenv method however I keep getting this error: could someone please explain why the $mdcNo isn’t passing from bash to python successfully? Code .sh: code .py: Answer If you want to pass a shell array to the Python script, your best be…

Summing columns in a text file

I have a data file that looks like this: and so on……till TOPIC:topic_2000. The first line is the topic and it’s weight. That is, I have the words in that specific topic and their respective weights. Now, I want to sum up the second column of each topic and check what value it gives. That is,…

diagnosing when I’m being limited by disk i/o

I’m running Python 2.7 on a Linux machine, and by far the slowest part of my script is loading a large json file from disk (a SSD) using the ujson library. When I check top during this loading process, my cpu usage is basically at 100%, leading me to believe that I’m being bottlenecked by parsing …