473,397 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Can I learn Python on this forum

bartonc
6,596 Expert 4TB
well could and would you help me out on how to get started and what I need to do? Basically can you help me write a program that will extract all images from the digital camera once it is hooked up into the USB port of my computer not the USB hub?
How much python do you know at this point?
Dec 23 '06 #1
13 1194
How much python do you know at this point?

just started learning it, =] hehehe I know I'm pathetic, but I'm learning, I'm taking a computer programming class this year, but we are just now starting on Java and python at the end of the year, but from what i've heard Python is the best to use when programming....so I thought I'd try it out, I'm reading how to program in python as we speak, but could you still help me on how to get started?
Dec 23 '06 #2
bartonc
6,596 Expert 4TB
just started learning it, =] hehehe I know I'm pathetic, but I'm learning, I'm taking a computer programming class this year, but we are just now starting on Java and python at the end of the year, but from what i've heard Python is the best to use when programming....so I thought I'd try it out, I'm reading how to program in python as we speak, but could you still help me on how to get started?
Yeah, we'll help you get started. Just not started talking to hardware. Python is by far the easiest way to program your computer, but there are many things you need to know in order to write a program that talks to many systems (files, display, USB, etc.). Once you can read and write files and do work on those (copy a file from one directory to another would be a good exercise) and then do it with a file dialog box, and so on. Do you see where I'm going with all this?
Dec 23 '06 #3
Yeah, we'll help you get started. Just not started talking to hardware. Python is by far the easiest way to program your computer, but there are many things you need to know in order to write a program that talks to many systems (files, display, USB, etc.). Once you can read and write files and do work on those (copy a file from one directory to another would be a good exercise) and then do it with a file dialog box, and so on. Do you see where I'm going with all this?

Yes I do could you help me get started on how to do it? like the exercise that you told me? Right now I am reading this http://swaroopch.info/text/Byte_of_Python:Control_Flow It seems to be pretty good so far. Is this any good?
Dec 23 '06 #4
bartonc
6,596 Expert 4TB
Yes I do could you help me get started on how to do it? like the exercise that you told me? Right now I am reading this http://swaroopch.info/text/Byte_of_Python:Control_Flow It seems to be pretty good so far. Is this any good?
Yep. That looks like a good starting place.
Dec 23 '06 #5
Yep. That looks like a good starting place.
ok can you help me out

so I am in the process of baking up a file using python, but it never works here it is:
Expand|Select|Wrap|Line Numbers
  1. import os, time
  2.  
  3. # 1. The files and directories to be backed up are specified in a list.
  4. source = [r'I:\']
  5. # If you are using Windows, use source = [r'C:\Documents', r'D:\Work'] or something like that
  6.  
  7. # 2. The backup must be stored in a main backup directory.
  8. target_directory = 'C:\\'
  9.  
  10. # 3. The files are backed up into a zip file.
  11. # 4. The name of the zip archive is the current date and time
  12. target = target_directory + time.strftime('%Y%m%d_%H%M%S') + '.zip'
  13.  
  14. # 5. We use the standard ``zip`` command to put the files in a zip archive
  15. zip_command = "zip -qr '%s' %s" % (target, ' '.join(source))
  16. print zip_command
  17.  
  18. # Run the backup
  19. if os.system(zip_command) == 0:
  20.     print 'Successful backup to', target
  21. else:
  22.     print 'Backup FAILED'
and I don't see why it doesn't work, it comes back Backup failed..but why?
Dec 23 '06 #6
bartonc
6,596 Expert 4TB
ok can you help me out

so I am in the process of baking up a file using python, but it never works here it is:
Expand|Select|Wrap|Line Numbers
  1. import os, time
  2.  
  3. # 1. The files and directories to be backed up are specified in a list.
  4. source = [r'I:\']
  5. # If you are using Windows, use source = [r'C:\Documents', r'D:\Work'] or something like that
  6.  
  7. # 2. The backup must be stored in a main backup directory.
  8. target_directory = 'C:\\'
  9.  
  10. # 3. The files are backed up into a zip file.
  11. # 4. The name of the zip archive is the current date and time
  12. target = target_directory + time.strftime('%Y%m%d_%H%M%S') + '.zip'
  13.  
  14. # 5. We use the standard ``zip`` command to put the files in a zip archive
  15. zip_command = "zip -qr '%s' %s" % (target, ' '.join(source))
  16. print zip_command
  17.  
  18. # Run the backup
  19. if os.system(zip_command) == 0:
  20.     print 'Successful backup to', target
  21. else:
  22.     print 'Backup FAILED'
and I don't see why it doesn't work, it comes back Backup failed..but why?
Is it really your intention to zip the entire I drive contents????
You should really start smaller like we have already discussed.

This script calls your system cmd.exe so you are already complicating things.

You need two things on you system for this to work. 1) an "I" drive, and 2) zip installed on the system PATH. If you don't know how to run zip from the command line, you are starting of with too many unknowns. If you can run zip from the command line, try to do the zip by hand. That will tell you if that part is working. If it is, then we can work on your script.
Think "baby steps". You tend to jump into the deep end a lot.
Dec 23 '06 #7
Is it really your intention to zip the entire I drive contents????
You should really start smaller like we have already discussed.

