Tagged Questions
Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python.
0
votes
1answer
7 views
specified list comprehensions
hmm . An old topic which is list comprehensions ....
Anyway guys I need your help!! .... I spent already 3 hours ( yes and I know it ... it's not long ... ) trying to get it right ... but ....
This ...
0
votes
1answer
9 views
Prevent a form field from displaying in the browser
I have a form and want that the user field should not be displayed.
models.py
class Questions(models.Model):
user=models.ForeignKey(User)
category=models.ForeignKey(Categories)
...
1
vote
2answers
14 views
Assert string only contains letters
I have seen methods like isAlpha(), but it accepts spaces and punctuations, which I don't want. Any way to check that a string contains only big or upper case alphabet letters?
E.g. psudo:
...
0
votes
1answer
8 views
Script won't run in order
I have this python script that will not run in the correct order I want it to. Here is the code:
import VT as vt
import VT_Tests
import AUTO as auto
def main():
auto.run()
vt.run()
if ...
0
votes
0answers
6 views
Does anyone have any suggestion on how I can call tk forms from within arcpy but run them outside ArcGIS?
Does anyone have any suggestions on how I can call tk forms from within arcpy but run them outside ArcGIS?
I work in very controlled environment so using win32api is not an option currently so I need ...
0
votes
0answers
7 views
Timestamp on Keypress Program in Python
I'm very new to python and trying to create a small program that globally listens for a particular key, specifically the "break" key, and adds a timestamp to a log when pressed. I've finally gotten ...
-8
votes
0answers
29 views
Python's GC mechanism and the impact on performance? [closed]
python's GC mechanism
the impact on performance
if you have some examples about it, better!
1
vote
2answers
27 views
Django Template How to Show Money Values like 4.8p
I have a template which displays a cost per message currently this displays in html as:
(0.048p per message)
But, I want the output to be (4.8p per text).
I have tried |floatformat etc, but it ...
0
votes
1answer
29 views
plot multiple data files with python
['1.00E-11 0\n', '5.00E-11 0\n', '1.00E-10 0\n', '5.00E-10 0\n']
['1.00E-11 1.39925e-22\n', '5.00E-11 8.38792e-23\n', '1.00E-10 4.4248e-23\n', '5.00E-10 4e-21 \n']
I want to plot, in the same ...
0
votes
1answer
22 views
Efficiently Read last 'n' rows of CSV into DataFrame
A few methods to do this:
Read the entire CSV and then use df.tail
Somehow reverse the file (whats the best way to do this for large files?) and then use nrows argument to read
Somehow find the ...
0
votes
0answers
10 views
How to create objects from different models in one handler in Piston Django
i'm using Piston to create an API for an application in Django.
I'll try to explain my doubt on an easy way.
Let's think I've got two models:
class Device(models.Model):
id = ...
0
votes
0answers
27 views
how to redirect output in different files in pyhon
I am using the python script that takes two input files (goodProteins.fasta and list.txt)
and save result in gene.fasta output files.
fasta_file = "goodProteins.fasta" # First input
wanted_file = ...
2
votes
0answers
44 views
Efficient python way for recursive equations
I am trying to optimize a Loop that I have in a piece of my code. I thought that writing it in a more numpy way would make it faster, but is slower now!
the equations takes as input a numpy.array vec ...
1
vote
0answers
50 views
Accessing elements in unicode string
I have a simple list like:
var = [u'test']
If I try,
print var[0]
I get nothing (on Pyscripter), but I get the string test in Python interpreter. What am I doing wrong?
1
vote
4answers
40 views
Python: tree like implementation of dict datastructure
I have dict object something similar to like this,
topo = {
'name' : 'm0',
'children' : [{
'name' : 'm1',
'children' : []
}, {
'name' : 'm2',
'children' : []
}, {
'name' : 'm3',
...