Wannabe python programmer

Associate
Joined
8 Dec 2008
Posts
997
Location
Liverpool
So I can write a basic script, fair enough, but how do I become a good programmer.

I need to learn how to plan a project properly and write effecient code, but don't really know where to begin.

Anyone know of any websites/articles/tutorials/books that we help me advance in the subject of python programming?

Cheers :)
 
Cheers for the lead mate, his posting history isn't particularly consistant of late though, perhaps someone who sees this thread might still be in touch with him
 
TBH, no mate been kinda busy past couple of days with other things, I'll look into insatlling MSN/getting an account and getting intouch with the guy mentioned hopefully before the weekend. I'll let you know how it goes
 
Ok guys if it's alright with Rich (didn't speak to him last night a friend popped round) I'll use this thread to log my progress into the world of python.

Also perhaps Rich would be good enough to discuss things in public, the problem with chatrooms I find when discussing an interesting subject is there's no easy permanant record to refer to later. I was going to ask Rich if we could move from Skype to email but I'd reckon this thread is as good a place as any to discuss our interest.

I'll go about preparing a 'mission statement', Who I am , What I've done, What I know already (or think I do), What my overall project plan is.
 
Ok going to describe what I'm up to at the moment first as it easier.

I'm downloading market logs from EVE and extracting the information.

This is the text document you get when you hit the download log button ingame

Code:
price,volRemaining,typeID,range,orderID,volEntered,minVolume,bid,issueDate,duration,stationID,regionID,solarSystemID,jumps,
2.77,4512538.0,2308,32767,2448030695,4512538,1,False,2012-02-22 07:18:58.000,7,60003760,10000002,30000142,0,
2.7799,798068.0,2308,32767,2447710267,998069,1,False,2012-02-21 23:07:46.000,30,60003760,10000002,30000142,0,
3.0,81577.0,2308,32767,2447803614,81577,1,False,2012-02-22 01:10:58.000,1,60003760,10000002,30000142,0,
3.09,368326.0,2308,32767,2448116230,446511,1,False,2012-02-22 10:01:55.000,1,60004057,10000002,30000173,9,
3.14,4038108.0,2308,32767,2445942656,10238108,1,False,2012-02-20 09:20:07.000,90,60003760,10000002,30000142,0,
3.14,414976.0,2308,32767,2446830973,414976,1,False,2012-02-21 02:50:13.000,30,60003760,10000002,30000142,0,
3.15,16086652.0,2308,32767,2444026040,16086652,1,False,2012-02-18 20:38:26.000,90,60003760,10000002,30000142,0,
3.16,41527722.0,2308,32767,2441757193,41527722,1,False,2012-02-16 20:19:28.000,90,60003760,10000002,30000142,0,
3.17,1049115.0,2308,32767,2437908251,1049115,1,False,2012-02-12 23:32:27.000,14,60003760,10000002,30000142,0,
3.17,904796.0,2308,32767,2439888093,904796,1,False,2012-02-14 21:43:37.000,90,60003760,10000002,30000142,0,
3.19,3603.0,2308,32767,2435917382,3603,1,False,2012-02-11 13:07:35.000,30,60003760,10000002,30000142,0,
3.3,1440502.0,2308,32767,2441711402,1440502,1,False,2012-02-16 19:31:54.000,90,60003760,10000002,30000142,0,
3.36,1962572.0,2308,32767,2435165677,1962572,1,False,2012-02-10 20:20:47.000,90,60003760,10000002,30000142,0,
3.37,160906.0,2308,32767,2435162927,160906,1,False,2012-02-10 20:17:56.000,90,60003760,10000002,30000142,0,
3.38,2794038.0,2308,32767,2435160446,2794038,1,False,2012-02-10 20:15:16.000,30,60003760,10000002,30000142,0,
3.42,729392.0,2308,32767,2433385025,873392,1,False,2012-02-09 00:05:54.000,90,60003760,10000002,30000142,0,
3.44,3137947.0,2308,32767,2433088238,3937947,1,False,2012-02-08 18:39:01.000,90,60003760,10000002,30000142,0,
3.45,196626.0,2308,32767,2433058602,196626,1,False,2012-02-08 18:06:02.000,90,60004423,10000002,30000142,0,
3.48,20609839.0,2308,32767,2397951892,26000000,1,False,2012-02-13 23:09:17.000,90,60003760,10000002,30000142,0,
3.61,40089.0,2308,32767,2397761562,40089,1,False,2012-01-05 20:15:24.000,90,60003760,10000002,30000142,0,
3.8,160001.0,2308,32767,2396344880,1054556,1,False,2012-01-04 21:22:22.000,90,60003760,10000002,30000142,0,
3.99,5904882.0,2308,32767,2385753060,5904882,1,False,2012-01-04 00:34:39.000,90,60003760,10000002,30000142,0,
4.28,3222617.0,2308,32767,2395084303,3222617,1,False,2012-01-03 02:22:43.000,90,60003760,10000002,30000142,0,
4.36,1297987.0,2308,32767,2385089807,1297987,1,False,2011-12-23 16:38:59.000,90,60003760,10000002,30000142,0,
4.99,10000000.0,2308,32767,2367759787,10000000,1,False,2012-02-16 12:22:02.000,90,60003760,10000002,30000142,0,
6.95,639608.0,2308,32767,2369494517,639608,1,False,2011-12-08 14:32:34.000,90,60003760,10000002,30000142,0,
2.65,150000.0,2308,0,2430549140,150000,1,True,2012-02-06 02:30:09.000,90,60004072,10000002,30000137,5,
2.62,3806851.0,2308,-1,2446659395,10000000,1,True,2012-02-20 23:05:10.000,90,60003760,10000002,30000142,0,
2.61,28750711.0,2308,-1,2415497769,100000000,1,True,2012-02-09 20:57:04.000,90,60003760,10000002,30000142,0,
1.81,4576101.0,2308,3,2421630659,10000000,100,True,2012-02-17 19:20:23.000,90,60001540,10000002,30000119,2,
1.8,100000000.0,2308,0,2442149304,100000000,1,True,2012-02-17 05:21:13.000,90,60003760,10000002,30000142,0,
1.79,86064702.0,2308,-1,2404418297,100000000,1,True,2012-01-25 08:03:37.000,90,60003760,10000002,30000142,0,
1.76,3464454.0,2308,5,2447093695,3464454,1,True,2012-02-21 10:12:55.000,90,60000361,10000002,30000142,0,
1.75,1399175.0,2308,-1,2408785248,12375000,1,True,2012-01-16 07:50:11.000,90,60003760,10000002,30000142,0,
1.74,6889455.0,2308,-1,2408390051,10000000,1,True,2012-01-15 22:06:28.000,90,60003760,10000002,30000142,0,
1.74,1079889.0,2308,-1,2402876348,12000000,1,True,2012-01-15 22:17:04.000,90,60003760,10000002,30000142,0,
1.36,99094241.0,2308,32767,2439037961,100000000,1,True,2012-02-14 00:46:48.000,90,60003760,10000002,30000142,0,
0.5,100000000.0,2308,-1,2395229603,100000000,1,True,2012-01-03 06:29:56.000,90,60003760,10000002,30000142,0,
0.43,500000.0,2308,5,2364025107,500000,1,True,2011-12-03 13:41:06.000,90,60004069,10000002,30000137,5,

