Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Small program ideas (http://www.velocityreviews.com/forums/t957681-small-program-ideas.html)

eli m 02-16-2013 03:22 AM

Small program ideas
 
Any small program ideas? I would prefer to stick to command line ones. Thanks.

Mitya Sirenef 02-16-2013 03:52 AM

Re: Small program ideas
 
On 02/15/2013 10:22 PM, eli m wrote:
> Any small program ideas? I would prefer to stick to command line ones. Thanks.


How about these two:

- simulation of a street crossing with green/red lights allowing cars
and pedestrians to pass in one direction then another

- simulation of an elevator in a building: buttons on each floor to
call the elevator, buttons inside to go to a particular floor,
multiple floors can be selected at the same time, creating a queue
of floors to go to.

-m

--
Lark's Tongue Guide to Python: http://lightbird.net/larks/


eli m 02-16-2013 03:57 AM

Re: Small program ideas
 
On Friday, February 15, 2013 7:52:57 PM UTC-8, Mitya Sirenef wrote:
> On 02/15/2013 10:22 PM, eli m wrote:
>
> > Any small program ideas? I would prefer to stick to command line ones. Thanks.

>
>
>
> How about these two:
>
>
>
> - simulation of a street crossing with green/red lights allowing cars
>
> and pedestrians to pass in one direction then another
>
>
>
> - simulation of an elevator in a building: buttons on each floor to
>
> call the elevator, buttons inside to go to a particular floor,
>
> multiple floors can be selected at the same time, creating a queue
>
> of floors to go to.
>
>
>
> -m
>
>
>
> --
>
> Lark's Tongue Guide to Python: http://lightbird.net/larks/


Could i make these text and not visual? That is what i am trying to do.

eli m 02-16-2013 03:57 AM

Re: Small program ideas
 
On Friday, February 15, 2013 7:52:57 PM UTC-8, Mitya Sirenef wrote:
> On 02/15/2013 10:22 PM, eli m wrote:
>
> > Any small program ideas? I would prefer to stick to command line ones. Thanks.

>
>
>
> How about these two:
>
>
>
> - simulation of a street crossing with green/red lights allowing cars
>
> and pedestrians to pass in one direction then another
>
>
>
> - simulation of an elevator in a building: buttons on each floor to
>
> call the elevator, buttons inside to go to a particular floor,
>
> multiple floors can be selected at the same time, creating a queue
>
> of floors to go to.
>
>
>
> -m
>
>
>
> --
>
> Lark's Tongue Guide to Python: http://lightbird.net/larks/


Could i make these text and not visual? That is what i am trying to do.

Mitya Sirenef 02-16-2013 04:19 AM

Re: Small program ideas
 
On 02/15/2013 10:57 PM, eli m wrote:
> On Friday, February 15, 2013 7:52:57 PM UTC-8, Mitya Sirenef wrote:
>> On 02/15/2013 10:22 PM, eli m wrote:
>>
>>> Any small program ideas? I would prefer to stick to command line ones. Thanks.

>>
>>
>> How about these two:
>>
>>
>>
>> - simulation of a street crossing with green/red lights allowing cars
>>
>> and pedestrians to pass in one direction then another
>>
>>
>>
>> - simulation of an elevator in a building: buttons on each floor to
>>
>> call the elevator, buttons inside to go to a particular floor,
>>
>> multiple floors can be selected at the same time, creating a queue
>>
>> of floors to go to.
>>
>>
>>
>> -m
>>
>>
>>
>> --
>>
>> Lark's Tongue Guide to Python: http://lightbird.net/larks/

> Could i make these text and not visual? That is what i am trying to do.



Of course - just think up some textual representation before starting on
the code. -m

--
Lark's Tongue Guide to Python: http://lightbird.net/larks/


eli m 02-26-2013 03:48 AM

Re: Small program ideas
 
On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote:
> Any small program ideas? I would prefer to stick to command line ones. Thanks.


Thank you guys for the suggestions. Any more?

Dave Angel 02-26-2013 06:15 AM

Re: Small program ideas
 
On 02/25/2013 10:48 PM, eli m wrote:
> On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote:
>> Any small program ideas? I would prefer to stick to command line ones. Thanks.

>
> Thank you guys for the suggestions. Any more?
>


There are all kinds of things you could do. First, consider something
that might be useful.

1) checksum all the files in a directory tree, using various checksum
algorithms.

