show html with pyqt4
print "hellp world" :) i want to ask you if exist a function or class hwo can show the html code like the browser's jobe thx ...
print "hellp world" :) i want to ask you if exist a function or class hwo can show the html code like the browser's jobe thx ...
Just a quick question, im defining a class were only a set of integers is used. I cannot use the following datatypes in defining my class: set, frozenset and dictionaries. i need help defining: remove(self,i): Integer i is removed from the set. An exception is raised if i is not in self. discard(self, i): integer i is removed from th...
I have a Python project with mutiple extension modules written in C, which talk to a third-party library. However, depending on the user's environment and options some modules should not be built, and some compiler flags should be enabled/disabled. The problem is that I have to build the list of extension modules before I call setup(),...
Say I have a list of photos ordered by creation date, as follows: class Photo(models.Model): title = models.Char() image = models.Image() created = models.DateTimeField(auto_now_add=True) class Meta: ordering = ('-created',) I have an arbitrary Photo object photo_x. Is there an easy way to find the previous an...
I am trying to run python from a network share on windows 7. The network share is T: >t:\python-2.6.1\python Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import httplib2 httplib2\__init__.py:29: DeprecationWarning: the md5...
Hi folks, I am new to python and would appreciate a little help. How does one do the following: Having converted each line within a file to a nested list, e.g. [['line 1', 'a'], ['line 2','b']] how do I flatten the list so that each line is associated with a variable. Assume that the first member in each list, i.e. i[:][0], is known...
I have the following model in django: class Node(models.Model): name = models.CharField(max_length=255) And this subclass of the above model: class Thingy(Node): name = models.CharField(max_length=100) otherstuff = models.CharField(max_length=255) The problem with this setup is that while everything Just Works, a ...
I have a following JSON string coming from external input source: {value: "82363549923gnyh49c9djl239pjm01223", id: 17893} This is wrong-formatted JSON string ("id" and "value" must be in quotes), but I need to parse it anyway. I have tried simplejson and json-py and seems they could not be set up to parse such strings. I am running P...
Hi folks, How does one ignore lines in a file? Example: If you know that the first lines in a file will begin with say, a or b and the remainder of lines end with c, how does one parse the file so that lines beginning a or b are ignored and lines ending c are converted to a nested list? What I have so far: fname = raw_input('Enter f...
I have a standalone Django app that I'm working on right now. You can see the code at Github. In one of the edits, I introduced an error that caused the source tree to be deleted. I reset to an earlier revision, and suddenly my unittests stopped working. I've tried bisecting from an earlier revision, but it turned out nothing useful. A...
I would like to know if there is a native datatype in Python that acts like a fixed-length FIFO buffer. For example, I want do create a length-5 FIFO buffer that is initialized with all zeros. Then, it might look like this: [0,0,0,0,0] Then, when I call the put function on the object, it will shift off the last zero and put the new v...
I am trying to find the best way (most efficient way) to post large files from a python application to a Django server. If I rely on raw_post_data on the Django side then all the content needs to be in RAM before I can read it which doesn't seem efficient at all if the file received is 100s of megs. Is it better to use the file uploads...
I have a server which will be serving up javascript files, I need to grab it and execute some of it's functions using SpiderMonkey in python. How can I do this? ...
I'm on my first Django blog and when trying to get the posts by year, month and day, using the built-in generic view from Django, but I don't get proper results. (Sorry for my non-professional first question.. if someone knows what is the appropriate question, please let me know) Well, I think it's better to show you my configuration to...
Here are the top few lines (all comments) from a python application. What do the first two comment lines indicate? Are they special markers for another app? # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # Istanbul - A desktop recorder # Copyright (C) 2005 Zaheer Abbas Merali (zaheerabbas at merali dot org) # Portions Copyright (C...
Hi Guys, How does one check the order of lines in a file? Example file: a b c d e f b c d e f g 1 2 3 4 5 0 Requirements: All lines beginning a, must precede lines beginning b. There is no limit on number of lines beginning a. Lines beginning a, may or may not be present. Lines containing integers, must follow lines beginning b. N...
I'm looking to generate a stream in gstreamer, and I'd prefer to do it from python if possible. This points towards using gst-python, but I don't see a clear way to do it. It looks like creating a new stream would require making a gstreamer plugin, which gst-python doesn't seem to be able to do. To clarify, I'd like to be able to genera...
I'm developing a python GUI application and plan on calling external program packaged with my program to do some encryption. I noticed from sites like OpenSSL that talk about export laws regarding cryptography software. If I can't package binary forms of the cryptography software with my application, how can I work around this to still ...
I have the following lines of code: sql = "source C:\\My Dropbox\\workspace\\projects\\hosted_inv\\create_site_db.sql" cursor.execute (sql) When I execute my program, I get the following error: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to u...
So here's the problem I have, I can find the Search Term in my file but at the moment I can only print out the line that the Search Term is in. (Thanks to Questions posted by people earlier =)). But I cannot print out all the lines to the end of the file after the Search Term. Here is the coding I have so far:- search_term = r'\b%s\b'...