« first day (10 days earlier)      last day (24 days later) » 

12:10 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Is it common/good practice to test for type values in Python?

GeorgeHello guys and gals, Is it common in Python to keep testing for type values when working in a OOP fashion? class Foo(): def __init__(self,barObject): self.bar = barObject def setBarObject(barObject); if (isInstance(barObject,Bar): se...

 
12:20 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Help with Windows Geometry in Python

anteater7171Why are the commands to change the window position before and after sleep(3.00) being ignored? if self.selectedM.get() == 'Bump': W1 = GetSystemMetrics(1) + 200 print W1 w1.wm_geometry("+100+" + str(W1)) w2.wm_geometry("+100+" + str(W1)) ...

 
12:42 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Crossplatform method for inserting text into raw_input (to avoid readine) in Python

vlad003I have an application (CLI) which includes the feature of editing account information. It does this by asking a question and putting in the old value in the answer so that it is editable. Currently I'm using the readline module to do this. I'd like another way of doing the same th...

newest questions tagged python - Stack Overflow
1
votes
0
answers
How can I enumerate filesystems from Python?

kdtI'm using os.statvfs to find out the free space available on a volume -- in addition to querying free space for a particular path, I'd like to be able to iterate over all volumes. I'm working on Linux at the moment, but ideally would like something which returns ["/", "/boo...

 
1:15 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to modify django cms multilingual middleware

paulohey guys, im trying to internationalize my site, so i have the django cms multilingual middleware class in my settings.py , when viewed from brasil, the url changes to www.ashtangayogavideo.com/pt/ash/homepage/ resulting in a 404, because my site is in www.ashtangayogavideo.com/ash/en/homepage...

 
1:58 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Django standalone run in cron

muntuI want to run automatic newsletter function in my crontab, but no matter what I try - I cannot make it work. What is the proper method for doing this ? This is my crontab entry : 0 */2 * * * PYTHONPATH=/home/muntu/rails python2.6 /home/muntu/rails/project/newsletter.py

newest questions tagged python - Stack Overflow
0
votes
0
answers
data structure to do a "select X where Y=y and Z=z and ... group by X" type lookup

BCSI have a set of a vectors (10k's worth). And I need to extract the set of value that are seen in any one of the positions where all the others value are know. I'm hoping for a solution that is sub linear (re the item count) in time and at most linear (re the total size of all the items...

 
2:41 AM
newest questions tagged python - Stack Overflow
0
votes
2
answers
How do I adjust how quickly commands are ran in Python?

anteater7171I want it to run the first line print 1 then wait 1 second to run the second command print 2, etc. Pseudo-code: print 1 wait(1 seconds) print 2 wait(0.45 seconds) print 3 wait(3 seconds) print 4

 
2:52 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Making a Toggle Button with an image in Tkinter.

anteater7171I know how to make an image a button in Tkinter, now how do I make it a toggle button similar to a radio button?

 
 
1 hour later…
4:02 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How can I convert a Python datetime object to UTC?

mikez302I have a python datetime object which I would like to convert to UTC. I am planning to output them in RFC 2822 format to put in an HTTP header, but I am not sure if that matters for this question. I found some information on this site about converting time objects, and it looks simpler that wa...

newest questions tagged python - Stack Overflow
0
votes
0
answers
Cannot access members of UserProperty in code

TimbermarI'm new to Google Apps and I've been messing around with the hello world app that is listed on the google app site. Once I finished the app, I decided to try to expand on it. The first thing I added was a feature to allow the filtering of the guestbook posts by the user that submitted them. ...

 
4:35 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How can I tell if a file is a descendant of a given directory?

mackstannOn the surface, this is pretty simple, and I could implement it myself easily. Just successively call dirname() to go up each level in the file's path and check each one to see if it's the directory we're checking for. But symlinks throw the whole thing into chaos. Any directory alon...

 
4:51 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
How to create partial download in twisted?

MarconiHow do you create multiple HTTPDownloader instance with partial download asynchronously? and does it assemble the file automatically after all download is done?

 
5:51 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Django forms, saving non-user submitted data

user401377class SomeModel(models.Model): text = models.TextField() ip = models.IPAddressField() created_on = models.DateTimeField() updated_on = models.DateTimeField() Say I have that as a model, what if I wanted to only display 'text' field widget for the user to su...

 
6:07 AM
newest questions tagged python - Stack Overflow
0
votes
0
answers
Get the length in characters of a PyGTK TextView

ToucanI have a gtk TextView in a maximized window and I want to know how many characters a line can fit before you have to scroll.

 
6:45 AM
newest questions tagged python - Stack Overflow
0
votes
1
answers
IRC bot functionalities

Mark KleinI'm learning Python and would like to start a small project. It seems that making IRC bots is a popular project amongst beginners so I thought I would implement one. Obviously, there are core functionalities like being able to connect to a server and join a channel but what are some good funct...

 
6:56 AM
newest questions tagged python - Stack Overflow
0
votes
1
answers
Python operator pecedence

lord britishPython docs say that * and / have the same precedence. I know that expressions in python are evaluated from left to right. Can i rely in that and assume that j*j/m is always equal to (j*j)/m avoiding the parentheses? If this is the case can i assume that this hold for operator ...

 
 
2 hours later…
8:44 AM
newest questions tagged python - Stack Overflow
0

hell.orts.ruIs it possible to add an additional condition to join statement created by django ORM? What I need in SQL is 'SELECT "post"."id", COUNT("watchlist"."id") FROM "post" LEFT OUTER JOIN "watchlist" ON ("post"."id" = "watchlist"."post_id" AND "watchlist"."user_id" = 1...

 
9:38 AM
newest questions tagged python - Stack Overflow
0

FrankI have a VPS that's hosting multiple virtual hosts. Each host has it's own access.log and error.log. Currently, there's no log rotation setup, though, this may change. Basically, I want to parse these logs to monitor bandwidth and collect stats. My idea was to write a parser an...

 
10:05 AM
newest questions tagged python - Stack Overflow
-1

str1k3rhello every body .. first see the code import poplib def con(pwd): M = poplib.POP3_SSL('pop3.live.com', 995) try: M.user(pwd) M.pass_('!@#$%^') except: print "[-]Not Found!:",pwd else: print '[+]Found password' exit() f...

 
10:38 AM
newest questions tagged python - Stack Overflow
0

PulpFictionHi all. Consider this code: >>> num = int(raw_input('Enter the number > ')) If the user types nothing and presses 'Enter', I want to capture that. (Capture an empty input) There are two ways of doing it: I do a simple nu...

 
11:10 AM
newest questions tagged python - Stack Overflow
0

V-LightHello, Experts I've got a question. I'm currently trying out the Django framework and I would share/present/show some stuff I've made to my workmate/friends. I work in Ubuntu under Win7 via VMware. So my wish/desire is to send my current pub-IP with port (e.g

 
11:32 AM
newest questions tagged python - Stack Overflow
0

pythonisgr8Hi all! I am new to python and am using it to use nltk in my project.After word-tokenizing the raw data obtained from a webpage I got a list containing '\xe2' ,'\xe3','\x98' etc.However I do not need these and want to delete them. I simply tried if '\x' in a

 
12:26 PM
newest questions tagged python - Stack Overflow
0

kdtHi, I would like to monitor system IO load from a python program, accessing statistics similar to those provided in /proc/diskstats in linux (although obviously a cross-platform library would be great). Is there an existing python library that I could use to query disk IO...

 
 
1 hour later…
1:36 PM
newest questions tagged python - Stack Overflow
0

cool-RRI was sure there was something like this in the standard library, but it seems I was wrong. I have a bunch of urls that I want to urlopen in parallel. I want something like the builtin map function, except the work is done in parallel by a bunch of threads.

newest questions tagged python - Stack Overflow
0

astrofrogI have developed pure Python packages that are installed via the standard python setup.py install. The files inside each distribution get converted without errors by the 2to3 conversion tool. Is there an easy way to modify the setup.py file such that if the python version is 3, th...

 
1:47 PM
newest questions tagged python - Stack Overflow
0

andorootsA beginner's Python question: I have a string with x number of sentences. How to I extract first 2 sentences (may end with . or ? or !)

 
 
1 hour later…
2:52 PM
newest questions tagged python - Stack Overflow
1

bazeldaHi, How can I convert a number (file size in bytes) to a string like the --human-readable option does in some UNIX commands ? Examples : 42e5 => 4.2M 2000 => 2.0K Many thanks !

newest questions tagged python - Stack Overflow
0

qweqrqwHi , the app is working this way. That i have a simple news adding model as below: class News(models.Model): title = models.CharField(max_length=100) publication_date = models.DateField(auto_now_add=True) content = models.TextField() the view

newest questions tagged python - Stack Overflow
0

user401574I have to send make some text bold in between plain text and send it to the template from the view. I do this: I save a string like this <b>TextPlaintext</b> in a variable and return it to the template. The "<b>" tags are not interpreted. How can make some tex...

newest questions tagged python - Stack Overflow
0

GennadichHello. I'm trying to wrote parsing script using python/scrapy. How can I remove [] and u' from strings in result file? Now I have text like this: from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.utils.markup import remove_ta...

newest questions tagged python - Stack Overflow
0

DominiCaneIs there any way to limit connection rate in Python Twisted? I need to simulate the slow dataline, with timeouts and optionally data loss and use twisted framework.

 
3:30 PM
newest questions tagged python - Stack Overflow
0

banxWhat are the usable tools? I am aware of wxformbuilder and wxGlade, but none of them seems to be complete until now.

newest questions tagged python - Stack Overflow
0

calccryptoWhat does '\r' mean? What does it do? I have never seen it before and its giving me headaches. It doesnt seem to have any purpose, since 'a\ra' prints as 'aa', but its not the same as the string 'aa'. Im using python 2.6

 
 
2 hours later…
5:08 PM
newest questions tagged python - Stack Overflow
0

user248237if I have a series of subplots with one column and many rows, i.e.: plt.subplot(4, 1, 1) # first subplot plt.subplot(4, 1, 2) # second subplot # ... how can I adjust the height of the first N subplots? For example, if I have 4 subplots, each on its own row, I ...

 
5:46 PM
newest questions tagged python - Stack Overflow
0

EminemyaHi All: I'm weaving my c code in python to speed up the loop: from scipy import weave from numpy import * #1) create the array a=zeros((200,300,400),int) for i in range(200): for j in range(300): for k in range(400): a[i,j,k]=i*300*400+j*400...

 
 
1 hour later…
7:02 PM
newest questions tagged python - Stack Overflow
1

Alex JLIs there a library out there which will validate CSS? The only tools I can find to do so are web sites. If one of these sites has an API, that would fit the bill, too. I have a script that serves as a CSS compiler. It sets various variables according to settings for a theme, an...

 
7:18 PM
newest questions tagged python - Stack Overflow
0

RadiantHexHi folks, This is my table: unicorns = {'name':'George', 'actions':[{'action':'jump', 'time':123123}, {'action':'run', 'time':345345}, ...]} How can I perform the ...

newest questions tagged python - Stack Overflow
0

Jag the ReducerIs it possible for a single process running a 32bit compiled version of python in Snow Leopard (64bit machine) to appear to consume > 4gb (say 5.4gb) of virtual memory as seen by the top command? I did a file ...python to see that the binary was not x86, yet it appeared t...

newest questions tagged python - Stack Overflow
0

RadiantHexHi folks, I'm using MongoDB an nosql database. Basically as a result of a query I have a list of dicts which themselves contains lists of dictionaries... which I need to work with. Unfortunately dealing with all this data within Python can be

newest questions tagged python - Stack Overflow
0

joozekclass MyModel(models.Model) image = models.FileField(upload_to="blagh blagh...") #more spam... I have a file in memory and I want to save it via Django FileField save method, like this: photo.image.save(name, buffer) # second arg should be django Fil...

newest questions tagged python - Stack Overflow
0

Robert A.  FettikowskiHere is a brief summary of my aims. I have a list of data in the data text file that are basically names or identifiers. The list of names is all on one line and seperated by a space. I want to make each data a seperate line. These data are identifiers. If for instance one name from the origin...

 
8:29 PM
newest questions tagged python - Stack Overflow
1

ElliottMy question is how to use data attributes in a method but allow them to be overridden individually when calling the method. This example demonstrates how I tried to do it: class Class: def __init__(self): self.red = 1 self.blue = 2 self.yellow = 3...

newest questions tagged python - Stack Overflow
0

systempuntooutHaving a list like this: ['foo','spam','bar'] is it possible, using list of comprehension, to obtain this list as result? ['foo','ok.foo', 'spam', 'ok.spam', 'bar', 'ok.bar']

 
8:45 PM
newest questions tagged python - Stack Overflow
0

V-LightHello, I think the title speaks for itself. I have a complex query with a subquery, but sometimes it returns no values, which is absolutely normal. But I can not prevent the ValueError message, cuz I am not able to find out whether RawQuerySet is empty or not. The RQS object is always ...

 
9:02 PM
newest questions tagged python - Stack Overflow
0

Mark0978 except ImportError as xcpt: print "Import Error: " + xcpt.message Gets you a deprecation warning in 2.6 because message is going away. Stackoverflow...

 
9:18 PM
newest questions tagged python - Stack Overflow
1

mederI believe eggdrop is the most active/popular bot and it's written in tcl ( and according to wiki the core is C but I haven't confirmed that ). I'm wondering if there would be any performance benefit of recoding it's functionality in node.js or Python, in addition to making it more acce...

newest questions tagged python - Stack Overflow
0

ShadyI want to make an "autofill" that works like this: The site contains the Name and down the Name has the field to write it. So, I want to make a program the search the "Name" in the website, and before that, click down the "Name" and write the name (easy part)... How can...

newest questions tagged python - Stack Overflow
0

EricI have this test: from datetime import datetime import random import unittest from ManagementReview import ManagementReview, ManagementReviewAction # Default Values for ManagementReviewAction Object Type DUMMY_ID = 1 DUMMY_ACTION = 'Action 1' DUMMY_OWNER = 'Owner 1' DUMMY_TIT...

 
10:12 PM
newest questions tagged python - Stack Overflow
0

skeritI'm currently trying out websockets, creating a client in JavaScript and a server in Python. I'm stuck on a simple problem, though: when I send something from the client to the server it always contains a special ending character, but I don't know how to remove it. I've tried

 
10:34 PM
newest questions tagged python - Stack Overflow
0

Sébastien PiquemalHello ! Here is a small challenge that I would like to submit to you. My goal here is to see if some code I have developed really make life simpler for aggregating and grouping, or if I have just missed something big ... PROBLEM Here are 3 very si...

newest questions tagged python - Stack Overflow
0

Sven WalterHi there! I'm searching in a way to limit the queryset which I can get through a model. Suppose I have the following models (with dependencies): Company |- Section | |- Employee | |- Task | `- more models... |- Customer | |- Contract | |- Accoun...

 
11:34 PM
newest questions tagged python - Stack Overflow
0

BjorkmanHi, I have a problem getting matplotlib 1.0.0 work in Python 2.5.2 (Ubuntu 10.04) See attached console output. Any ideas appreciated. Thanks Python 2.5.2 (r252:60911, Jul 23 2010, 23:04:44) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

 

« first day (10 days earlier)      last day (24 days later) »