This script calls your system cmd.exe so you are already complicating things.

You need two things on you system for this to work. 1) an "I" drive, and 2) zip installed on the system PATH. If you don't know how to run zip from the command line, you are starting of with too many unknowns. If you can run zip from the command line, try to do the zip by hand. That will tell you if that part is working. If it is then we can work on your script.
Think "baby steps". You tend to jump into the deep end a lot.
ok so wait lets say I take the zip thing out, now the I drive is my flash drive that is plugged in and it only has like 3 files on it right now which are small, but what I am trying to do is back the SD folder on my I drive up to the C drive in a folder called drivers.... so my code now is


import os, time

# 1. The files and directories to be backed up are specified in a list.
source = [r'I:\SD']
# If you are using Windows, use source = [r'C:\Documents', r'D:\Work'] or something like that

# 2. The backup must be stored in a main backup directory.
target_directory = r'C:\Drivers'

and it still doesn't work, what am I doing wrong, do you have AIM or something so I can communicate with you easier?
Dec 23 '06 #8
bartonc
6,596 Expert 4TB
ok so wait lets say I take the zip thing out, now the I drive is my flash drive that is plugged in and it only has like 3 files on it right now which are small, but what I am trying to do is back the SD folder on my I drive up to the C drive in a folder called drivers.... so my code now is


import os, time

# 1. The files and directories to be backed up are specified in a list.
source = [r'I:\SD']
# If you are using Windows, use source = [r'C:\Documents', r'D:\Work'] or something like that

# 2. The backup must be stored in a main backup directory.
target_directory = r'C:\Drivers'

and it still doesn't work, what am I doing wrong, do you have AIM or something so I can communicate with you easier?
I think that you are still aiming a little too high, for now. In order to work with path names, you'll need to have good string manipulation skills. This is very basic and easy to learn, but path names have many more issues (is it file? is it a folder?, etc.)
In #1 above, there is a list of strings (Ok, only one string in the list) so you need to know how lists work, too.
Pick something fun and interesting and easy to start with. The most common first program is "hello world". I'll start very simple and add to it as we go along. OK?

Expand|Select|Wrap|Line Numbers
  1. # this is a comment. you write notes about what the lines below do
  2. # This program prints "hello world" ten times
  3. # using a for loop over a list of integers
  4. # the list of integers is generated by the built-in function: range()
  5. # blank lines are a really good thing to make your code readable
  6.  
  7. for i in range(10):    # the colon says 'the indented lines below belong to the for
  8.     print "hello world"
  9.  
  10. # In this example, there are 2 built-in operators and 2 built-in functions
  11. # and a string object. Can you pick out the functions from the operators?
