Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Terry Carroll
On Fri, 5 Nov 2010, Terry Carroll wrote: Aha, this looks like it will work; I was starting to think along these lines; I was thinking of reading the output of df, but this is cleaner. Just to close this out, here's what's working for me. It will need to be prettied up, and the "/media/" para

Re: [Tutor] test

2010-11-05 Thread David
On 6 November 2010 16:20, Steven D'Aprano wrote: > Luke Paireepinart wrote: >> >> You don't get your own e-mails back. > > I do. > > Perhaps it's an option when you sign up? For any list (like this one) hosted by mailman, the default is set by list administrator, but every user can customise this

Re: [Tutor] Programs for Newbies?

2010-11-05 Thread Steven D'Aprano
Danyelle Davis wrote: Hi all, Any suggestions for a newbie to program while learning python? I am new to programming and python. Here's a few suggestions: Write a program that asks the user to enter a word, then counts how many vowels and consonants are in the word. Write a program that

Re: [Tutor] Programs for Newbies?

2010-11-05 Thread Steven D'Aprano
Danyelle Davis wrote: Hi all, Any suggestions for a newbie to program while learning python? I am new to programming and python. What are you interested in? Interested in maths? Write a program to generate prime numbers, or to search for amicable numbers. Look at Project Euler, although (i

Re: [Tutor] test

2010-11-05 Thread Steven D'Aprano
Luke Paireepinart wrote: You don't get your own e-mails back. I do. Perhaps it's an option when you sign up? -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/

[Tutor] Displaying Pictures & Text

2010-11-05 Thread Patty
Hi Alan - I tried using ImageTk from the PIL library to display jpegs (and hopefully any picture type) instead of just gif as you suggested below. I read online that these these types of programs should be run from executables not in the interpreter but it crashes and I can't read the error

Re: [Tutor] test

2010-11-05 Thread Luke Paireepinart
You don't get your own e-mails back. On Fri, Nov 5, 2010 at 11:37 PM, Danyelle Davis wrote: > im wondering if im able to mail this list.  I sent an email asking for good > newbie projects but never saw it post.  All i got was the welcome/ info > email. > LN > _

[Tutor] test

2010-11-05 Thread Danyelle Davis
im wondering if im able to mail this list. I sent an email asking for good newbie projects but never saw it post. All i got was the welcome/ info email. LN ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://ma

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Carlos Daniel Ruvalcaba Valenzuela
This is more of a Linux question, but here is some advice: All files under /dev are more or less raw representations of the devices, meaning that /dev/cdrom or /dev/sr0 files represent the CDROM devices, however this is for raw access to the device data, now really for normal use, the sistem may "

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Terry Carroll
On Sat, 6 Nov 2010, Steven D'Aprano wrote: Terry Carroll wrote: I have a program that traverses the directory of a CDROM using os.walk. I do most of my work on Windows, but some on (Ubuntu) Linux, and I'd like this to work in both environments. On Windows, I do something along the lines of t

[Tutor] Programs for Newbies?

2010-11-05 Thread Danyelle Davis
Hi all, Any suggestions for a newbie to program while learning python? I am new to programming and python. Thanks, LN ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-05 Thread Walter Prins
One final suggestion to add to the others: Install and use both pylint, and pychecker. That will help ensure you don't make silly errors or omissions and follow a consistent coding style that matches the generally accepted format well. PyLint: http://pypi.python.org/pypi/pylint PyChecker: http://

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Steven D'Aprano
Steven D'Aprano wrote: But if you might have an external hard drive plugged in, or a USB key, or similar, then you need to find out what the volume name of the mounted CD drive is. That's a good question and I don't have an answer right now. Let me think about it and get back to you. Well th

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Steven D'Aprano
Terry Carroll wrote: I have a program that traverses the directory of a CDROM using os.walk. I do most of my work on Windows, but some on (Ubuntu) Linux, and I'd like this to work in both environments. On Windows, I do something along the lines of this: startpoint="D:/" What if the user h

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Terry Carroll
On Sat, 6 Nov 2010, Steven D'Aprano wrote: Anyway, more modern Linux systems automatically mount CDs and DVDs. By convention, /mnt/... is used for manually mounts, and /media/... for automatic mounts of media. I am seeing my volume in /media ; however, I won't know the volume name when my pr

[Tutor] Hi

2010-11-05 Thread Luke Pettit
Hi everyone, I'm just about to begin to learn python and have bookmarked a number of sites to learn from http://www.alan-g.me.uk/ is the main one but after reading this ""On Nov 4, 2010, at 3:10 PM, Glen Clark wrote: Hello, I have completed my first python script. This is after watching a video

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Steven D'Aprano
Alan Gauld wrote: I don't use Ubuntu so don;t know the standard anmswer there but it will depend on where the CD is mounterd. I usually mount cdroms on /dev/cdrom Surely that's where you mount cdroms *from*? I can't think that using /dev/cdrom as the mount point would be a good idea! Anyw

[Tutor] Reading the CDROM in Linux

2010-11-05 Thread Terry Carroll
Alan Gauld wrote: I don't use Ubuntu so don;t know the standard anmswer there but it will depend on where the CD is mounterd. I usually mount cdroms on /dev/cdrom That's what I figured; I now realize I didn't say so in my email, but it's mounted at /dev/sr0, which is where I came up with tha

Re: [Tutor] Displaying picture and Text & Downloads

2010-11-05 Thread Alan Gauld
"Patty" wrote I had a followup question for you all - and would like to know the answer to Alan's question about print quality - below - A Google search led me to this page which seems to offer a solution using PIL anmd a module called ImageTk: http://codeidol.com/python/python3/A-Tkinter-

Re: [Tutor] Reading the CDROM in Linux

2010-11-05 Thread Alan Gauld
"Terry Carroll" wrote On Windows, I do something along the lines of this: startpoint="D:/" for (root, dirs, files) in os.walk(startpoint): (stuff) What would I use for startpoint in Linux? I don't use Ubuntu so don;t know the standard anmswer there but it will depend on where t

Re: [Tutor] Server

2010-11-05 Thread Alan Gauld
"Chris King" wrote If you are using Windows, turn off the built-in firewall. That's what fixed my problems. ~Corey also, it is on the same network, so the server shouldn't be a problem I think Corey means the firewall on your PC if you have one. It could be blocking outgoing traffic to u

[Tutor] Reading the CDROM in Linux

2010-11-05 Thread Terry Carroll
I have a program that traverses the directory of a CDROM using os.walk. I do most of my work on Windows, but some on (Ubuntu) Linux, and I'd like this to work in both environments. On Windows, I do something along the lines of this: startpoint="D:/" for (root, dirs, files) in os.walk(start

Re: [Tutor] Server

2010-11-05 Thread Corey Richardson
On 11/5/2010 3:18 PM, Chris King wrote: On 11/4/2010 9:46 PM, Corey Richardson wrote: On 11/4/2010 8:43 PM, Chris King wrote: Dear Tutors, May server and client programs aren't working. They basically simplify socket and SocketServer. Run them directly to test them. They do work loc

[Tutor] Displaying picture and Text & Downloads

2010-11-05 Thread Patty
I just realized I did the same thing - must have hit reply to one instead of reply to all :} I had a followup question for you all - and would like to know the answer to Alan's question about print quality - below - Patty - Original Message - From: "Patty" To: "Alan Gauld" Sent:

