hi;
i need grab to internet explorer address bar. how to get address bar url for python ? (i need second part other browsers grabbing address bar but internet explorer is urgently).
Thanks.
In python if a string contains the following,
print valid_str
The output of this is
Record is positive in tone:
It emphasizes "what a child can do and his or her achievements, as opposed to what he or she cannot do," explains the It is useful for progress and achievements during office conferences
How to search for the pattern It is useful in the above string and if not found return something.
Thanks..
Hello,
I'm trying to start an application using Python. I've seen that some people use startfile but I also read that it only works with Windows. I'm using Mac systems and hoping for it to work with them.
Thanks,
Aaron
I have a script which reads data from a csv file. I need to store the data into a database which has already been created as
$ python manage.py syncdb
so, that automated data entry is possible in an easier manner, as available in the django shell.
The extended indexing syntax is mentioned in python's doc.
slice([start], stop[, step])
Slice objects are also generated when extended indexing syntax is used. For example: a[start:stop:step] or a[start:stop, i]. See itertools.islice() for an alternate version that returns an iterator.
a[start:stop:step] works as described. But what about the second one? How is it used?
What is the proper indentation for Python multiline strings within a function?
def method:
string = """line one
line two
line three"""
or
def method:
string = """line one
line two
line three"""
or something else?
It looks kind of weird to have the string hanging outside the function in the first example.
Thanks.
Hi,
How can i print only certain words from a string in python ?
lets say i want to print only the 3rd word (which is a number) and the 10th one
while the text length may be different each time
mystring = "You have 15 new messages and the size is 32000"
thanks.
Dear All,
I would like to automatically generate a flowchart similar to this one ( http://en.wikipedia.org/wiki/File:%281%29_2008-04-07_Information_Management-_Help_Desk.jpg ) with Python.
Do you have any advice regarding the library I should use to draw boxes, arrows (with the shortest path), text and some colors.
Many thanks in advance !
Which technology is better to use in terms of performance for high performance scalable web application? PHP or Python?
The project is going to involve database.
Is there any short way to achieve what APT does in Python ?
I mean, when the package manager prompts a yes/no question followed by "[Yes/no]".
The scripts accepts YES/Y/yes/y or "enter" (defaults to Yes as hinted by the capital)
The only thing I find in the official doc is input/raw_input..
I know it's not that hard to emulate, but it's annoying to rewrite :|
What is the shortest / most elegant way to implement the following Scala code with an abstract attribute in Python?
abstract class Controller {
val path: String
}
A subclass of Controller is enforced to define "path" by the Scala compiler. A subclass would look like this:
class MyController extends Controller {
override val path = "/home"
}
I have two lists: one contains a set of x points, the other contains y points. Python somehow manages to mix the x points up, or the user could. I'd need to sort them by lowest to highest, and move the y points to follow their x correspondants. They are in two separate lists.. how do I do it?
I'm looking for a quick bash script or program that will allow me to kick off a python script in a separate process. What's the best way to do this? I know this is incredibly simple, just curious if there's a preferred way to do it.
How can I split a line in Python at a non-printing ascii character (such as the long minus sign hex 0x97 , Octal 227)?
I won't need the character itself. The information after it will be saved as a variable.
Hi,
In Python if I have 2 lists say:
l1 = ['a', 'b', 'c', 'd']
l2 = ['c', 'd', 'e']
is there a way to find out how many elements they have the same. In the case about it would be 2 (c and d)
I know I could just do a nested loop but is there not a built in function like in php with the array_intersect function
Thanks
I need a way to determine the space remaining on a disk volume using python on linux, Windows and OS X. I'm currently parsing the output of the various system calls (df, dir) to accomplish this - is there a better way?
I'm running OS X Leopard. I followed this site to install it. Trying to run any demo script, I now get "No module named opencv.cv", which is obviously stopping me from doing any programming. I am running python 2.5.1 (yes, I know it's kind of old).
Why would this be, and how can I solve it?
Thanks
(Using python 3.2 currently)
I need to be able to:
Run a command using subprocess
Both stdout/stderr of that command need be printed to the terminal in real-time (it doesn't matter if they both come out on stdout or stderr or whatever
At the same time, I need a way to know if the command printed anything to stderr (and preferably what it printed).
I've played around with subprocess pipes as well as doing strange pipe redirects in bash, as well as using tee, but as of yet haven't found anything that would work. Is this something that's possible?
What's the best way to sanitise user input for a Python-based web application? Is there a single function to remove HTML characters and any other necessary characters combinations to ensure that an XSS or SQL injection attack isn't possible?
I'm running a python program. When it get's to these lines:
f = open("/dev/bus/usb/007/005", "r")
x = fcntl.ioctl(f.fileno(), 0x84005001, '\x00' * 256)
It fails saying:
IOError: [Errno 1] Operation not permitted
What could be causing this problem?
Good day chaps.
I'm interested in learning how to invert (make a negative of) an image using the python image libary module.
I cannot however, use the ImageOps function 'invert.' I need another solution, using the RGB values. I've searched and tried to no avail. Thanks for any help :)
#!/usr/bin/python
#this looks for words in dictionary that begin with 'in' and the suffix is a real word
wordlist = [line.strip() for line in open('/usr/share/dict/words')]
newlist = []
for word in wordlist:
if word.startswith("in"):
newlist.append(word)
for word in newlist:
word = word.split('in')
print newlist
how would I get the program to remove the string "in" from all the words that it starts with? right now it does not work
Hi there,
I feel like this is quite delicate,
I have various folders whith projects I would like to backup into a zip/tar file, but would like to avoid backing up files such as pyc files and temporary files.
I also have a Postgres db I need to backup.
Any tips for running this operation as a python script?
Also, would there be anyway to stop the process from hogging resources in the process?
Help would be very much appreciated.