Dec 23 '06 #9
I think that you are still aiming a little too high, for now. In order to work with path names, you'll need to have good string manipulation skills. This is very basic and easy to learn, but path names have many more issues (is it file? is it a folder?, etc.)
In #1 above, there is a list of strings (Ok, only one string in the list) so you need to know how lists work, too.
Pick something fun and interesting and easy to start with. The most common first program is "hello world". I'll start very simple and add to it as we go along. OK?

Expand|Select|Wrap|Line Numbers
  1. # this is a comment. you write notes about what the lines below do
  2. # This program prints "hello world" ten times
  3. # using a for loop over a list of integers
  4. # the list of integers is generated by the built-in function: range()
  5. # blank lines are a really good thing to make your code readable
  6.  
  7. for i in range(10):    # the colon says 'the indented lines below belong to the for
  8.     print "hello world"
  9.  
  10. # In this example, there are 2 built-in operators and 2 built-in functions
  11. # and a string object. Can you pick out the functions from the operators?

Yea I already did hello world as the first thing

i= 'hello world'
print i

but yea I'm kind of trying to make a back up a folder and back up files program could you teach me how to do it, because I really don't have much time to learn this stuff I somehow need to get that usb program done..so i was thinking about starting off with backing up files, do you know how its done?
Dec 23 '06 #10
bartonc
6,596 Expert 4TB
Yea I already did hello world as the first thing

i= 'hello world'
print i

but yea I'm kind of trying to make a back up a folder and back up files program could you teach me how to do it, because I really don't have much time to learn this stuff I somehow need to get that usb program done..so i was thinking about starting off with backing up files, do you know how its done?
I will show you when you can answer the question in the last post correctly.
Please slow down a little and try again.
Dec 23 '06 #11
I will show you when you can answer the question in the last post correctly.
Please slow down a little and try again.

I'm sorry about the lack of information, well what I am trying to do is make a backup of a folder and place the backup in another directory. Does that answer the question?
Dec 23 '06 #12
AricC
1,892 Expert 1GB
Python is by far the easiest way to program your computer, but there
Barton do you think so? What editor do you use to create python programs? I'm interested in learning a new language.
Dec 23 '06 #13
bartonc
6,596 Expert 4TB
Barton do you think so? What editor do you use to create python programs? I'm interested in learning a new language.
Yes! Especially if you know C or C++, picking up python is a snap. The syntax is very natural and doesn't have all those parentheses and required semi-colons that always confused me in C. The really cool thing is interactive testing with the interpreter (shell) that lets you type in a line of code and see the results imediately. Dynamic Typing is also very cool. It lets you pass any type of argument to a function. Then the function can do different things based on the type of the argument(s). Many cool features, lots of libraries, great language!
Keep posting,
Barton

PS Get an avatar so that I can see who's posting (dang it).
Dec 23 '06 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

42
by: Bicho Verde | last post by:
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And...
24
by: Charif Lakchiri | last post by:
Okay, here's what I know so far about Python: It's an object-oriented scripting language, supported on many platforms. Now here are my questions: It is easy to learn? Does it support GUI...
0
by: Robert Oschler | last post by:
Hello all, I have set up a forum dedicated to WordNet Developers. I just added a section for Python developers that are using PyWordNet or other Python based WordNet interface modules or code. ...
18
by: Jonas Melian | last post by:
Hi, I'm going to say a suggestion, why don't you create a forum like the one of Ruby (http://www.rubyforums.com/)? for the novices this is a great help, better than a mail list It's also...
1
by: john67 | last post by:
Every time I attempt to look at the Python Business Forum (www.python-in-business.org), I encounter an error that starts like this: Site Error An error was encountered while publishing this...
8
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ;...
5
by: SeNTry | last post by:
Hello, Are there any good active python forums online? Especially any forum that has an uber-noob section!
7
by: fyleow | last post by:
Hi guys, I'm a student/hobbyist programmer interested in creating a web project. It's nothing too complicated, I would like to get data from an RSS feed and store that into a database. I want...
9
by: Katie Tam | last post by:
I am new to this filed and begin to learn this langague. Can you tell me the good books to start with ? Katie Tam Network administrator http://www.linkwaves.com/main.asp...
65
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.