What my script does so far is strip the prices and how many buyers and sellers there are.

The code

Code:
openfile = open('[FILENAME]','r')

openfile.seek(0)

Whole_File_Library = openfile.readlines()

Files_To_Create = len(Whole_File_Library)

Files_Created = 0

Cost_Listing = 0

Buyers = 0

Sellers = 0


while Files_Created < Files_To_Create+1:
    
    if Files_Created > 0:

        if Files_Created < Files_To_Create:
            
            Entry_Working_On = Whole_File_Library[Files_Created]
        
        Cost_Finished = 0

        Cost_Length = 0

        Cost = 'empty'
        
        while Cost_Finished < 1:
            
            Digit_Working_On = Entry_Working_On[Cost_Length]


            if Cost == 'empty':
                
                Cost = Digit_Working_On

            if Digit_Working_On == ',':

                Cost_Finished=1

            else:

                Cost = Cost + Digit_Working_On

            Cost_Length = Cost_Length+1

                
        if Cost_Listing == 0:

                    Cost_Listing = [Cost]

        if Cost_Listing != 0:
            
                    Cost_Listing = Cost_Listing + [Cost]
     

        Comma_Count = 0

        Read_Position = 0

        while Comma_Count < 7:

                        if Entry_Working_On[Read_Position] == ',':

                            Comma_Count = Comma_Count+1

                        Read_Position = Read_Position+1

        Buy_Sell = Entry_Working_On[Read_Position]

        if Buy_Sell == 'F':
            
            Sellers = Sellers+1

        else:

            Buyers = Buyers+1


    Files_Created = Files_Created+1



