Tagged Questions
Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Python is used for developing a wide range of applications. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using.
0
votes
0answers
4 views
Reordering Dictionary based on specific order
I have a dictionary in the below key, value format:
PairDict= {(19, 6): 13, (2, 29): 10, (38, 8): 20, (38, 5): 5}
The key is a tuple with two elements, and the value represent number of cycle.
I ...
0
votes
0answers
3 views
Querying the same table more than once in SQLAlchemy
I'm using SQLAlchemy in Pyramid application and have the following pair of tables.
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
...
0
votes
0answers
4 views
Python pyqt Dialog screen is running in background
I see a strange behavior in my Python pyqt Dialog, when I run the code I can see the screen (Dialog) being created and I can see it in the taskbar, when I hover around it I can also see the miniature ...
0
votes
2answers
38 views
Python, creating multiple variables based on an integer
I want to create multiple variables based on a number that I have defined.
Currently, I have a client and a server running and every time a client joins, I want the server to create a variable.
Each ...
1
vote
1answer
19 views
Checking for some exact lines in each file in directory and subdirectories
I am trying to do the following and running into errors,what is going wrong?
1.Open each file in the directory and subdirectories based on the argument
2.Check if each file has the copyright info ...
1
vote
0answers
11 views
HTTP & Networkx Crawler
My application requires that I write a generic HTTP web-crawler that will be used to extract URLs on a seed page up to a predefined, maximum page depth. While the crawler is busy, it will discover how ...
0
votes
0answers
12 views
Matplotlib Error
I am trying to enumerate few interesting errors on pylab/matplotlib.
If any of the learned members can kindly let me know how should I address them.
I am trying to enumerate them as follows.
i) ...
1
vote
2answers
51 views
Scripting a bash script from inside python
I have a little test.sh script that I run from the command line ./test.sh and it will ask me for input to 2 questions that I enter, then it loops till I ctrl-c out of it.
I want to write a little ...
2
votes
0answers
25 views
HTTP 303 (SeeOther): GET Works, POST Fails
I am trying to perform a simple action:
POST to a URL
Return HTTP 303 (SeeOther)
GET from new URL
From what I can tell, this is a pretty standard practice:
...
0
votes
1answer
11 views
forcing pyYAML to dump consistently
In [136]: a = [1,2,3,4,5]
In [137]: print yaml.dump(a)
[1, 2, 3, 4, 5]
In [138]: a = [1,2,3,4,5, [1,2,3]]
In [139]: print yaml.dump(a)
- 1
- 2
- 3
- 4
- 5
- [1, 2, 3]
why are the outputs of ...
0
votes
1answer
13 views
How to install lxml.etree directly to web2py modules?
I have a working setup of lxml.etree working on my windows desktop.
Since I wanted to move this to my server, instead of installing lxml in sitepackages, I wanted to install it inside the modules ...
0
votes
0answers
16 views
Native window controls Maximize, Minimize and Close buttons are not drawn in a matching way in Qt
I am using PySide - PyQt to develop an application. I would like to create my custom application frame and have the native close minimize and maximize buttons drawn on it. An example to this would be ...
0
votes
3answers
46 views
Python - is there a function similar to list.index() that is not affected by duplicated values in a list?
list.index() will give you the index of the first time the value is shown in the list, but I am looking for a way that will return the index of that specific item, regardless of whether it is ...
-1
votes
0answers
22 views
How do I create a simple bitmap image in python
I am trying to create a 8x8 image in python that looks like a bitmap but I have no idea how to do it.
5
votes
1answer
63 views
Is there a Python module for transparently working with a file-like object as a buffer?
I'm working on a pure Python parser, where the input data may range in size from kilobytes to gigabytes. Is there a module that wraps a file-like object and abstracts explicit ...