2) Convert one kind of file to another.

3) Calculate time between two dates

4) Write some part of a backup system. For example, copy files from a
directory tree into a specified directory, stopping when the size totals
N.N gig, and keeping track of which files have been so processed, so
that after burning that directory to DVD, you can repeat the process.
As a bonus, add a utility & datafile to the top of that directory, so
that the DVD can be self-checking.

Then try something interesting:

1) find the nth prime, for example the 1000th prime

2) Find all perfect numbers under a trillion

3) solve the puzzles on http://projecteuler.net

4) Build a spell checker, using a combination of a standard
dictionary-list and custom entries. Bonus question - Make it smart
enough to only spell-check comments and literal strings, when applied to
files with an extension of .py


--
DaveA

Vytas D. 02-26-2013 01:21 PM

Re: Small program ideas
 
Hello,

Some more ideas:

1. Implement sin(), cos(), tan() etc. The accuracy could be supplied as a
parameter to the program. The correctness can be checked very easily with
implemented versions.

2. Read a string/file and look for palindromes (the group of words that can
read from both ends: A toyota, Madam in Eden, I'm Adam...)

3. Read a string/file and draw that string on the screen in a whirlpool
way. Counter-clockwise sample of the string: "abigsnake":
sgi
nab
ake

4. Print first n Fibonacci numbers.

5. Calculate Pi value for the specified accuracy. From wiki: "...
irrational number, including š, can be represented by an infinite series of
nested fractions...". So it won't be very complicated to implement.

6. Implement dos2unix/unix2dos

7. Calculator, that gets a string, put data into a tree and after
calculates the value.

Vytas D.


On Tue, Feb 26, 2013 at 6:15 AM, Dave Angel <davea@davea.name> wrote:

> On 02/25/2013 10:48 PM, eli m wrote:
>
>> On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote:
>>
>>> Any small program ideas? I would prefer to stick to command line ones.
>>> Thanks.
>>>

>>
>> Thank you guys for the suggestions. Any more?
>>
>>

> There are all kinds of things you could do. First, consider something
> that might be useful.
>
> 1) checksum all the files in a directory tree, using various checksum
> algorithms.
>
> 2) Convert one kind of file to another.
>
> 3) Calculate time between two dates
>
> 4) Write some part of a backup system. For example, copy files from a
> directory tree into a specified directory, stopping when the size totals
> N.N gig, and keeping track of which files have been so processed, so that
> after burning that directory to DVD, you can repeat the process. As a
> bonus, add a utility & datafile to the top of that directory, so that the
> DVD can be self-checking.
>
> Then try something interesting:
>
> 1) find the nth prime, for example the 1000th prime
>
> 2) Find all perfect numbers under a trillion
>
> 3) solve the puzzles on http://projecteuler.net
>
> 4) Build a spell checker, using a combination of a standard
> dictionary-list and custom entries. Bonus question - Make it smart enough
> to only spell-check comments and literal strings, when applied to files
> with an extension of .py
>
>
> --
> DaveA
> --
> http://mail.python.org/**mailman/listinfo/python-list<http://mail.python.org/mailman/listinfo/python-list>
>



Matej Cepl 02-26-2013 01:21 PM

Re: Small program ideas
 
On 2013-02-26, 03:48 GMT, eli m wrote:
> On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote:
>> Any small program ideas? I would prefer to stick to command line
>> ones. Thanks.

>
> Thank you guys for the suggestions. Any more?


1) Clone git repository from https://github.com/mcepl/html2text
2) Switch to fix_tests branch
3) Fix all tests running the testsuite with python3.3

You will help a good thing, contribute to the Aaron Swartz memory (yes,
*that* Aaron Swartz is the original author of the module), and learn
about python more than by any silly simple demos (hint: pdb is your
friend).

It is not difficult, just time consuming.

Best,

Matěj

Neil Cerutti 02-26-2013 02:32 PM

Re: Small program ideas
 
On 2013-02-26, Vytas D. <vytasd2013@gmail.com> wrote:
> Some more ideas:


If you like puzzles but not math, then The Python Challenge is an
interesting destination. You'll be thrown head first into Python
libraries you might not otherwise not be interested, like PIL.
Command line apps are not the norm in the challenge.

http://www.pythonchallenge.com/

--
Neil Cerutti


All times are GMT. The time now is 10:05 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.