print Cost_Listing, '\n'

print Buyers, 'Buyers \n', Sellers , 'Sellers \n'

The output so a far is a list of prices and how amny buyers and sellers there are.

As in

Code:
['22.77', '22.77', '22.7799', '33.0', '33.09', '33.14', '33.14', '33.15', '33.16', '33.17', '33.17', '33.19', '33.3', '33.36', '33.37', '33.38', '33.42', '33.44', '33.45', '33.48', '33.61', '33.8', '33.99', '44.28', '44.36', '44.99', '66.95', '22.65', '22.62', '22.61', '11.81', '11.8', '11.79', '11.76', '11.75', '11.74', '11.74', '11.36', '00.5', '00.43', '00.43'] 

14 Buyers 
26 Sellers

Further work needed is splitting the list and placing it in a DB (Sql hopefully), Strip the name and date out of the filename , Strip all files in a folder

Finally I will need to build an interface to query this database.

So far so good , I feel

/edit *phew* that certainly tested my Post-fu
 
Who I am , What I've done, What I know already (or think I do), What my overall project plan is.

Who I am

This post describes my skills in life (I'm a man with a couple of strings to my bow shall we say, though few formal qualifications)

I suppose other than that I love computers, living a simple but fulfilling life, Ecological technoligist would maybe describe my politics, I have a son 11 but no partner.

What I've done

Loads of good stuff :)

What I know already

Perhaps better to describe what I want to know

Initially

Python as the 'hub' of dynamic HTML referencing a SQL DB

Addressing an API

The theory and practice of cache scraping

The thoery and practice of browser plugins as a way of 'reading' a website

More longterm

The theory and practice of basic games design

AI what it means what it does and what we can do with it

Image analysis for the purpose data extraction

Overall Project plan

First Project is the deveopment of 3rd party tools for the MMO EVE.
 
Last edited:
OK Rich after breaking down my first project these are the things I need to learn first

Learn how to DB using Python (wether that be a SQL DB at this stage or not)

Learn how to make graphs, charts etc from DBed data (also what to use as my output HTML or a simple GUI (which I have no idea how to make))

So if you could point me in the right direction, it would be much apprecaited, also as this is a group learning project and I don't really want to have to bother Rich all the time (as he has a few students on the go) help and advice from anyone else who knows is more than welcome.

Cheers all, Enjoying it so far

A.
 
From briefly looking at the way your approaching that, it looks like you need the csv library in your life.

Good luck with it :)

I'll go and introduce myself later

:D

/edit Commas hey interesting

Also your the dude who kicked my arse in that 'average 3 files' thread aren't you, your Python-fu is admirable, kudos, you inspired me to start this thread in the first place so thanks :D
 
Last edited:
I'm learning python at the moment. long time c++ programmer so finding it quite easy but pretty powerfull.

Someone mentioned ai.. theres a course at udacity.net called 'how to program a self driving car'. some of the assignments are programming assignments using python. it starts off at a pretty basic level too, so is a good way to learn. plus you cover ai topics and some basic maths at the same time. free too, i reccomend it

I'll check that out mate cheers ;)
 
Further to this thread and the starting a forum one, though I'm kind of busy at the moment I have set aside a subforum of my new site for the purposes of a Python 'Group Learning Project' , (It's my new buzzword at the moment apparently :D)

So hopefully we can get some tutorials published and some interesting disscusions going
 
Cheers again for all the help folks.

TBH I'm kinda busy gaming (the first couple of weeks of one of those 24/7 browser RTS things) when the Chaos of that calms down a bit I'll be getting back to this project.

Nice to see so many others also with an interest in the subject, hopefully we can all learn a lot from each other
 
If anyone is interested I just started my first forum, I set aside a subforum incase me and rich needed to get into some deeper disscusions than Skype would allow.

Anyone interested in Python is more than welcome to join though.

So if anyone is into using a little forum space for the discussion of learning python, shout out, I'll sort out some linkage (if you are interested please register under your OCUK name so I can ID you, the forum is used by a few diffrent groups - thanks)
 
Finally got round to starting some work again today.

Thanks to Rich I now have access to a GUI , a problem that compfounded me both the first and this time I've tried Python.

Cheers Rich Your a star.

I'm making a espionage report DB for a RTS game with a copy/paste input.

I'll Maybe blog it on the ARC site or at least post the code for us to discuss when it's done.
 
Back
Top Bottom