0
votes
1answer
12 views
ffmpeg cannot detect file while os can
Issue
I'm trying to load images in a sub-directory with files named:
.\images\image0.png
.\images\image1.png
.\images\image2.png
.\images\image3.png
... etc ...
.\images\image8.png
...
0
votes
1answer
39 views
Files in python are empty for no reason
I have tried to split up my world generation from my actual game, since I usually fail with it. But for some reason it keeps insisting the file is empty/ the variable gained from it is empty, and ...
1
vote
3answers
23 views
Labels Aren't Changing
I'm only going to post a snippet of my code, because essentially, it does the same thing.
string = ''
time_calc = Tk()
time_calc.geometry('500x400')
time_calc.title("Calculate A Time")
...
0
votes
6answers
49 views
Python execute code only if for loop did not begin iteration (with generator)?
The else block in a for/else clause gets executed if the iteration finishes but is not interrupted by break, so I read.
Is there a language construct which would let me write something which executes ...
0
votes
0answers
19 views
Why am I getting this openopt index error?
First, the error:
Traceback (most recent call last):
File "tsp_solver.py", line 57, in <module>
solvetTSP(inputData)
NameError: name 'solvetTSP' is not defined
new-host:tsp Jonathan$ ...
0
votes
1answer
52 views
A* pathfinding on 2D grid doesn't find optimal path
I am trying to implement the A* algorithm on a 2D square grid. However, it almost never finds an optimal path, and I just can't see why. The code is also suspiciously slow, even for python.
I've ...
0
votes
2answers
28 views
Import statement doesn't work as expected with Python 3.3
I recently ported a django application from Python 2.7 to Python 3.3 with Django1.6b1.
My import statements wouldn't work anymore for custom module imports (User, views...) and I had to add a dot ...
0
votes
0answers
15 views
How to connect to access (.mdb) database with pyodbc using latin-1 filename
I use this code to connect to my access (.mdb) database:
# -*- coding: latin-1 -*-
fileMDB = 'C:\\Python27\\OptimisateurLievre\\final\\Archives_PrevisionsESP_Août_2013.mdb'
param = "Driver={Microsoft ...
-4
votes
1answer
41 views
maintaining order in json (python flask)
I made a sorted dictionary to pass through json to a javascript, however, it seems whenever I throw it into a json.dumps() it changes its order into alphabetical by keys. It is critical that I keep it ...
0
votes
1answer
23 views
Python reading unicode forlder and file names
I am new to Python. I am trying to input one path and use os.walk() to search all files, and want to return files' names and use os.path.getsize() to get file size, and then write them into csv file. ...
2
votes
1answer
41 views
cancatenate two strings in a dict
views.py
def method(request):
for member in list:
personname = {'id':member.id,
'name':member.firstname + member.lastname
}
...
0
votes
1answer
29 views
Obtain results from processes using python multiprocessing
I am trying to understand how to use the multiprocessing module in Python. The code below spawns four processes and outputs the results as they become available. It seems to me that there must be a ...
0
votes
1answer
28 views
Python 2.7 strange import warning
I have a weird error re: imports in Python 2.7 when one script calls a different script which calls a different script - testbench.py imports user.py imports hardware.py
testbench.py runs a hardware ...
1
vote
0answers
32 views
Django invite friends from social account
I'm using social_auth API for login using social account. Is there is any possibilities to invite friends via facebook, twitter, linkedin in social-auth. or any other way to invite friends from social ...
0
votes
1answer
36 views
How can I get a column from a 2D python array?
I want to know the co
import numpy as np
a = np.array([[0,0,0,2,3,0],[3,2,4,0,0,1]])
If I want to get col2 to col4, so result may be:
[[0,2,3][4,0,0]]
How can I make it?
Thanks.