Tagged Questions
0
votes
2answers
23 views
How to pass a variable to a mysql query?
This one has no errors
cursor.execute ("update `1` set `2`='aaa' where `1`='5'")
This one has errors.
cursor.execute ("update `1` set `2`=aaa where `1`='5'")
The difference is, I am trying to ...
0
votes
2answers
13 views
Python urllib2 accesses page without sending authentication details
I was reading urllib2 tutorial wherein it mentions that in order to access a page that requires authentication (e.g. valid username and password), the server first sends an HTTP header with error code ...
-2
votes
1answer
40 views
Python can't open myscript.py
I am trying to run my python program from cmd, but I have run into a problem. When I type myscript.py it gives my the error message:
python: can't open file myscript.py:[Errno 2] No such file or ...
0
votes
0answers
29 views
Login to google using Python
I have been trying for some time now to login to my google account and download a file from it without using any external libraries.
I am specifically talking about Google Finance ...
1
vote
1answer
37 views
Python 2.7 - Pygame - intersecting two moving sprites
I've got 2 sprites (well... 3). One sprite is traveling in a straight line at a steady speed at a random angle (in radians). The other sprite is shooting at the moving sprite. Currently the projectile ...
0
votes
2answers
57 views
delete items from a set while iterating over it
I have a set myset, and I have a function which iterates over it to perform some operation on its items and this operation ultimately deletes the item from the set.
Obviously, I cannot do it while ...
0
votes
3answers
79 views
Python Float rounding errors [duplicate]
When using list comprehension expression:
[x * 0.1 for x in range(0, 5)]
I expect to get a list like this:
[0.0, 0.1, 0.2, 0.3, 0.4]
However I instead I get this:
[0.0, 0.1, 0.2, ...
2
votes
3answers
49 views
Printing X-type pattern in Python 2.7
I'm trying to print this pattern in Python:
*............*
.**........**
..***....***
...********
...********
..***....***
.**........**
*............*
And came up ...
-1
votes
0answers
22 views
Django Comparison Shopping Site: How to Keep Prices Up to Date? [closed]
I'm creating a web app (as in application as a whole, not referring to a Django app) that has a comparison shopping component. After researching this, it appears that I'll be creating a database and ...
0
votes
3answers
61 views
Calling function with two different types of arguments in python
I am new to Python. I came across a weird case and am not able to figure out what the issue is. I have 2 versions of a function written in Python :-
v1 -
def fileLookUp(fixedPath, version):
if ...
2
votes
3answers
56 views
How to get numbers from filenames?
I have many files in directory according to the key:
pic001.jpg
pic002.jpg
pic012.jpg
[...]
ico001.jpg
ico002.jpg
ico012.jpg
[...]
and I want to list this files and create structure like this:
for ...
0
votes
1answer
11 views
how to trigger a zone file save from dnspython after an update
I am using dnspython to perform dynamic DNS updates using a syntax similar to:
import dns.update, dns.query
update = dns.update.Update('zone', keyring=keyring)
update.add('source', 60, 'CNAME', ...
1
vote
1answer
40 views
How to open Tkinter programs nicely?
When I opened a Tkinter program, 3 things are opening:
My program
IDLE (shell)
Black screen (python command line)
How can I block second and third ones for a clean view? Thanks.
0
votes
1answer
29 views
Twisted / perform asynchronous http requests
I have a twisted reactor listening for incoming data. I have a second reactor performing http requests in certain time intervals sending the results to the first reactor. Both run fine.
Now I would ...
2
votes
0answers
54 views
Pything tkinter: plot function with canvas, HOMEWORK
An assignment for uni asks me to use tkinter to create a GUI program that takes a function, color, start point, end point and how many steps to take between (line drawn between each step).
I have had ...