[Tutor] socket question

2005-09-13 Thread ray
When I receive a 4-bytes integer using socket.recv, it is stored in a string. How to convert this string to a integer? Thanks in advance. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Introduction

2012-08-18 Thread Ray
Hello. I am new to the mailing list and to Python. My knowledge of Python comes almost strictly from Nick Parlante's classes on YouTube that I've watched over the last week or so. I'm not certain why I'm diving into Python. My only coding experience has been using Bash scripts on my Ubuntu system

Re: [Tutor] First program

2010-03-12 Thread Ray Parrish
, is not a valid choice'.format(choice)) Traceback (most recent call last): File "", line 1, in AttributeError: 'str' object has no attribute 'format' >>> print('{0}, is not a valid choice'format(choice)) File "", line

Re: [Tutor] First program

2010-03-12 Thread Ray Parrish
+ " square feet" The area of a rectangle is 12 x 10 equals 120 square feet. I find that putting the variables on the end like that, when you're not actually applying any special formatting to them makes it less readable when I'm debugging my stuff

Re: [Tutor] Opening a dos exe

2010-03-13 Thread Ray Parrish
ou call it, then remove it after running it to reduce clutter. Hope this is what you're looking for. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareReport.html Ray's Links, a variety of links to usefull things, and ar

[Tutor] Escaping a single quote mark in a triple quoted string.

2010-03-13 Thread Ray Parrish
Hello, I am getting the following - >>> String = """http://www.rayslinks.com";>Ray's Links""" >>> String 'http://www.rayslinks.com";>Ray\'s Links' Note the magically appearing back slash in my result string

Re: [Tutor] Opening a dos exe