Re: [Tutor] Server

2010-11-05 Thread Chris King
On 11/4/2010 9:46 PM, Corey Richardson wrote: On 11/4/2010 8:43 PM, Chris King wrote: Dear Tutors, May server and client programs aren't working. They basically simplify socket and SocketServer. Run them directly to test them. They do work locally. They don't work from one computer to

Re: [Tutor] querying the name of a calling python file

2010-11-05 Thread Alan Gauld
"Garry Willgoose" wrote For a while now I have been using the command below in a python file to determine the name of the python file that I use to launch an application sys.modules['__main__'].__dict__['__file__'] The usual way to do that would be via sys.argv[0] Is there any reason why

Re: [Tutor] Looking for a tutor to review my code and provideconstructive feedback.

2010-11-05 Thread Alan Gauld
"Glen Clark" wrote Really useful feedback, I will note the points highlighted for my next mini-project. I feel it is important that I am writing proper code before moving onto learning modules and such. I wouldn't sweat over it. Modules are at the heart of Python and restricting yourself t

Re: [Tutor] Looking for a tutor to review my code and provide constructive feedback.

2010-11-05 Thread Glen Clark
Thank you very much for the feedback Luke. I have taken it onboard. I especially like the .lower().strip()[0] method ^^ Regards, G On 4 November 2010 22:38, Luke Paireepinart wrote: > Also for your confirm entries read about sentinel values for while loops. > It saves you repeating the conditio

Re: [Tutor] Looking for a tutor to review my code and provideconstructive feedback.

2010-11-05 Thread Glen Clark
*#Your code is very readable...more so than some experienced people ;^)* Thank you, that is very motivating that I am at least on the right track! #A few suggestions (and assuming Python 3.X, since that's what it looks like): Yeah it is 3.1, forgot to mention that. # * "list" shadows a built-in

Re: [Tutor] querying the name of a calling python file

2010-11-05 Thread शंतनू
On 05-Nov-2010, at 4:45 PM, Garry Willgoose wrote: > For a while now I have been using the command below in a python file to > determine the name of the python file that I use to launch an application > (i.e.IF I go 'python junk.py' I want to get 'junk.py'). The command I have > use that I cam

[Tutor] querying the name of a calling python file

2010-11-05 Thread Garry Willgoose
For a while now I have been using the command below in a python file to determine the name of the python file that I use to launch an application (i.e.IF I go 'python junk.py' I want to get 'junk.py'). The command I have use that I came across somewhere some time ago was sys.modules['__main__']

Re: [Tutor] argparse: how to use the returned Namespace object?

2010-11-05 Thread Mac Ryan
On Fri, 2010-11-05 at 01:11 +, Walter Prins wrote: > You need to distinguish between what __dict__ *is*, and what it > *contains*. dir() does introspection, it inspects what an object in > Python *is*, e.g. displays all the methods and attributes of the > object. It does not however know anyt

[Tutor] Fw: rights

2010-11-05 Thread ALAN GAULD
fowarding to group, please use reply-all when replying. Alan Gauld Author of the Learn To Program website http://www.alan-g.me.uk/ - Forwarded Message > From: Chris King > To: Alan Gauld > Sent: Friday, 5 November, 2010 0:48:51 > Subject: Re: [Tutor] rights > > On 11/1/2010 8:43

Re: [Tutor] Looking for a tutor to review my code and provideconstructive feedback.

2010-11-05 Thread Mark Tolonen
"Glen Clark" wrote in message news:aanlktimabbj8ae35q3ao9+xzbvtnyzbz3wrudahmn...@mail.gmail.com... Hello, I have completed my first python script. This is after watching a video guide on python and is my first attempt at writing code in python. While the code is not very useful I got the ide