Does anyone here know PYTHON (the programming language) or any others?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sgreger1
    Member
    • Mar 2009
    • 9451

    #76
    Originally posted by danielan View Post
    Just a couple observations...

    1. Did you look into the local job market to determine if python is a valuable skill in your area? (I like and use python on a semi-regular basis, but Java, C# or even JavaScript might be more marketable right now - depending on your interests, the local market, etc.) Python is kind of a niche language right now, IMO.
    2. Do you have an affordable junior college close? You seem to have several things to learn - you can learn them through education, experience or a combination... A couple intro night classes might be well worth the expense/time. Skip the Kaplans, the ITT's, the DeVry's, etc. Just normal public junior college. You'll still have things to learn, but this will build a foundation.
    3. +1 on the vi
    4. http://diveintopython.org/
    5. Linux is great, blah, blah, blah... You totally don't have to mess with linux or virtual box, or eclipse, or or or or to learn programming in general or Python in particular.
    6. I'd probably start with javascript anyway...


    My long term goal as I stated was to transfer into the IT field in the next year or two. My first real goal is getting an A+ certification and working at the helpdesk or something.

    Anyways, before I even get into any of that, I want to know if programming is something that I would be interested in. Therefore I decided that I will, as a hobby, teach myself 1 language and if it seems like something I would like to do for a career than I will actually look towards what I need to do to get certified for the position I want.

    So after getting into it the past few days I am very amped and extremely interested in it. I have moved past most of the barriers and can write simple programs for myself (very simple) without having to consult documentation when writing or debugging my code. I think this is something I definitely want to pursue.


    To answer your questions:

    1. I am learning python as a hobby. Once I start pursuing it as a career, my observations about the market are in line with yours so I will be looking into mainly web applications and languages that will help build web/mobile content. Once I get comfy with python, I plan on moving to C#, java etc. As far as I am aware python is not really commercially usefull for anything, however I have chosen it as my hobby project to help assist me in determining if programming something I might like. So far I am very excited.

    2. My plan is to enroll in the fall semester in some "intro to programming" type classes. Need to become better associated with what some of these terms mean, need to understand the vocabulary used in programming more.




    And I have also decided that while my eventual goal is to learn more about linux etc, for now I would just like to dive into learning some python. I'd like to learn how to make simple programs that assist me with things I want to do, currently I am trying to learn how to interact with excel spreadsheets in particular, if anyone has any experience with this let me know. I will try some more advanced stuff like installing a virtual box and all of that once I learn some more of the basics.



    You guys are such a great resource to have, I am so proud of all of the experts we have on here from a variety of fields. The stuff you guys posted has already helped me grasp python a lot better in the past few days and I am well on my way to accomplishing my dream of learning programming.



    I am still not really clear on what can actually be made with python, I know it's not used for anything commercial but can I write scripts that automate things on my computer or read/write data to excel spreadsheets and stuff? You know, functional things? I don't really care for making games or fancy GUI's yet, I would just like to know if it is easy or even possible to write programs in python that help automate tasks for you.

    Also, can a GUI even be made in python? how does that work, is it literally all coded, and you have to run the program each time to see if you made everything the right size and stuff?

    Comment

    • sgreger1
      Member
      • Mar 2009
      • 9451

      #77
      Originally posted by devilock76 View Post
      I agree, but I think you are missing the whole point. He is having problems with the mac python, and another poster has mentioned there are known issues. I have also heard of issues programming on the mac in python.

      The world at large is switching to this development model, if he is training for a job there are skills that can go with that. I have never been in an interview that only asked me about the one language I knew. I got asked questions about database environments, SLC methodologies, OS and networking environments, Change control management, you name it, the entire sphere of IT management and processes has come out over the span of my interview history.

      All that being said let us explain just how much Overhead installing a virtual machine with python will be on his computer.

      1. Install Virtual Box, simple enough for anyone to download and install from Oracle over WWW. (about 2-5 minutes depending on your internet connection)
      2. Create a new virtual machine, pretty simple, or he could download a prebuilt vdi, in fact I could build one and send it to him. (3 minutes to do it yourself, 5 if you read the prompts that tell you most everything you need to know)
      3. If you built your own virtual machine instead of a prebuilt vdi then download a linux or BSD distro.
      No-GUI - Arch, Debian-netinst, or FreeBSD (5-30 minutes depending on distro and internet connection)
      GUI - Fedura, Ubuntu, OpenSUSE, Mandriva (roughly the same as above)
      4. Install what you downloaded from 3. Just accept defaults with maybe full install options for the installers above (5-20 minutes depending on the distro, you are installing it on the VM so insert the disk, boot the vm and it will ask you where the install media is, boot as in start, not reboot the computer itself)
      5. If not already installed above, install python. (2 minutes)

      So what is that, worst case about an hour's worth of work, most of it downloading or the installer running on it's own, best case maybe 30 minutes? That time to have a controlled environment that you can easily snap shot, represents what you might see most often in the really real working world, starts adding more skills to put on your resume, and protects your main computer from your mistakes and experiments gone awry.

      All that in light of it is not working on his mac, he will rarely if ever be developing python for mac's in most of the corporate world, and how long has been spent in this thread?

      If you ask me it is a perfectly sensible solution, but opinions vary.

      Sgreger. If you decide to go the VM/VirtualBox route I can help you with that. The mac will easily handle it, especially a non-gui environment.

      For mobile development I guess part of it depends where the HTML5 vs Flash fight goes over the next few years. Considering the Iphone market share Objective C is a good thing to learn if you want to develop for the iPhone/iPad.

      However at this stage of the game he is really just learning programming. For that python is a great first language. Javascript has value too, but more in the web world at this point. Javascript vs Python. Depends where you are going with it. Python is unique in being so general purpose and cross OS without some of the complexity and overhead of Java. Python seems to have a different "vs" language depending on the intended use.

      Python vs Java
      Python vs Ruby (or usually Zope/Plone or Django vs Rails)
      Python vs PERL (for the script writing SA's out there)
      Python vs PHP

      Ken


      Wow thanks for the instructions Ken. If it is really that easy than maybe I will try it later on this evening, seems like an hour at most so worth a shot. My next step is to learn objective C but was wondering how difficult it is to learn? Lets say I spent 6 months learning python and I dedicated several hours a day to that task alone. Would I then, after 6 months of using python, be able to at least understand enough basics to pick up a book about objective C and learn it, or is objective C something more complex that I really need formal education for?

      Comment

      • devilock76
        Member
        • Aug 2010
        • 1737

        #78
        Python is useful commercially if you are talking certain web frameworks, Django, Zope/Plone, etc. Basically they are like Rails is to Ruby but for Python.

        Technically you can make anything with Python, like I referenced Jokosher is an open source DAW made with Python. Python is mostly considered a glue language, you can extend it with C and link to other languages as well. In the present world probably the biggest use of Python is for SA's as an alternative to PERL. Python is used in many free server scripts for advanced logging and system maintenance. There is even example code out there about how to build a web server with a simple python script.

        The language has a lot of power, and it also benefits from being another write once run anywhere language with less of the complexity and strict object adherence of Java. However it may not be the best language for more processor intense applications.

        The same though could be said of Java.

        Once you get done with python, if you are interested in the Web development then I would say learn PHP and Ruby (and of course Javascript as already mentioned), System Administration learn PERL and shell Scripting. If however you are interested in programming I would look at learning C and C++. Once you learn those, tackling Java, C# and Objective C should not be a problem. I have never programmed in Objective C but from what I have heard is if you are good at C++ then reading the manual and a little practice with the language should be most of what you need getting up to speed with it.

        Ken

        Comment

        • sgreger1
          Member
          • Mar 2009
          • 9451

          #79
          Originally posted by devilock76 View Post
          Python is useful commercially if you are talking certain web frameworks, Django, Zope/Plone, etc. Basically they are like Rails is to Ruby but for Python.

          Technically you can make anything with Python, like I referenced Jokosher is an open source DAW made with Python. Python is mostly considered a glue language, you can extend it with C and link to other languages as well. In the present world probably the biggest use of Python is for SA's as an alternative to PERL. Python is used in many free server scripts for advanced logging and system maintenance. There is even example code out there about how to build a web server with a simple python script.

          The language has a lot of power, and it also benefits from being another write once run anywhere language with less of the complexity and strict object adherence of Java. However it may not be the best language for more processor intense applications.

          The same though could be said of Java.

          Once you get done with python, if you are interested in the Web development then I would say learn PHP and Ruby (and of course Javascript as already mentioned), System Administration learn PERL and shell Scripting. If however you are interested in programming I would look at learning C and C++. Once you learn those, tackling Java, C# and Objective C should not be a problem. I have never programmed in Objective C but from what I have heard is if you are good at C++ then reading the manual and a little practice with the language should be most of what you need getting up to speed with it.

          Ken

          Thanks I really appreciate the help. I looked some more into it yesterday and it seems like python would be usefull for me to learn because it can be used witha lot fo things, but it's real functionality seems to come out when it is extended with different languages(which it appears to do quite well). So I think I chose a good one to start,the easy syntax is relaly helping me out here in a big way. I've gotten so far since i posted this thread, I am picking it up fast and am so excited about finally learning progrmamming.

          A few questions for those of you with more experience:


          For database stuff, what is the best language/thing to learn?

          As for IT jobs, which is the right direction to go? I know the market is very saturated with IT people and all the other reasons why NOT to be changing careers right now, but I am going to do it anyways because it is just something I want to do. Since I am currently employed this gives me time, I figure that within 2 years I should be able to start at an entry level position somewhere like maybe a heldesk and then move on. But my question is, what is the right niche field to go into? Where is the money/jobs? Is it in learning pure programming so I could work for a game company or software company,or should I ffocus more on networking stuff to try and land a job at a corporation?


          I am just not sure what being a full time programmer/networking guy/IT in general entails and I am not sure of what other options are out there. I just know I want to do something in the tech world. I am trapped in a cubicle in the medical/insurance field and I must escape.

          If in a year from now I could transition to a help desk or to anywhere in IT that would pay at least 40k, I will be happy. Around here there are a bunch of openings at the help desk and all you need is a A+ certification, they all pay about what I make currently. If I can just make the same amount I do now and switch fields, that would be a big step for me, even if it was at something simple like a helpdesk.

          Comment

          • devilock76
            Member
            • Aug 2010
            • 1737

            #80
            Originally posted by sgreger1 View Post
            Thanks I really appreciate the help. I looked some more into it yesterday and it seems like python would be usefull for me to learn because it can be used witha lot fo things, but it's real functionality seems to come out when it is extended with different libraries (which it appears to do quite well). So I think I chose a good one to start,the easy syntax is relaly helping me out here in a big way. I've gotten so far since i posted this thread, I am picking it up fast and am so excited about finally learning progrmamming.

            A few questions for those of you with more experience:


            For database stuff, what is the best language/thing to learn?

            As for IT jobs, which is the right direction to go? I know the market is very saturated with IT people and all the otehr reasons why N to be changing careers right now, but I am going to do it anyways because it is just something I want to do. Since I am currently employed this gives me time, I figure that within 2 years I should be able to start at an entry level position somewhere like maybe a heldesk and then move on. But my question is, what is the right niche field to go into? Where is the money/jobs? Is it in learning pure programming so I could work for a game company or software company,or should I ffocus more on networking stuff to try and land a job at a corporation?


            I am just not sure what being a full time programmer entails and I am not sure of what other options are out there. I just know I want to do something in the tech world. I am trapped in a cubicle in the medical/insurance field and I must escape.

            If in a year from now I could transition ot a help deks or to anywhere in IT that would pay at least 40k, I will be happy. Around here there are a bunch of openings at the help desk and all you need is a A+ certification, they all pay about what I make currently. If I can just make the same amount I do now and switch fields, that would be a big step for me, even if it was at something simple like a helpdesk.
            That is really every language, the power comes from the libraries, you can't run a C program without stdio.h. Visual Basic is nothing without the IDE and libraries that make the Windows API human readable and accessible.

            Just about any modern language has means of dealing with SQL and ODBC. That being said most of your internal corporate stuff is going to be using something .net talking to either MS SQL or in some cases Oracle. But there are so many different things out there.

            The IT industry can be volatile. You really should learn as much as you can. I mean choose a focus but keep in mind the big picture. I am a programmer mostly, but I do some system administration as well. It is better to be a swiss army knife in this industry as opposed to an exacto blade. The money, well the money seems to be in Project Management, although I wouldn't really call that IT most days.

            You will be trapped in a cubicle as well mostly. Although sometimes there are more telecommute options. You will look at numbers and code all the time and being on a computer might become less fun overall. You will also have to learn as a programmer to be incredibly creative translating the wants of the user into meaningful software requirements.

            I never really started at help desk, my first job in IT was actually as a tutor, teaching programming, and doing some lab tech duties on the side. I have filled in at the helpdesk side of things before though. Helpdesk can try your patience at times.

            Ken

            Comment

            • sgreger1
              Member
              • Mar 2009
              • 9451

              #81
              Originally posted by devilock76 View Post
              That is really every language, the power comes from the libraries, you can't run a C program without stdio.h. Visual Basic is nothing without the IDE and libraries that make the Windows API human readable and accessible.

              Just about any modern language has means of dealing with SQL and ODBC. That being said most of your internal corporate stuff is going to be using something .net talking to either MS SQL or in some cases Oracle. But there are so many different things out there.

              The IT industry can be volatile. You really should learn as much as you can. I mean choose a focus but keep in mind the big picture. I am a programmer mostly, but I do some system administration as well. It is better to be a swiss army knife in this industry as opposed to an exacto blade. The money, well the money seems to be in Project Management, although I wouldn't really call that IT most days.

              You will be trapped in a cubicle as well mostly. Although sometimes there are more telecommute options. You will look at numbers and code all the time and being on a computer might become less fun overall. You will also have to learn as a programmer to be incredibly creative translating the wants of the user into meaningful software requirements.

              I never really started at help desk, my first job in IT was actually as a tutor, teaching programming, and doing some lab tech duties on the side. I have filled in at the helpdesk side of things before though. Helpdesk can try your patience at times.

              Ken

              That is what I heard too, be a swiss army knife. That is perfect because this was my plan. Our computert scientist IT guy who runs the show at ym corporation is the one who has been pushing me to get into IT, and he said pretty much the same thing, that in this industry work will come from many different places and there are no solid requirements/pre-requisites for the job, therefore you have to just be certified/knowledgeable in as much stuff as possible.



              From someone more experienced, tell me if my plan sounds in an way realistic or doable.


              *Learning programming etc as a hobby for about a year.
              * Taking some A+ certifications, Net+ certifications as well.
              *Apply for help desk job
              *Network with IT dept once I get signed on and then figure out what the right direction to go from there is.


              I know the helpdesk can be oh so annoying, I pretty much am the helpdesk for my whole dept (since our actual help desk sucks) and it seem like 90% fo people's problems are something a computer savvy 16 year old could figure out. But for me it is just a jumping off point, a way of getting into something that will sound like an IT job on my resume. Hell if that doesn't work I will go work for the geek squad at best buy until I can get some more experience under my belt.


              I know it's hard in the IT industry because all of the 80's and 90's babies decided to get into computers and so now everything is saturated, but it is just my dream to do it so I figure I can't do worse than my current job which has NO possibility of advancement at any point in the future. I don't mind the cubicle, in fact I like it sometimes, it's just want to transition into a fiel that may allow for me to make mroe money at some point in the future, because right now I am at my absolute ceiling.


              So do you think this is possible? If I read/learn/practice constantly, gather small certifications over the next year, take a few college courses, and after 1-2 years maybe be able to land a helpdesk job or something ANYWHERE in the IT industry? I just want to get in somehow, I can scratch my way up from there.

              Comment

              • devilock76
                Member
                • Aug 2010
                • 1737

                #82
                Originally posted by sgreger1 View Post
                That is what I heard too, be a swiss army knife. That is perfect because this was my plan. Our computert scientist IT guy who runs the show at ym corporation is the one who has been pushing me to get into IT, and he said pretty much the same thing, that in this industry work will come from many different places and there are no solid requirements/pre-requisites for the job, therefore you have to just be certified/knowledgeable in as much stuff as possible.



                From someone more experienced, tell me if my plan sounds in an way realistic or doable.


                *Learning programming etc as a hobby for about a year.
                * Taking some A+ certifications, Net+ certifications as well.
                *Apply for help desk job
                *Network with IT dept once I get signed on and then figure out what the right direction to go from there is.


                I know the helpdesk can be oh so annoying, I pretty much am the helpdesk for my whole dept (since our actual help desk sucks) and it seem like 90% fo people's problems are something a computer savvy 16 year old could figure out. But for me it is just a jumping off point, a way of getting into something that will sound like an IT job on my resume. Hell if that doesn't work I will go work for the geek squad at best buy until I can get some more experience under my belt.


                I know it's hard in the IT industry because all of the 80's and 90's babies decided to get into computers and so now everything is saturated, but it is just my dream to do it so I figure I can't do worse than my current job which has NO possibility of advancement at any point in the future. I don't mind the cubicle, in fact I like it sometimes, it's just want to transition into a fiel that may allow for me to make mroe money at some point in the future, because right now I am at my absolute ceiling.


                So do you think this is possible? If I read/learn/practice constantly, gather small certifications over the next year, take a few college courses, and after 1-2 years maybe be able to land a helpdesk job or something ANYWHERE in the IT industry? I just want to get in somehow, I can scratch my way up from there.
                Anything is possible. You will have to really enjoy it to weather the process. As much as I gripe about the industry I am in at times I cannot deny it is more than just my job that keeps me on a computer so much.

                I would also say it wouldn't hurt to get more into web design. It is something you could always pick up side work doing.

                Ken

                Comment

                • ratcheer
                  Member
                  • Jul 2010
                  • 621

                  #83
                  For learning databases, I would suggest MySQL. It would also be commercially useful. Later on, you should probably learn Oracle.

                  Tim

                  Comment

                  • sgreger1
                    Member
                    • Mar 2009
                    • 9451

                    #84
                    So I am pushing along pretty nicely with learning Python. I am trying to install Pyro (Pyrobotics) a robotics simulator where you can program brains for simulated robots in python.

                    I cannot understand the installation instructions though. I have read everything on the internet and cannot find any answers about what I am doing wrong. Has anyone else ever installed something like this?

                    My problem is telling the interpreter how to open the file. Lets say there is a file in a folder that I want to run in the interpreter. So how would I go about putting the directory in the interpreter? I can't get this file to run but running it is the only thing standing between me and my plans of toying with robots all day.

                    If anyone knows how to tell the python interpreter to open a file than that would be awesome. I am new to macs so not sure how their directory system works, but assuming it's like windows than the file I want is in /applications/Python 2.6/pyrobot/Makefile

                    Comment

                    • sgreger1
                      Member
                      • Mar 2009
                      • 9451

                      #85
                      Hey maybe one of you wizzes can help explain how to output my range of integers to a .txt file.

                      This gives me a range of integers, each iteration basically counts from 0 to 1,000 in multiples of 8 and prints it to the screen.

                      Code:
                      for i in range(0,1000, 8):
                          print i
                      So what I am trying to do is output all of those numbers, exactly as they print on the screen, to a .txt file, so that when I am done executing the script it will provide me with a text file that includes all of the number from 0 to 1,000 in multiples of 8.

                      The only kind of output code I could find is this one which opens a .txt file and writes the output to said .txt file.

                      Code:
                      a = open('python_output.txt','w')
                      a.write(i)
                      a.close()
                      The problem, it only prints the last number in the series to the text file as opposed to all of the numbers from 0 to 1,000 like I want it to. It prints 992 (the last number in the series), but none of the numbers prior to that. What I would like help with is figuring out how to write the output, ALL OF IT, to a text file. So that if I tell the script to count from 1 to 50 it will write all of those numbers to a text file as opposed to just the last number in the series like it is doing now.

                      Can anyone help me fix this? Is there some function that I am unaware of that will pretty much print whatever output (be it a math problem, a list of names etc) to a text file?

                      Comment

                      • sgreger1
                        Member
                        • Mar 2009
                        • 9451

                        #86
                        Originally posted by danielan View Post
                        Code:
                        a = open('python_output.txt','w')
                        for i in range(0,1000, 8):
                            a.write(str(i))
                        a.close()

                        Thank You! So pretty much my error was in the ordering of events, that makes sense. If anyone knows any links to good tutorials that could help me on the next step of my project feel free to post em! *wink wink* Here is what I am trying to learn about:

                        Need to write a script that will open a .txt document and scan it for certain items which I specify, then report back to me with what it found. For example, it would open a text document and find every 50th letter, then every 75th letter etc and once it's picked them all out it will display them for me together in a single snetence. I am trying to make a basic secret code writing script that comes in 2 parts. The first part uses the range function to create a text document that is filled with numbers(like range (0, 1000, 8). It would prompt the user asking what secret message you wanted to hide in the text file filled with numbers, and then take that secret message and print it at certain intervals throughout the .txt file. Example: if my secret code is "Sgreger1", it would print 1 letter of my username after every 50 numbers , so it would print 50 numbers, then "s," then 50 numbers than "g" etc etc.

                        The second program would open up the text file, know where to look (every 50'th number for example) and retrieve whatever letter is occupying that space, then after it picked out all the letters of my username that I have hidden, it displays them back to me as "sgreger1". So essentially one file encrypts the information by hiding it amongst a vast amount of numbers and then the other file decrypts it by picking the right letters back out from it.

                        Pretty simple and not in any way real encryption, but it is my first "real program" idea that is within the range of my capabilities, keep in mind I have only been learning python via books and such for the past week or two in my spare time so this simple program that writes and then retrieves data from a text file is pretty advanced for me so don't laugh.


                        Anyways, I know there are functions and extensions to python that are good at reading text documents and picking info out of them, if anyone knows of a link to a place where I could find such things it would be greatly appreciated.

                        Comment

                        • devilock76
                          Member
                          • Aug 2010
                          • 1737

                          #87
                          Originally posted by sgreger1 View Post
                          Thank You! So pretty much my error was in the ordering of events, that makes sense. If anyone knows any links to good tutorials that could help me on the next step of my project feel free to post em! *wink wink* Here is what I am trying to learn about:

                          Need to write a script that will open a .txt document and scan it for certain items which I specify, then report back to me with what it found. For example, it would open a text document and find every 50th letter, then every 75th letter etc and once it's picked them all out it will display them for me together in a single snetence. I am trying to make a basic secret code writing script that comes in 2 parts. The first part uses the range function to create a text document that is filled with numbers(like range (0, 1000, 8). It would prompt the user asking what secret message you wanted to hide in the text file filled with numbers, and then take that secret message and print it at certain intervals throughout the .txt file. Example: if my secret code is "Sgreger1", it would print 1 letter of my username after every 50 numbers , so it would print 50 numbers, then "s," then 50 numbers than "g" etc etc.

                          The second program would open up the text file, know where to look (every 50'th number for example) and retrieve whatever letter is occupying that space, then after it picked out all the letters of my username that I have hidden, it displays them back to me as "sgreger1". So essentially one file encrypts the information by hiding it amongst a vast amount of numbers and then the other file decrypts it by picking the right letters back out from it.

                          Pretty simple and not in any way real encryption, but it is my first "real program" idea that is within the range of my capabilities, keep in mind I have only been learning python via books and such for the past week or two in my spare time so this simple program that writes and then retrieves data from a text file is pretty advanced for me so don't laugh.


                          Anyways, I know there are functions and extensions to python that are good at reading text documents and picking info out of them, if anyone knows of a link to a place where I could find such things it would be greatly appreciated.
                          I appreciate this as an academic study but there is a point of right tool for the right job. First of all several things you are trying to do can be done quickly and easy in existing *nix tools (grep, awk, sed) the last 2 can be a study all to themselves. On OS X you should have all of those available. Next off, because python script is delivered as human readable it makes it simple for any programmer to reverse engineer your code for the encryption routine so it would not be the language of choice for that.

                          I appreciate though that you are looking to do text manipulation as an exercise so have at it. When you are done with that you can try some other methods. One of the first basic encryption programs I ever made was based on using the one's compliment of the ascii byte code.

                          Ken

                          Comment

                          • devilock76
                            Member
                            • Aug 2010
                            • 1737

                            #88
                            Originally posted by danielan View Post
                            I know the new approaches to learning programming seem to be to jump right in and start coding, but, IMO, you'd be well off to start with designing.

                            We "programmed" on paper for months before we got to touch a computer - and then we started with assembly language. After 20 years, I think this approach was very good, probably for 2 reasons: 1. You learn that design is really much more important then code, and 2. You learn that _nothing_ "magic" ever happens inside a computer.

                            Programming is like working with children.

                            You can't tell a 2 year old to "get dressed". At least not until you first teach them all of the little steps that we take for granted in this process. Programming requires understanding both levels of instructions in a similar manner and the ability to break down a task into discrete steps. Incidently, you'll find this process is quite useful in areas that go way beyond programming - i.e., cooking, auto mechanics, engineering, etc.

                            When I teach kids programming, we do an exercise where one of the students is a robot and the other students need to give the robot directions to perform a task (turn 45 degrees, take 2 steps, etc). I think it is helpful to (at least mentally) do an exercise like this to understand the level of detail needed.

                            So, I would tend to avoid the extensions and external libraries right now and focus on learning the basic programming constructs. Off hand, this (googled) looks good: http://learnpythonthehardway.com/index

                            I think the project you have selected is probably about right for you. So, the next step for you, IMO, is to start thinking in great detail about all of the little steps that you require to perform this process. For example:

                            open the file
                            start a loop from 0 to 1000 counting by 1
                            write my number to the file (this is the part that happens over and over in the loop)
                            end the loop
                            close the file
                            Back then you used punch cards so that was even more relevant. I totally understand the learn to design approach though and if more people did that we might have better code at more levels. A nice thing about Python as a prototype language is its syntax can almost look like pseudo code.

                            Ken

                            Comment

                            • sgreger1
                              Member
                              • Mar 2009
                              • 9451

                              #89
                              Originally posted by danielan View Post
                              I know the new approaches to learning programming seem to be to jump right in and start coding, but, IMO, you'd be well off to start with designing.

                              We "programmed" on paper for months before we got to touch a computer - and then we started with assembly language. After 20 years, I think this approach was very good, probably for 2 reasons: 1. You learn that design is really much more important then code, and 2. You learn that _nothing_ "magic" ever happens inside a computer.

                              Programming is like working with children.

                              You can't tell a 2 year old to "get dressed". At least not until you first teach them all of the little steps that we take for granted in this process. Programming requires understanding both levels of instructions in a similar manner and the ability to break down a task into discrete steps. Incidently, you'll find this process is quite useful in areas that go way beyond programming - i.e., cooking, auto mechanics, engineering, etc.

                              When I teach kids programming, we do an exercise where one of the students is a robot and the other students need to give the robot directions to perform a task (turn 45 degrees, take 2 steps, etc). I think it is helpful to (at least mentally) do an exercise like this to understand the level of detail needed.

                              So, I would tend to avoid the extensions and external libraries right now and focus on learning the basic programming constructs. Off hand, this (googled) looks good: http://learnpythonthehardway.com/index

                              I think the project you have selected is probably about right for you. So, the next step for you, IMO, is to start thinking in great detail about all of the little steps that you require to perform this process. For example:

                              open the file
                              start a loop from 0 to 1000 counting by 1
                              write my number to the file (this is the part that happens over and over in the loop)
                              end the loop
                              close the file


                              I understand what you mean entirely, and that is exactly how I would prefer to learn. I don't have a class or anything pointing me in the right direction so I am pretty much just going through tutorials in books and learning things piece by piece. The design aspect, being the most important part in an object oriented (or any) programming language, is the part I am most interested in learning because it is clear to me that writing the code should be much easier once I understand how to properly lay out the design of the program, having a plan before I type any actual code. But unfortunately the book(s) I am reading all seem to just go over the basics and don't really deal with design at all. One of the books, "How to think like a computer scientistython", seems to cover a bit more of the design aspect, so I am reading a lot more of that one now that I have the basics down.

                              It's just so hard because I keep getting stopped up on something stupid like finding what directory to put my modules in so that I may call on them from within the interpreter, or some small syntax issue or something.


                              Anyways, I understand that in formal training you would read and learn the foundation before you "jump in" to the actual programming, just like you have to learn how to shoot artillery before they actually let you touch the gun . This would be ideal but without a course for me to complete I am kind of stuck with tutorials and books now, which seem mainly to benefit me the most if I type everything out and try debugging things myself without consulting the book.



                              "So, I would tend to avoid the extensions and external libraries right now and focus on learning the basic programming constructs. "
                              Yah, my success with playing with extensions and libraries and SWIG and everything else has been minimal since I don't get even the most basic of concepts like what directories to put stuff in. But the problem is that some tutorials will require that I use extensions and go download them before I can use them in my script, yet provides no instructions on how to download them or where to put them, only how to call on them once they are in the right place.



                              I am a long way away from being able to code anything useful, and right now am mainly concerned with just trying to figure out the proper way to order events and stuff. Like I am drawing myself little story boards that outline the series of events and what order they should take place in.

                              The reason I chose this simple encryption thing was because it seemed like a good exercise in input/output and I tend to learn by practice so figure I will have to learn the steps along the way.

                              Comment

                              • sgreger1
                                Member
                                • Mar 2009
                                • 9451

                                #90
                                Originally posted by devilock76 View Post
                                I appreciate this as an academic study but there is a point of right tool for the right job. First of all several things you are trying to do can be done quickly and easy in existing *nix tools (grep, awk, sed) the last 2 can be a study all to themselves. On OS X you should have all of those available. Next off, because python script is delivered as human readable it makes it simple for any programmer to reverse engineer your code for the encryption routine so it would not be the language of choice for that.

                                I appreciate though that you are looking to do text manipulation as an exercise so have at it. When you are done with that you can try some other methods. One of the first basic encryption programs I ever made was based on using the one's compliment of the ascii byte code.

                                Ken

                                Cool! I am still not familiar with what tools come pre-installed to be honest, I am sure a lot of things could be simplified once I learned about more of the functions available to me. My little project is of course not in any way secure at all, especially since it's written in simple python which could be back engineered as quickly as I can read english, but it is just more of an exercise in learning how to do input/output. I am learning how to use GUI's to prompt the user for the info and then using ranges of numbers to create the massive amounts of characters I need in the text file, now I just need to know how to get it to take my message and print it out at various intervals throughout the text file (like 1 letter prints every 50 characters for example).



                                Anyways, how does one know that tools such as grep, awk, sed exist and how does one learn to use them? I see brief explanations of functions but no explanation of what they really do or how to make them do it. Is there any kind of reference manual that just shows all the different tools available to you and what they do plus a few examples of what using them may look like? I know Orielly makes reference books but have yet to look at any. Python is really cool because these little modules save a shit load of time I would imagine it's like once you know what is available all you have to do is become skillful in piecing it together the right way.

                                Comment

                                Related Topics

                                Collapse

                                Working...
                                X