2010-03-13 Thread Ray Parrish
Alan Gauld wrote: "Ray Parrish" wrote but I cannot find a way of getting this information to the dos program from python. Any ideas? You could use os.system("startprogram.bat"), and create startprogram.bat to run the dos program, and feed it the files, either all at onc

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Steven D'Aprano wrote: On Sat, 13 Mar 2010 01:04:42 pm Ray Parrish wrote: print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Hello, Isn't it a little more understandable to use a construct like the following?

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Alan Gauld wrote: "Ray Parrish" wrote print "A %s with dimensions %sx%s has an area of %s." % (choice, height, width, width*height) Isn't it a little more understandable to use a construct like the following? print "The area of a " + Choice + &quo

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Luke Paireepinart wrote: On Sat, Mar 13, 2010 at 3:03 AM, Alan Gauld <mailto:alan.ga...@btinternet.com>> wrote: "Ray Parrish" mailto:c...@cmc.net>> wrote print "A %s with dimensions %sx%s has an area of %s." % (

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Luke Paireepinart wrote: Ray, please reply on-list in the future in case someone else has input. On Fri, Mar 12, 2010 at 8:01 PM, Ray Parrish <mailto:c...@cmc.net>> wrote: Luke Paireepinart wrote: print "A %s with dimensions %sx%s has an area of %s." %

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Andre Engels wrote: On Sat, Mar 13, 2010 at 3:11 AM, Ray Parrish wrote: Andre Engels wrote: On 3/12/10, yd wrote: else: raise Exception('{0}, is not a valid choice'.format(choice)) This will cause the program to stop-with-error if something wrong is

Re: [Tutor] Escaping a single quote mark in a triple quoted string.

2010-03-13 Thread Ray Parrish
Sander Sweers wrote: On 13 March 2010 18:33, Ray Parrish wrote: Hello, I am getting the following - String = """http://www.rayslinks.com";>Ray's Links""" String 'http://www.rayslinks.com";>Ray\'s Links&

Re: [Tutor] First program

2010-03-13 Thread Ray Parrish
Ken G. wrote: I am using Ubuntu 9.04 and I have versions 2.6.2 and 3.0.1+ installed. Look for IDLE in Add/Remove Applications. Perhaps, you may have a different version of Ubuntu. Ken Ray Parrish wrote: Yes, I'm using 2.45.2 as that is the highest version available in the U

Re: [Tutor] Escaping a single quote mark in a triple quoted string.

2010-03-13 Thread Ray Parrish
Steven D'Aprano wrote: On Sun, 14 Mar 2010 04:33:57 am Ray Parrish wrote: Hello, I am getting the following - >>> String = """http://www.rayslinks.com";>Ray's Links""" >>> String 'http://www.rayslinks.com"

[Tutor] Declaring a compound dictionary structure.

2010-03-13 Thread Ray Parrish
dress indexed server log lines which can then be iterated over to extract daily visit counts, and other extractable data sorted by date, and visitor. The need would not arise if the log files did not contain two dates each, but my service provider rotates their server logs around 2 am, so I

[Tutor] KeyError: '61.135.168.82' with dictionary.

2010-03-25 Thread Ray Parrish
# for each unique ip address. date = columns[0] dates[date][thisIPAddress].append(eachLine) Error messages follow - Traceback (most recent call last): File "/home/ray/LogAnalyzer/iis-log-analyze.py", line 2519, in ReadInDaysLog(tempLogName, countryCodes) File

[Tutor] Speech recognition, and synthesis

2010-04-11 Thread Ray Parrish
Hello, Are there any Python libraries that deal with speech recognition, and speech synthesis? If so, where are they available, and are there any open source versions? Thanks for any help you can be. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com

[Tutor] Declaring methods in modules.

2010-04-11 Thread Ray Parrish
ss within the module? Thanks for any help you can be. Later, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareReport.html Ray's Links, a variety of links to usefull things, and articles by Ray. http://www.rayslinks.com Writings of "The" Sc

[Tutor] Passing headers with httplib

2010-04-15 Thread Ray Parrish
row=1&genre=0&favchan=false&magic=1269|9898&magictype=0&zip=&music=1&ppv=1&24hr=1&HDTVOnly=false; s_cc=true; s_sq=%5B%5BB%5D%5D; wtpgcnt=1; s_vi=[CS]v1|25E3DAD0050118C7-610E60004530[CE]; base_domain_4631b4ff1e53d450c3f9726dd45be7de=tvguide.com; rsi_ct

Re: [Tutor] Passing headers with httplib

2010-04-16 Thread Ray Parrish
Ray Parrish wrote: Hello, I am trying to figure out how to send cookie data with an httplib request command. Here is what the doc says - request( method, url[, body[, headers]]) This will send a request to the server using the HTTP request method method and the selector url. If the

[Tutor] Boa Constructor list control

2010-04-29 Thread Ray Parrish
description of the list control, with no details on what it's properties were even. Thanks, Ray Parrish -- Linux dpkg Software Report script set.. http://www.rayslinks.com/LinuxdpkgSoftwareReport.html Ray's Links, a variety of links to usefull things, and articles by Ray. http://www.

Re: [Tutor] Boa Constructor list control

2010-04-29 Thread Ray Parrish
Ray Parrish wrote: Hello, I am just learning how to use Boa Constructor to make GUI apps, and am having some problem with understanding the list control. The list control has a property called columns, but I cannot figure out how to add columns, and specify names for them. When I click

[Tutor] Help on finding the 1000th prime

2009-11-16 Thread Ray Holt
I am taking the online course Introduction to Computer Science and Programming from the MIT website and this is one of their assignments. The on campus students are able to collaborate with one another, but I live in Ohio. Thanks, Ray ___ Tutor mai

[Tutor] A way to search archives?

2009-11-16 Thread Ray Holt
Is there a way to search the archives? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] parsing a continuous log file

2007-11-29 Thread ray sa
it should exit. I was checking with google and came accross a command used in UNIX called the tail command. May be someone can help me to achieve the same result with modifying the above code? Also the file could be up to 200 MB long. Many thanks for your kind help. /Ray -

[Tutor] date conversion

2006-04-05 Thread Ray Allen
ctionality. Ray Allen ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Ftp files

2006-12-19 Thread ray sa
command. How to use the get command to fetch the files in the list prevously where the match was found and store this in my local directory? - Also how to run this python file daily automatically? Looking forward to you responses.. BR Ray

[Tutor] control multiple FTP sessions using multiple ip connections via different com ports

2007-02-16 Thread ray sa
force the ftp script to use the relevant connections on one laptop. You help and guidance will be most appreciated. Many thanks Ray - Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out

Re: [Tutor] control multiple FTP sessions using multiple ip connectionsvia different com ports

2007-02-17 Thread ray sa
explain this. Once again I really appreciate the help on this forum./Ray Alan Gauld <[EMAIL PROTECTED]> wrote: "ray sa" wrote > I have been successful to write an ftp script that logs > into a server and collects files. > ...I would like to run multip

Re: [Tutor] control multiple FTP sessions using multiple ipconnectionsvia different com ports

2007-02-19 Thread ray sa
allenge to seek. I am kind of hoping that someone on this forum will know how. In the mean time I can continue with my testing. Many thanks for your help; really appreciate it. /Ray Johan Geldenhuys <[EMAIL PROTECTED]> wrote: Will it be possible to disconnect one of

Fat Injections For Buttock Enhancement

2008-09-14 Thread Crystal Ray
Fat Injections For Buttock Enhancement Fat injections to the buttocks is an alternative treatment to traditional buttock (gluteal) implants. Fat injections use the patient's own tissues and one gets the bonus of cosmetic reduction in the harvest site as well. Fat grafts, however, have a

[Tutor] Syntax error with if statement

2011-08-24 Thread Ray Parrish
print CallCount And here is the error message: ray@RaysComputer:~$ python /home/ray/EmailCount/CountEmails.py File "/home/ray/EmailCount/CountEmails.py", line 41 if thisFile == "/Images/My%20Face.JPG"

Re: [Tutor] Introduction

2012-08-18 Thread Ray Jones
Thanks for the welcome - I'll take a look at your recommendation. Ray On 08/18/2012 10:08 AM, Alex Clark wrote: > Hi Ray, > > On 2012-08-18 16:36:40 +, Ray said: > >> Hello. I am new to the mailing list and to Python. My knowledge of >> Python comes almost

Re: [Tutor] Introduction

2012-08-18 Thread Ray Jones
GUI? Moi? Hahahawellnow that you mention it, I wonder Ray On 08/18/2012 10:25 AM, Alan Gauld wrote: > On 18/08/12 17:36, Ray wrote: > >> I'm not certain why I'm diving into Python. My only coding experience >> has been using Bash scripts on my Ubuntu sy

[Tutor] Escaping globs for glob.iglob()

2012-08-20 Thread Ray Jones
does not recognize the file glob in znDir/*. Later in the code I will be using creating symbolic links, and I wish to use the absolute path rather than the relative path. Any idea of how to sanitize this path so that I can get glob to work? Ray __

Re: [Tutor] Escaping globs for glob.iglob()

2012-08-20 Thread Ray Jones
On 08/20/2012 11:05 PM, Peter Otten wrote: > Ray Jones wrote: > >> The code: >> >> curDir = os.getcwd() >> znDir = shutil.abspath('../') >> baseDir = shutil.abspath('../../') >> >> Files = glob.iglob(os.path.join(znDir,

Re: [Tutor] Escaping globs for glob.iglob()

2012-08-21 Thread Ray Jones
On 08/21/2012 12:59 AM, Alan Gauld wrote: > On 21/08/12 06:42, Ray Jones wrote: > >>Files = glob.iglob(os.path.join(znDir, '*')) >>print Files >> >>for moveFile in Files: >> print moveFile >> >> Nothing happens. The &#

[Tutor] subprocess.Popen help

2012-08-21 Thread Ray Jones
etc. much beyond a simple 'ls | ws -l' or &2>/dev/null scenarios. The docs for Popen have left me completely boggled, and I'm not seeing much available on Google search. Any suggestions? Thanks. Ray ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Hello Python Tutor - help please!

2012-08-22 Thread Ray Jones
pts aren't simply soaked up like water to a sponge ;). Ray On 08/22/2012 03:10 AM, Cecilia Chavana-Bryant wrote: > Dear all, > > I am just returning to my doctoral studies after a 7-month medical > leave and desperately trying to catch up for lost time. I am > COMPLETELY new t

Re: [Tutor] subprocess.Popen help...thanks

2012-08-22 Thread Ray Jones
Thanks to all who responded. I'm deeply into some of the links provided, and my understanding has greatly increased. Ray On 08/22/2012 12:59 AM, Andreas Perstinger wrote: > On 22.08.2012 03:39, Ray Jones wrote: >> Does anyone know of a link to a really good tutorial that would h

[Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread Ray Jones
he file, I have to test the opposite: 'if not test:' because Python sees the zero as False. Does it become second nature to work with these conflicts? Or do you find it more expedient bypass the OS shell and work almost exclusively with Python? Ray _

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread Ray Jones
at seems much cleaner to me than testing to see if 'os.listdir' contains a specific file. Thanks. I am forever confused, however, on which methods can be found where. I just spent quarter of an hour searching in sys,* os.*, and shutil.*. for a 'kill' command that I knew I'

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-23 Thread Ray Jones
On 08/23/2012 10:37 PM, eryksun wrote: > On Thu, Aug 23, 2012 at 11:55 PM, Ray Jones wrote: > >> For example, if I wish to test if a file exists, I might do >> >> test = Popen('[ -f file-i-want-to-test-for ]') >> >> But the moment I invoke Bash for

Re: [Tutor] Python working with Bash....arrrggggh!

2012-08-24 Thread Ray Jones
On 08/24/2012 12:02 AM, Steven D'Aprano wrote: > On 24/08/12 16:27, Ray Jones wrote: > >> I am forever confused, however, on which methods can be found where. I >> just spent quarter of an hour searching in sys,* os.*, and shutil.*. for >> a 'kill' command

[Tutor] 2.7.3 'CalledProcessError' error....why?

2012-08-24 Thread Ray Jones
My code: try: subprocess.check_call(['ping', '-w1', ip]) except CalledProcessError: print 'System', ip, 'is not responding. Exiting' sys.exit(4) else: return None The result: Traceback (most recent call last): File "./testing.py", line 222, in main() File "./testin

Re: [Tutor] 2.7.3 'CalledProcessError' error....why?

2012-08-24 Thread Ray Jones
On 08/24/2012 04:14 PM, Emile van Sebille wrote: > On 8/24/2012 3:36 PM Ray Jones said... >> My code: >> >>try: >> subprocess.check_call(['ping', '-w1', ip]) >>except CalledProcessError: >> print 'System'

[Tutor] 2.7.3 Popen argument issues

2012-08-25 Thread Ray Jones
Is there a method by which I can get an exact representation of command line arguments passed by Popen as seen by the called program? The argument error I receive shows me an argument that looks exactly like the argument that I use with Bash (it should - I copied and pasted it) - but the Bash versi

Re: [Tutor] 2.7.3 Popen argument issues

2012-08-26 Thread Ray Jones
7; before the `#duplicate' . I think --sout adds a default combination if it doesn't find a proper argument. Unfortunately, I know a bit less about vlc command line arguments than I do about Python's generation of those arguments ;) I had or

Re: [Tutor] 2.7.3 Popen argument issues

2012-08-26 Thread Ray Jones
On 08/26/2012 05:57 AM, Don Jennings wrote: > > On Aug 26, 2012, at 12:25 AM, tutor-requ...@python.org > <mailto:tutor-requ...@python.org> wrote: > >> Message: 2 >> Date: Sat, 25 Aug 2012 17:46:08 -0700 >> From: Ray Jones mailto:crawlz...@gmail.com>

Re: [Tutor] 2.7.3 Popen argument issues

2012-08-27 Thread Ray Jones
On 08/26/2012 07:12 AM, eryksun wrote: > On Sun, Aug 26, 2012 at 7:55 AM, Ray Jones wrote: >> [0x8d42554] stream_out_standard stream out error: no mux specified or >> found by extension >> [0x8d42134] main stream output error: stream chain failed for >> `standard{mux

Re: [Tutor] 2.7.3 Popen argument issues

2012-08-27 Thread Ray Jones
e the non-working call was misnamed a 'mjpeg' mux. ) Thanks for your help - I have a greater understanding of what's going on. When I'm 80, I might be able to claim guruship like you! ;) Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
mportError Traceback (most recent call last) /home/ray/ in () ImportError: No module named pytz In [2]: import pytz-2012d File "", line 1 import pytz-2012d ^ SyntaxError: inval

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 11:06 AM, Peter Otten wrote: > Ray Jones wrote: > >> I'm working on another Python replacement for a Bash script, and I ran >> into a need for enhanced time zone functions. Following directions I >> found on a web site, I did the following: >&g

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 12:35 PM, Steven D'Aprano wrote: > On 29/08/12 03:41, Ray Jones wrote: >> I'm working on another Python replacement for a Bash script, and I ran >> into a need for enhanced time zone functions. Following directions I >> found on a web site, I did the

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 12:44 PM, Peter Otten wrote: > Ray Jones wrote: > >> On 08/28/2012 11:06 AM, Peter Otten wrote: >>> Ray Jones wrote: >>> >>>> I'm working on another Python replacement for a Bash script, and I ran >>>> into a need for enhance

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 12:35 PM, Steven D'Aprano wrote: > On 29/08/12 03:41, Ray Jones wrote: >> I'm working on another Python replacement for a Bash script, and I ran >> into a need for enhanced time zone functions. Following directions I >> found on a web site, I did the

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 12:52 PM, eryksun wrote: > On Tue, Aug 28, 2012 at 2:39 PM, Ray Jones wrote: >>> Do you have multiple python installations on your machine? Do you run >>> easy_install in one and ipython in another? >> Perhaps. But the module is not accessible from the &#

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 01:11 PM, eryksun wrote: > On Tue, Aug 28, 2012 at 4:00 PM, Ray Jones wrote: >> Oops. No, I see that /usr/local/lib/python2.7/dist-packages is included >> in the sys.path. Now what? > Good, but does sys.path contain > /usr/local/lib/python2.7/dist-packages/pyt

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 01:11 PM, eryksun wrote: > On Tue, Aug 28, 2012 at 4:00 PM, Ray Jones wrote: >> Oops. No, I see that /usr/local/lib/python2.7/dist-packages is included >> in the sys.path. Now what? > Good, but does sys.path contain > /usr/local/lib/python2.7/dist-packages/pytz-

Re: [Tutor] Installing modules with easy_install

2012-08-28 Thread Ray Jones
On 08/28/2012 01:35 PM, Emile van Sebille wrote: > On 8/28/2012 1:17 PM Ray Jones said... >> On 08/28/2012 01:11 PM, eryksun wrote: >>> On Tue, Aug 28, 2012 at 4:00 PM, Ray Jones wrote: >>>> Oops. No, I see that /usr/local/lib/python2.7/dist-packages is >>&

Re: [Tutor] running more than one python program at the same time

2012-08-28 Thread Ray Jones
ere's a way to do this? > Or do I need to buy a second computer? > Thanks, > Ben Can you make each script executable and run them without idle? Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: htt

[Tutor] Using a calling program to change Python script arguments

2012-08-31 Thread Ray Jones
all. So how high is this pie-in-the-sky dream of mine? Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using a calling program to change Python script arguments

2012-08-31 Thread Ray Jones
On 08/31/2012 02:19 PM, Alan Gauld wrote: > On 31/08/12 18:05, Ray Jones wrote: > >> script and have it parse. Is there another method for one Python script >> to call/import/execute a Python script and integrate the name space so >> that the variables in each of the

Re: [Tutor] Using a calling program to change Python script arguments

2012-08-31 Thread Ray Jones
th list a run time. So far it appears to work in testing modenext we'll see what happens in real life! Thanks. Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] 2.7.3 generator objects

2012-09-01 Thread Ray Jones
upposed to work in a generator function using 'yield', but I'm at a loss at how that all works. I suppose I should just stick with using the os.walk in the for loop, but I'd like to make sense of the whole thing. Please someone explain this to me? Thanks. Ray __

Re: [Tutor] 2.7.3 generator objects

2012-09-01 Thread Ray Jones
On 09/01/2012 11:39 PM, Alan Gauld wrote: > On 02/09/12 06:44, Ray Jones wrote: >> I was playing with os.walk today. I can use os.walk in a for loop (does >> that make it an iterator or just an irritable? ^_^), but if I assign >> os.walk to 'test' (test = os.w

Re: [Tutor] 2.7.3 generator objects

2012-09-02 Thread Ray Jones
After a few times re-reading, I'm beginning to get a glimmer > Also, here is the PEP for simple generators: > http://www.python.org/dev/peps/pep-0255/ but this is complete Greek! ;) But didn't I read somewhere that you can reset an iterator to go through th

Re: [Tutor] Running a script in the background

2012-09-02 Thread Ray Jones
thing like cron or kalarm? That way user inputs could be used when called by a user, but defaults could be used if run by a bot. Or is this more of a Linux question? Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription op

Re: [Tutor] Running a script in the background

2012-09-02 Thread Ray Jones
On 09/02/2012 03:30 PM, Alan Gauld wrote: > On 02/09/12 23:14, Ray Jones wrote: >> could run silently in the background. But is there a way for a Python >> (2.7.3) script to determine whether it was called by the user or called >> by something like cron or kalarm? That way

Re: [Tutor] Running a script in the background (offshoot - sorry, OP)

2012-09-02 Thread Ray Jones
On 09/02/2012 06:03 PM, Steven D'Aprano wrote: > On Sun, Sep 02, 2012 at 03:14:53PM -0700, Ray Jones wrote: >> This is only tangentially related to the thread. Someone mentioned that >> so long as a script didn't require user input or output to the user, it >> could

[Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
ady don't understand? ;) Thanks Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 02:57 AM, Walter Prins wrote: > Hi Ray, > > On 5 September 2012 10:42, Ray Jones wrote: >> Can someone point me to a page that will clarify the concepts, not just >> try to show me the Python implementation of what I already don't >> understand? ;) &

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 03:33 AM, Peter Otten wrote: > Ray Jones wrote: > >> I have directory names that contain Russian characters, Romanian >> characters, French characters, et al. When I search for a file using >> glob.glob(), I end up with stuff like \x93\x8c\xd1 in place of t

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 04:52 AM, Peter Otten wrote: > Ray Jones wrote: > >> >> But doesn't that entail knowing in advance which encoding you will be >> working with? How would you automate the process while reading existing >> files? > If you don't *know* the enc

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 07:31 AM, eryksun wrote: > On Wed, Sep 5, 2012 at 5:42 AM, Ray Jones wrote: >> I have directory names that contain Russian characters, Romanian >> characters, French characters, et al. When I search for a file using >> glob.glob(), I end up with stuff like \x9

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 07:51 AM, Ray Jones wrote: > subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) > > Dolphin's error message: 'The file or folder > /my_home/testdir/\u044c\u043e\u0432 does not exist' > > But if I copy the charac

Re: [Tutor] Unicode? UTF-8? UTF-16? WTF-8? ;)

2012-09-05 Thread Ray Jones
On 09/05/2012 08:18 AM, eryksun wrote: > On Wed, Sep 5, 2012 at 10:51 AM, Ray Jones wrote: >> subprocess.call(['dolphin', '/my_home/testdir/\u044c\u043e\u0432']) >> >> Dolphin's error message: 'The file or folder >> /my_home/testdir/\

Re: [Tutor] Hey.need help on time

2012-09-06 Thread Ray Jones
t; os.environ['TZ'] = 'US/Eastern' > Now just call time.tzset(), and it should work. Why the additional step of calling time.tzset()? Once os.environ['TZ'] is set, I've found that time.localtime() responds to the new TZ witho

Re: [Tutor] Help

2012-09-06 Thread Ray Jones
== "Hand it over" or answer2 > > == "hand it over": > >print "Bandit: Good Job.. Go on now" > >ammo=ammo-15 > > I'll take a stab at it. You are using attempting to modify a global variable within a procedure. Procedure variables are separate from global variables. Global variables must be passed into a procedure using something on the order of 'part1(ammo)', and then returned back from the procedure with a 'return ' Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Hey.need help on time

2012-09-06 Thread Ray Jones
On 09/06/2012 02:08 AM, eryksun wrote: > On Thu, Sep 6, 2012 at 4:25 AM, Ray Jones wrote: >> Why the additional step of calling time.tzset()? Once os.environ['TZ'] >> is set, I've found that time.localtime() responds to the new TZ without >> anything extra. Is

[Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
would use 'grid.', I could replace it with 'test' How would I accomplish that? Thanks. Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 07:15 AM, Dave Angel wrote: > On 09/06/2012 09:56 AM, Ray Jones wrote: >> I have a multiple 'if' expression that I need to drastically reduce in >> size, both for readability and to keep errors from creeping in. >> >> For example, I would like to

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 07:33 AM, Peter Otten wrote: > Ray Jones wrote: > >> I have a multiple 'if' expression that I need to drastically reduce in >> size, both for readability and to keep errors from creeping in. >> >> For example, I would like to have the variable

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 07:35 AM, Jerry Hill wrote: > On Thu, Sep 6, 2012 at 10:15 AM, Ray Jones wrote: >> Well, of all the. a REAL programming language. I mean, even >> Bash ;;)) >> >> Anyway, it was a shot. Thanks. > There's almost certainly a way to

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 07:48 AM, Dave Angel wrote: >>> On 09/06/2012 09:56 AM, Ray Jones wrote: >>>> I have a multiple 'if' expression that I need to drastically reduce in >>>> size, both for readability and to keep errors from creeping in. >>>> &g

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 08:29 AM, Walter Prins wrote: > Hi Ray, > > On 6 September 2012 15:59, Ray Jones wrote: >> Basically it's as simple as ensuring that an array consists of integers, >> and that those integers fall within a certain range. Rather than using >> multipl

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 10:05 AM, Alan Gauld wrote: > On 06/09/12 14:56, Ray Jones wrote: >> I have a multiple 'if' expression that I need to drastically reduce in >> size, both for readability and to keep errors from creeping in. >> >> For example, I would like to ha

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 05:31 PM, Steven D'Aprano wrote: > On 06/09/12 23:56, Ray Jones wrote: >> I have a multiple 'if' expression that I need to drastically reduce in >> size, both for readability and to keep errors from creeping in. >> >> For example, I would lik

Re: [Tutor] Making big 'uns into little 'uns

2012-09-06 Thread Ray Jones
On 09/06/2012 05:34 PM, Steven D'Aprano wrote: > On 07/09/12 01:33, Ray Jones wrote: > >> Our homework "monitor" complains if we use code that hasn't been >> discussed in session yet. > > The good old "teaching by enforced ignorance" method. &g

[Tutor] urllib2.urlopen(....., timeout=)

2012-09-07 Thread Ray Jones
ng the urlopen to timeout if the target system isn't responding for some reason? What kind of objects is it expecting? Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] urllib2.urlopen(....., timeout=)

2012-09-07 Thread Ray Jones
On 09/07/2012 08:33 AM, Steven D'Aprano wrote: > On 08/09/12 01:16, Ray Jones wrote: >> 2.7.3 >> According to the docs, urlopen has a timeout capability. But it says >> that the timeout = '' > > Which docs are those? According to these docs: > > http

Re: [Tutor] urllib2.urlopen(....., timeout=)

2012-09-07 Thread Ray Jones
On 09/07/2012 08:32 AM, Dave Angel wrote: > On 09/07/2012 11:16 AM, Ray Jones wrote: >> 2.7.3 >> According to the docs, urlopen has a timeout capability. But it says >> that the timeout = '' >> >> I've tried integers as the timeout value, I've t

[Tutor] Seeing response from authorization page with urllib2

2012-09-11 Thread Ray Jones
't seem to work. How can I get that information from the server? Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] 2.7.3 documentation gripe (feel free to ignore)

2012-09-14 Thread Ray Jones
s defined. Rather than spelling it out in full details, here are some hints. === They call this DOCUMENTATION??? "it's similar to such and such - you figure it outhere are the hints"! Bah! I hope their code is better than the documentati

[Tutor] (2.7.3) Inexplicable change of type

2012-09-14 Thread Ray Jones
ent call last): File "/tmp/pytmp.py", line 18, in out = split_string('Hi! I am your Assistant Instructor, Peter.', '! ,.') File "/tmp/pytmp.py", line 13, in split_string while '' in source: TypeError: argument of type 'NoneType' i

Re: [Tutor] (2.7.3) Inexplicable change of type

2012-09-14 Thread Ray Jones
On 09/14/2012 02:07 AM, Steven D'Aprano wrote: > On 14/09/12 18:43, Ray Jones wrote: > >> Between the two arrows, 'source' inexplicably switches from >> to. Why? > > source.remove('') does not do what you think it does. Checking the > Fine Man

Re: [Tutor] (2.7.3) Inexplicable change of type

2012-09-14 Thread Ray Jones
Thanks for the responses. I knew it had to be something stupid ;)). Ray ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] 2.7.3 documentation gripe (feel free to ignore)

2012-09-14 Thread Ray Jones
On 09/14/2012 02:32 AM, Steven D'Aprano wrote: > On 14/09/12 17:29, Ray Jones wrote: >> >> 6.5. The del >> <http://docs.python.org/reference/simple_stmts.html#del> statement > [...] >> They call this DOCUMENTATION??? "it's similar to s

Re: [Tutor] How to run this block of code dozens of times

2012-09-17 Thread Ray Jones
On 09/17/2012 02:46 AM, eryksun wrote: > On Sun, Sep 16, 2012 at 11:17 PM, Steven D'Aprano wrote: >> Other uses are: >> >> * a single leading underscore usually means "private, don't touch" >> >> * double leading and trailing underscore names have special meaning >> to Python, e.g.: > There's al

  1   2   >