
| im=Image.new('RGB', (255, 255)) | |
| ld=im.load() | |
| rnd,rnd1,rnd2=random.randint(0,125),random.randint(0,125),random.randint(0,125) | |
| rgbrnd=random.sample(range(0,3), 3) | |
| print(rnd,rnd1,rnd2) | |
| q,w,e=1,1,1 | |
| r=rnd | |
| g=rnd1 | |
| b=rnd2 | |
| forxinrange(im.size[0]): | |
| ifrgbrnd[0]: | |
| r=r+q | |
| ifrgbrnd[1]: | |
| g=g+w | |
| ifrgbrnd[2]: | |
| b=b+e | |
| ifr==255: | |
| q=random.randint(-2,-1) | |
| ifg==255: | |
| w=random.randint(-2,-1) | |
| ifb==255: | |
| e=random.randint(-2,-1) | |
| foryinrange(im.size[1]): | |
| ld[x, y] = (r, g, b) | |
| im |
| fromdjango.contribimportadmin | |
| fromdjango.conf.urlsimporturl | |
| fromappimportviews | |
| fromdjango.confimportsettings | |
| fromdjango.conf.urls.staticimportstatic | |
| urlpatterns= [ | |
| url('admin/', admin.site.urls), | |
| url('^$',views.index,name='index') | |
| ] | |
| ifsettings.DEBUG: | |
| urlpatterns+=static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) | |
| urlpatterns+=static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) |
SpaceApps is a NASA incubator innovation program.