How to check that a path has a sticky bit in python?
How to check with python if a path has the sticky bit set? ...
How to check with python if a path has the sticky bit set? ...
I need to load an XML file and put the contents into an object-oriented sturcture somehow...basically take this; <main> <object1 attr="name">content</object> </main> and turn it into something like this; main main.onject1 = "content" main.onject1.attr = "name" It'll have a somewhat more complicated structure than that in the en...
As per the title. I am trying to create a simple scater plot, but haven't found any Python 3.0 libraries that can do it. Note, this isn't for a website, so the web ones are a bit useless. ...
I'm learning Python, and I have a situation where I want to consume items from an iterator. The tricky part is that under certain conditions, I want to "un-iterate." That is, put an item back onto the front of the iterator before I loop. For example, suppose I'm picking apples from a tree. My fruit basket can only hold 10kg before it...
How can you raise an exception when you import a module that is less or greater than a given value for its __version__? There are a lot of different ways you could do it, but I feel like there must be some really simple way that eludes me at the moment. In this case the version number is of the format x.x.x ...
What is the "critical section" of a thread (in Python)? A thread enters the critical section by calling the acquire() method, which can either be blocking or non-blocking. A thread exits the critical section, by calling the release() method. - Understanding Threading in Python, Linux Gazette Also, what is the purpose of ...
Kinda in relation to this question... what does the if __name__=="__main__": part do? # Threading example import time, thread def myfunction(string,sleeptime,lock,*args): while 1: lock.acquire() time.sleep(sleeptime) lock.release() time.sleep(sleeptime) if __name__=="__main__": lock=thread.alloc...
If you have a Google App Engine project you can authenticate based on either a) anyone with a google account or b) a particular google app domain. Since you can connect these two entities I would assume there is some way to query the list of users that can be authenticated. The use case is outputting a roster of all members in an organiz...
I'm half-tempted to write my own, but I don't really have enough time right now. I've seen the Wikipedia list of http://en.wikipedia.org/wiki/Web_crawler#Open-source_crawlers://">open source crawlers but I'd prefer something written in Python. I realize that I could probably just use one of the tools on the Wikipedia page and wrap it i...
I would like to write a program that will find bus stop times and update my personal webpage accordingly. If I were to do this manually I would Visit www.calgarytransit.com Enter a stop number. ie) 9510 Click the button "next bus" The results may look like the following: 10:16p Route 154 10:46p Route 154 11:32p Rou...
I've been a dev using rails since it's initial release and have recently lost touch with it because I've done a lot of work with Django due to my recent fondness of python. I do like Ruby as well and was asked by a friend recently if he should approach Rails or Django. Given that Rails is merging with merb and has a huge user-base versus...
Windows has the "system tray" that houses the clock and alway-running services like MSN, Steam, etc. I'd like to develop a wxPython tray application but I'm wondering how well this will port to other platforms. What is the tray equivalent on each platform, and how much manual work would be required to support Windows, OSX and Linux (wh...
Its urgent... I have a function. Inside that I'm maintainfing a dictionary of values. I want that dictionary to be maintained between different function calls Suppose the dic is : a = {'a':1,'b':2,'c':3} At first call,say,I changed a[a] to 100 Dict becomes a = {'a':100,'b':2,'c':3} At another call,i changed a[b] to 200 I want that ...
Overall Plan Get my class information to automatically optimize and select my uni class timetable Overall Algorithm Logon to the website using its Enterprise Sign On Engine login Find my current semester and its related subjects (pre setup) Navigate to the right page and get the data from each related subject (lecture, practical and ...
How to get the text of selected item from a drop down box element in html forms? (using python) How can I store the value to a variable, when I select one item from the drop down box using mouse? (ie. without using a submit button) This is for a application which I am doing in app engine which only supports Python. ...
Hi, I'll admit I'm completely dumbed by python install. Can someone help me on how to install module I want to play with PyGame, PyOpenGL etc. So I install them, but I everytime I type "import pygame" error message shows up. here's my environment so far. In .bash_profile PATH=${PATH}:/System/Library/Frameworks/Python.framework/Versi...
I'm considering moving my code (around 30K LOC) from CPython to Jython, so that I could have better integration with my java code. Is there a checklist or a guide I should look at, to help my with the migration? Does anyone have experience with doing something similar? From reading the Jython site, most of the problems seem too obscur...
According to setuptools documentation, setup.py develop is supposed to create the egg-link file and update easy_install.pth when installing into site-packages folder. However, in my case it's only creating the egg-link file. How does setuptools decide if it needs to update easy_install.pth? Some more info: It works when I have setupto...
Is there a way to monitor a gmail account using imaplib without polling gmail each time I want to see if there is new mail. Or in other words, I just want the script to be notified of a new message so I can process it right away instead of any lag time between polls. I see that the IMAP protocol supports this with the IDLE command, but ...
I have a Python script that calls an executable program with various arguments (in this example, it is 'sqlpubwiz.exe' which is the "Microsoft SQL Server Database Publishing Wizard"): import os sqlpubwiz = r'"C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\sqlpubwiz.exe"' server = 'myLocalServer' database = 'myLocalDatabase' ...