Kill the colony

This is the place to post any code that you want to share with the community. Only completed scripts should be posted here.

Kill the colony

Postby Hissing Cockroach » Thu Nov 21, 2013 3:48 am

The youtube video is on this link:

https://www.youtube.com/watch?v=WExtiuRngrg

along with the source code attatched to it.

Mekire: Adding source link to post.
https://github.com/HissingCockroach/Kill-the-colony/blob/master/Kill%20the%20colony.py
Last edited by Mekire on Tue Dec 03, 2013 7:52 am, edited 2 times in total.
Reason: Updated link.
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Kill the colony

Postby Mekire » Thu Nov 21, 2013 5:58 am

Thanks for trying to put your project on github. This is a good step. You seem to have done something wrong though. You placed all your code in the file .gitignore. This is incorrect. .gitignore is a file that only contains the type of files you don't want to end up in your repo when you commit/push.

Here is an example of what your .gitignore file should look like (in fact you could use this file exactly):
https://github.com/Mekire/meks-pygame-samples/blob/master/.gitignore

It seems you accidentally named your repo the name of the script and for some reason put your code in the gitignore. Git is a bit tricky to use at first so feel free to ask if you get stuck. Assuming the original file is in the repository directory on the computer you work on, change the .gitignore to look like the above file. Then save your actual code as 'whatever.py'. Then add both of these changes with:

Code: Select all
git add *
git commit -m "some commit message"
git push origin master
Followed by entering your username and password.

-Mek

Edit:
Oh yeah, one more thing. Since you have a repo there is no need to make users download your resources from the web with urllib. Just place the actual resources in your repo like anything else.
User avatar
Mekire
 
Posts: 1025
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Kill the colony

Postby metulburr » Thu Nov 21, 2013 6:04 am

this reminds me of the old mario paint from the 90's
http://www.youtube.com/watch?v=vAQXJbfihxo
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1510
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Kill the colony

Postby Hissing Cockroach » Tue Nov 26, 2013 9:36 pm

Mekire wrote:Assuming the original file is in the repository directory on the computer you work on, change the .gitignore to look like the above file. Then save your actual code as 'whatever.py'. Then add both of these changes with:

Code: Select all
git add *
git commit -m "some commit message"
git push origin master



How do I do this? Where? Could you explain that
in a different way?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Kill the colony

Postby Mekire » Tue Nov 26, 2013 11:41 pm

I don't know how you specifically are interacting with git. I have a program that lets me open a git terminal window (on windows 7). All git commands go in there. Git takes a little work and will require you to do some research until you are comfortable with it.

-Mek
User avatar
Mekire
 
Posts: 1025
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Kill the colony

Postby Kebap » Wed Nov 27, 2013 11:35 am

Hissing Cockroach wrote:How do I do this? Where? Could you explain that in a different way?

git is handled in the operating system, not in the python shell.

Here is a neat git tutorial, where you can test and see the effects in your webbrowser:
http://try.github.io/levels/1/challenges/1

If you don't have Linux and/or git already configured, you may need to install it to your operating system.
Learn: How To Ask Questions The Smart Way
Join the #python-forum IRC channel on irc.freenode.net and chat with uns directly!
Kebap
 
Posts: 397
Joined: Thu Apr 04, 2013 1:17 pm
Location: Germany, Europe

Re: Kill the colony

Postby Hissing Cockroach » Sun Dec 01, 2013 8:08 pm

User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Kill the colony

Postby Mekire » Sun Dec 01, 2013 11:55 pm

Much better. My criticism now is however, that your file doesn't have a proper file name. If you had named it kill_the_colony.py then github would automatically display it using a python syntax highlighter making it much easier to read. Also, as I said, since you have a repo, just include your graphics in the repository instead of using the image_from_url function.

-Mek
User avatar
Mekire
 
Posts: 1025
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Kill the colony

Postby Hissing Cockroach » Mon Dec 02, 2013 10:57 pm

Wholdn't I have to use the image_from_url function for the repo?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Kill the colony

Postby Mekire » Mon Dec 02, 2013 11:22 pm

Add the actual graphic files to the repo that needs them.

-Mek
User avatar
Mekire
 
Posts: 1025
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Kill the colony

Postby Hissing Cockroach » Mon Dec 02, 2013 11:53 pm

How would I do that? Is there a command for it?
User avatar
Hissing Cockroach
 
Posts: 108
Joined: Sat Sep 14, 2013 2:35 pm
Location: Earth

Re: Kill the colony

Postby Mekire » Tue Dec 03, 2013 1:30 am

There should be a directory on the computer you work on which contains your git repository.

At the moment it should have four files in it:
Code: Select all
.git
.gitignore
readme.md
kill_the_colony.py

  1. Copy the actual graphic files you want to use into this directory.
  2. Change your code to load these graphic filenames directly instead of using the url.
  3. Open a git terminal (in whatever form this manifests on your OS)
  4. Type:
    Code: Select all
    git status
  5. Confirm that your graphics files are listed but not currently added.
  6. Type:
    Code: Select all
    git add *
  7. Type:
    Code: Select all
    git commit -m "Adding graphics files to repo."
  8. Type:
    Code: Select all
    git push origin master
  9. Type your github username.
  10. Type your github password (output will probably not show on terminal).
  11. ????
  12. Profit.
-Mek
User avatar
Mekire
 
Posts: 1025
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan


Return to Completed Scripts

Who is online

Users browsing this forum: No registered users and 2 guests