class Graph(object):
where does anyone write like that? I've seen only examples like i have
written.
is the object then passed to init?
class Graph(object):
def __init__(self, dictionary):
self.structure = dictionary
or
class Graph(object):
def __init__(self, object):
>
> > if start == end:
> > return path
> > if not self.dictionary.has_key(start):
>
>if start not in self.dictionnary:
>
> > return None
> > for node in self.dictionary[start]:
> > if node not in path:
> > newpa
I installed python30 and so command prompt runs all pythonprograms
through that which i didnt want so i uninstalled it.
now i cant start any pythonprograms through the commandprompt.
how do I "rebind" python25 to luanch when claling .py-files from the
command prompt?
--
http://mail.python.org/mai
Im using PyGame to draw images of graphs and trees. Howver right now i
am looping using:
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT: sys.exit()
screen.fill(screencolor)
pygame.draw.circle(screen, linecolor, (500, 20), 12, 0)
draw((500, 20), 3)
right. im an idiot anyway. i can just draw the lines before entering
the loop, problem solved...
--
http://mail.python.org/mailman/listinfo/python-list
On 28 Juni, 08:32, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Jun 27, 10:58 pm, defn noob <[EMAIL PROTECTED]> wrote:
>
> > right. im an idiot anyway. i can just draw the lines before entering
> > the loop, problem solved...
>
> Do not do that; it'll cre
from Tkinter import *
import os
master = Tk()
w = Canvas(master, width=800, height=600)
print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg')
im = PhotoImage(file = 'C:/users/saftarn/desktop/images/blob4.jpg')
#im = file = 'C:/users/me/desktop/images/blob4.jpg'
pic = w.create_image(0, 0
i want to process a large number of images and store their respective
pixels in a matrix.
what is the mostt efficient way of opening and checking them?
i doubt pygame is made for this purpose :)
i guess i could also use tkinter?
and why cant i print out matrix after getting the pixels? do i hav
Can I run the python interpreter from with in Emacs?
Do i have to change anything then? or is it by default? it already
syntax-highlights python-files.
--
http://mail.python.org/mailman/listinfo/python-list
this just shows a GUI that normally shows pictures but it doesnt show
any picture...
from PIL import Image
im = Image.open('C:/Users/saftarn/Desktop/images/giffer.gif')
im2 = Image.open('C:/Users/saftarn/Desktop/images/blob.jpg')
im.rotate(45).show()
im2.show()
--
http://mail.python.org/mailm
thanks but i dont quite understand the load-path, add to the load
path. the loadpath has a lot of variables.
so where i should i place the python-mode folder and should i then add
that directory to the loadpath?
--
http://mail.python.org/mailman/listinfo/python-list
from PIL import Image
import os
print os.path.exists('C:/Users/saftarn/Desktop/images/blob.jpg')
im2 = Image.open('C:/Users/saftarn/Desktop/images/blob.jpg')
im2.show()
first the command prompt pops up then the normal window to display
pictures but it doenst show a picture.
the prin os.path.exis
i unzipped and put the folder in site-packages. when i run setup.py
install nothing happens.
when i do import pp from shell it complains it doesnt exist.
isnt placing the folder in site-packages enough?
these setup.py-files often dont work but normally it still works.
--
http://mail.python.
On Jul 3, 5:02 pm, Chris <[EMAIL PROTECTED]> wrote:
> On Jul 3, 4:11 pm, defn noob <[EMAIL PROTECTED]> wrote:
>
> > i unzipped and put the folder in site-packages. when i run setup.py
> > install nothing happens.
>
> > when i do import pp from shell it compla
well the reason i unzipped and placed it in site-packages was because
nothign happened when i ran setup.py(unzipped). this has worked with
other packages before.
--
http://mail.python.org/mailman/listinfo/python-list
and yes it is parallel python.
and windows vista.
and the python GUI shell.
--
http://mail.python.org/mailman/listinfo/python-list
I would love the same thing. Dont know what you are doing but this
might be relevant even if it is not what you are asking for:
http://imdbpy.sourceforge.net/
library to take data from imdb.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 3, 8:06 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On 3 juil, 18:51, defn noob <[EMAIL PROTECTED]> wrote:
>
> > well the reason i unzipped and placed it in site-packages was because
> > nothign happened when i ran setup.py(unzipped).
just crawling is supereasy. its how to index and search that is hard.
just start at yahoo.com, scrape out all the links and then for every
site visit every link.
i wrote a crawler in 15 lines of code. but then it all it did was
visit the sites, not indexing them or anything.
you could write a fast
isPrime works when just calling a nbr but not when iterating on a
list, why? adding x=1 makes it work though but why do I have to add
it?
Is there a cleaner way to do it?
def isPrime(nbr):
for x in range(2, nbr + 1):
if nbr % x == 0:
break
if x == nbr:
return T
On Jul 15, 7:28 pm, Mensanator <[EMAIL PROTECTED]> wrote:
> On Jul 15, 11:26 am, defn noob <[EMAIL PROTECTED]> wrote:
>
>
>
> > isPrime works when just calling a nbr but not when iterating on a
> > list, why? adding x=1 makes it work though but why do I have t
How can I check how many cores my computer has?
Is it possible to do this in a Python-app?
--
http://mail.python.org/mailman/listinfo/python-list
What does >> and << do?
Googling on them and they are just ignored...
--
http://mail.python.org/mailman/listinfo/python-list
def letters():
a = xrange(ord('a'), ord('z')+1)
B = xrange(ord('A'), ord('Z')+1)
while True:
yield chr(a)
yield chr(B)
>>> l = letters()
>>> l.next()
Traceback (most recent call last):
File "", line 1, in
l.next()
File "", line 5,
24 matches
Mail list logo