[Tutor] Quick question on dirsync a python pkg

2017-07-31 Thread Jeff VanderDoes
Hi, Just curious if anyone can give me an explanation of when using the pkg dirsync 2.2.2 what the difference is between --update and --sync option. Maybe my brain is just a bit slow this morning. Thanks! Jeff ___ Tutor maillist - Tutor@python.org To

Re: [Tutor] Quick question for Tutor admin.

2014-08-28 Thread Alan Gauld
On 28/08/14 23:25, Crush wrote: Am I allowed to attach screen shots to my emails? We can't stop you, but we prefer text. Not least because some members can't receive anything but text. Also some pay by the byte and images tend to be big and thus expensive. So you would limit the visibility and

Re: [Tutor] Quick question for Tutor admin.

2014-08-28 Thread Danny Yoo
On Thu, Aug 28, 2014 at 3:25 PM, Crush wrote: > Am I allowed to attach screen shots to my emails? Hi Bo, If the informational content can be represented textually, then please try to avoid screenshots in favor of copy-and-paste. There are a few reasons for it. But one major reason why text is

Re: [Tutor] Quick question for Tutor admin.

2014-08-28 Thread Cameron Simpson
On 28Aug2014 18:25, Crush wrote: Am I allowed to attach screen shots to my emails? I am not the list admin, but generally no. Please insert plain text into your posts. Many lists strip attachments, and many people on technical lists are (deliberately) working in a purely text environment.

[Tutor] Quick question for Tutor admin.

2014-08-28 Thread Crush
Am I allowed to attach screen shots to my emails? Bo ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Quick Question

2014-04-15 Thread Steven D'Aprano
Hi Victoria, On Tue, Apr 15, 2014 at 12:06:13AM -0500, Victoria Kuritza wrote: > How can I search in a corpus for three or more occurrences of > capitalized words in a line? What would I input as my search? I'm afraid that question is a bit *too* quick. What are you using for search? My guess

Re: [Tutor] Quick Question

2014-04-15 Thread Mark Lawrence
On 15/04/2014 06:06, Victoria Kuritza wrote: How can I search in a corpus for three or more occurrences of capitalized words in a line? What would I input as my search? Cheers, Victoria K. What does your code currently look like? What problems are you actually having? Last and by no mean

[Tutor] Quick Question

2014-04-15 Thread Victoria Kuritza
How can I search in a corpus for three or more occurrences of capitalized words in a line? What would I input as my search? Cheers, Victoria K. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mai

Re: [Tutor] Quick Question on String Compare

2013-06-01 Thread Danny Yoo
The standard sorting in Python depends on a comparison operator. A quick and easy comparison operator that Python uses for strings is lexicographic ordering: http://en.wikipedia.org/wiki/Lexicographical_order The quick and dirty rule is: dictionary order, with each character consistently tre

Re: [Tutor] Quick Question on String Compare

2013-06-01 Thread Andreas Perstinger
On 01.06.2013 07:47, Sarma Tangirala wrote: I had a quick question on how string compare works. If did '1001' <= '999' I get true. I know how the string compare works but I was wondering why it were so. Why doesn't the string length factor into the comparison? Because usually you are interested

Re: [Tutor] Quick Question on String Compare

2013-06-01 Thread Peter Otten
Sarma Tangirala wrote: > I had a quick question on how string compare works. If did '1001' <= '999' > I get true. I know how the string compare works but I was wondering why it > were so. Why doesn't the string length factor into the comparison? For > example, If I compared character-by-character

[Tutor] Quick Question on String Compare

2013-05-31 Thread Sarma Tangirala
Hi, I had a quick question on how string compare works. If did '1001' <= '999' I get true. I know how the string compare works but I was wondering why it were so. Why doesn't the string length factor into the comparison? For example, If I compared character-by-character but also found how differen

Re: [Tutor] Quick question about definitions.

2012-11-17 Thread Steven D'Aprano
On 17/11/12 04:28, sillywilly98 wrote: I know this code is not fully debugged. I just cant see why 1 definition is wrong. Please don't send screen shots if you don't need to. In this case, the screen shot adds nothing, and turns this into a "

Re: [Tutor] Quick question about definitions.

2012-11-17 Thread Dave Angel
On 11/16/2012 12:28 PM, sillywilly98 wrote: > I know this code is not fully debugged. I just cant see why 1 definition is > wrong. > Here is the code: > # This program draws a robot. > > from turtle import * > > def draw_eyes(): > # This fu

Re: [Tutor] Quick question about definitions.

2012-11-17 Thread eryksun
On Fri, Nov 16, 2012 at 12:28 PM, sillywilly98 wrote: > > I know this code is not fully debugged. I just cant see why 1 definition is > wrong. You have several typos (there may be more): draw_eyes: end_fill(() draw_nose: end_fill(()

[Tutor] Quick question about definitions.

2012-11-17 Thread sillywilly98
I know this code is not fully debugged. I just cant see why 1 definition is wrong. Here is the code: # This program draws a robot. from turtle import * def draw_eyes(): # This function penup() color("purple") goto(-50, 200)

Re: [Tutor] quick question

2012-09-28 Thread Steven D'Aprano
On 28/09/12 19:03, Mark Lawrence wrote: On 28/09/2012 06:18, jh wrote: [snip] The subtotal of your items is: 26010.8502 The total amount of your items plus tax is: 27,571.50 My question here is, why does my subtotal have so many decimals when I never went above 2 in my input? Thanks

Re: [Tutor] quick question

2012-09-28 Thread Mark Lawrence
On 28/09/2012 06:18, jh wrote: [snip] The subtotal of your items is: 26010.8502 The total amount of your items plus tax is: 27,571.50 My question here is, why does my subtotal have so many decimals when I never went above 2 in my input? Thanks in advance, J Brett Ritter has already

Re: [Tutor] quick question

2012-09-27 Thread Dwight Hutto
> > That's a floating point error, not a round it off from the 3rd digit > in this case. More an error you have to calculate for from the macros of the languages python evolves from, down to the processor. -- Best Regards, David Hutto CEO: http://www.hitwebdevelopment.com _

Re: [Tutor] quick question

2012-09-27 Thread Dwight Hutto
On Fri, Sep 28, 2012 at 1:26 AM, Brett Ritter wrote: > On Thu, Sep 27, 2012 at 10:18 PM, jh wrote: >> The subtotal of your items is: 26010.8502 >> >> My question here is, why does my subtotal have so many decimals when I never >> went above 2 in my input? > > This is not actually a Python

Re: [Tutor] quick question

2012-09-27 Thread Dwight Hutto
On Fri, Sep 28, 2012 at 1:18 AM, jh wrote: > Howdy Folks, > > I'm using Python 3.2.3, IDLE 3.2.3 (on Windows 7 64-bit if it matters) > > Here is my code: > > > # Write a program that asks for the prices of 5 items then displays the > subtotal > # of the 5 items, then calculates sales tax (6 percen

Re: [Tutor] quick question

2012-09-27 Thread Brett Ritter
On Thu, Sep 27, 2012 at 10:18 PM, jh wrote: > The subtotal of your items is: 26010.8502 > > My question here is, why does my subtotal have so many decimals when I never > went above 2 in my input? This is not actually a Python thing, it's a computer thing. Computers represent numbers (ev

[Tutor] quick question

2012-09-27 Thread jh
Howdy Folks, I'm using Python 3.2.3, IDLE 3.2.3 (on Windows 7 64-bit if it matters) Here is my code: # Write a program that asks for the prices of 5 items then displays the subtotal # of the 5 items, then calculates sales tax (6 percent), and the displays the total. # Get input for the prices

Re: [Tutor] quick question

2009-11-26 Thread Alan Gauld
"Travis Murphy" wrote i am a first year student taking a python developers course. i wanted to know if from time to time in the future, is there somebody there i can speak to for support? Yes, a whole mailinglist of people. The only caveat is that, as a matter of policy, we do not do home

Re: [Tutor] quick question

2009-11-26 Thread OkaMthembo
By the way, when asking a question or answering, you only ever need to send the message to tutor@python.org :) On Thu, Nov 26, 2009 at 3:29 PM, OkaMthembo wrote: > Hi Travis, > > Welcome to the python mailing list. You have come to the right place for > support and advice pertaining to python; i

Re: [Tutor] quick question

2009-11-26 Thread OkaMthembo
Hi Travis, Welcome to the python mailing list. You have come to the right place for support and advice pertaining to python; it is what this list is about. On Thu, Nov 26, 2009 at 12:49 PM, Travis Murphy wrote: > i am a first year student taking a python developers course. i wanted to > know

[Tutor] quick question

2009-11-26 Thread Travis Murphy
i am a first year student taking a python developers course. i wanted to know if from time to time in the future, is there somebody there i can speak to for support? ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Garry Bettle
On Wed, Jul 8, 2009 at 21:37, Kent Johnson wrote: > On Wed, Jul 8, 2009 at 1:22 PM, Rich Lovely wrote: > >> If you really want to speed up the search, you could turn the list of lists >> into a dict, using the first value in each sublist as a key: >> >> dct = dict((i[0], i[1:]) for i in lst) >> >>

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Kent Johnson
On Wed, Jul 8, 2009 at 1:22 PM, Rich Lovely wrote: > If you really want to speed up the search, you could turn the list of lists > into a dict, using the first value in each sublist as a key: > > dct = dict((i[0], i[1:]) for i in lst) > > Then you can access it using the normal dictionary interfac

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Kent Johnson
On Wed, Jul 8, 2009 at 12:13 PM, Garry Bettle wrote: > Hi, > > I've been programming for over 20 yrs, but only the last few in python > and then only in dribs and drabs. > > I'm having a difficult time parsing a delimited string. > > e.g. > > 100657641~GBP~ACTIVE~0~1~~true~5.0~1247065352508~: > 381

Re: [Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Rich Lovely
On 8 Jul 2009, at 17:13, Garry Bettle wrote: Hi, I've been programming for over 20 yrs, but only the last few in python and then only in dribs and drabs. I'm having a difficult time parsing a delimited string. e.g. 100657641~GBP~ACTIVE~0~1~~true~5.0~1247065352508~: 3818854~0~24104.08~4.5~~2

[Tutor] Quick question regarding Parsing a Delimited string

2009-07-08 Thread Garry Bettle
Hi, I've been programming for over 20 yrs, but only the last few in python and then only in dribs and drabs. I'm having a difficult time parsing a delimited string. e.g. 100657641~GBP~ACTIVE~0~1~~true~5.0~1247065352508~: 3818854~0~24104.08~4.5~~22.1~false|4.4~241.67~L~1~4.3~936.0~L~2~4.2~210.54

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Larry Riedel
> I'm not sure citing anything Java does is a good rationale in Python! I find the languages/platforms complementary, so I appreciate when they are not arbitrarily inconsistent with each other. Larry ___ Tutor maillist - Tutor@python.org http://mail.

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Alan Gauld
"Larry Riedel" wrote It may not be a good reason, but I like that "open" is preferred, because in Java a "File" object is not a stream for the content in the file, just its directory entry, and simply creating a File object does not open the file at all. I'm not sure citing anything Java does

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Alan Gauld
"wesley chun" wrote does anyone have the idiom for the above isinstance() check for 3.x? Test for io.stream (or a derivative) - which is what open now returns. files are no more... Alan G. ___ Tutor maillist - Tutor@python.org http://mail.pyth

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Larry Riedel
It may not be a good reason, but I like that "open" is preferred, because in Java a "File" object is not a stream for the content in the file, just its directory entry, and simply creating a File object does not open the file at all. Larry ___ Tutor mai

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread wesley chun
> It seems that open(filename, 'r') and file(filename, 'r') are > used interchangeably, and I wonder what this is all about. as alan and others have pointed out, file() was added in 2.2. this was part of the unification of types and classes. every object now has a factory function, i.e., list() c

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread Mark Tolonen
"W W" wrote in message news:333efb450905050408m48246dd8wc90b94880898e...@mail.gmail.com... On Tue, May 5, 2009 at 5:41 AM, spir wrote: Le Tue, 5 May 2009 00:41:39 +0100, "Alan Gauld" s'exprima ainsi: > > Backwards compatibility. The file type was introduced in python 2.2, > > before whic

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread W W
On Tue, May 5, 2009 at 5:41 AM, spir wrote: > Le Tue, 5 May 2009 00:41:39 +0100, > "Alan Gauld" s'exprima ainsi: > > > > Backwards compatibility. The file type was introduced in python 2.2, > > > before which there was open. > > > > And file has been removed again in Python v3 > > In fact o

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-05 Thread spir
Le Tue, 5 May 2009 00:41:39 +0100, "Alan Gauld" s'exprima ainsi: > > Backwards compatibility. The file type was introduced in python 2.2, > > before which there was open. > > And file has been removed again in Python v3 > In fact open is now an alias for io.open and no longer simply retu

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread Lie Ryan
Alan Gauld wrote: > And file has been removed again in Python v3 In fact open is now an alias for io.open and no longer simply returns a file object - in fact the file type itself is gone too! A pity, there are cases where I found file() more intuitive than open and vice versa so liked havi

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread Alan Gauld
"Emile van Sebille" wrote in message news:gtnrtf$pi...@ger.gmane.org... On 5/4/2009 2:50 PM bob gailer said... PDavid wrote: Dear list, in different books I come across different syntax for dealing with files. It seems that open(filename, 'r') and file(filename, 'r') are used interchangeably,

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread Emile van Sebille
On 5/4/2009 2:50 PM bob gailer said... PDavid wrote: Dear list, in different books I come across different syntax for dealing with files. It seems that open(filename, 'r') and file(filename, 'r') are used interchangeably, and I wonder what this is all about. Is there a reason why Python allows

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread bob gailer
PDavid wrote: Dear list, in different books I come across different syntax for dealing with files. It seems that open(filename, 'r') and file(filename, 'r') are used interchangeably, and I wonder what this is all about. Is there a reason why Python allows such ambiguity here? regarding file

Re: [Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread Bill Campbell
On Tue, May 05, 2009, David wrote: >Dear list, > >in different books I come across different syntax for dealing with >files. It seems that open(filename, 'r') and file(filename, 'r') are >used interchangeably, and I wonder what this is all about. Is there a >reason why Python allows such ambiguity

[Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

2009-05-04 Thread David
Dear list, in different books I come across different syntax for dealing with files. It seems that open(filename, 'r') and file(filename, 'r') are used interchangeably, and I wonder what this is all about. Is there a reason why Python allows such ambiguity here? Cheers for a quick shot of enlight

Re: [Tutor] quick question

2007-09-24 Thread Terry Carroll
On Mon, 24 Sep 2007, max baseman wrote: > for example how hard would it be to write a program that take's a > input of a in out table and finds the rule > > ex: > > in out > 10 23 > 5 13 > 1 5 > 0 3 > > the rule is in*2+3 This is call

[Tutor] quick question

2007-09-24 Thread max baseman
hello just a quickie today :) how is python with patters or finding a rule for something ie: in out tables for example how hard would it be to write a program that take's a input of a in out table and finds the rule ex: in out 10 23 5 13 1

Re: [Tutor] Quick question

2007-09-22 Thread Tino Dai
On 9/21/07, Jerry Hill <[EMAIL PROTECTED]> wrote: > > On 9/21/07, Tino Dai <[EMAIL PROTECTED]> wrote: > > Is there a more pythonic way of doing this: > > > > if queuePacket.has_key('procSeq') and \ > > queuePacket.has_key('opacSeq') and \ > > queuePacket.has_key('keySeq') and \ > > len(queu

Re: [Tutor] Quick question

2007-09-21 Thread Jerry Hill
On 9/21/07, Tino Dai <[EMAIL PROTECTED]> wrote: > Is there a more pythonic way of doing this: > > if queuePacket.has_key('procSeq') and \ > queuePacket.has_key('opacSeq') and \ > queuePacket.has_key('keySeq') and \ > len(queuePacket['procSeq']) == 0 and \ > len(queuePacket['opacSeq']) ==

Re: [Tutor] Quick question

2007-09-21 Thread Eric Brunson
There are quite a few ways to do what you want. Here's are a few variations on a theme: try: if not any( ( len(queuePacket['procSeq']), len(queuePacket['opacSeq']), len(queuePacket['keySeq']) ) ): # Do your stuff here do_stuff() except KeyE

Re: [Tutor] Quick question

2007-09-21 Thread Kent Johnson
Tino Dai wrote: > Is there a more pythonic way of doing this: > > if queuePacket.has_key('procSeq') and \ > queuePacket.has_key('opacSeq') and \ > queuePacket.has_key('keySeq') and \ > len(queuePacket['procSeq']) == 0 and \ > len(queuePacket['opacSeq']) == 0 and \ > len(queuePacket['key

Re: [Tutor] Quick question

2007-09-21 Thread Michael Langford
Use the .get method of the dict to return a nonzero value (say None or -1) when it can't find an item. That will half your test cases. Example of .get below: --Michael >>> foo = {} >>> foo['d']=0 >>> foo['a']=1 >>> if(foo.get('a',1)==0 and foo.get('q',1)==0): print foo ... else: print "adsfl

[Tutor] Quick question

2007-09-21 Thread Tino Dai
Is there a more pythonic way of doing this: if queuePacket.has_key('procSeq') and \ queuePacket.has_key('opacSeq') and \ queuePacket.has_key('keySeq') and \ len(queuePacket['procSeq']) == 0 and \ len(queuePacket['opacSeq']) == 0 and \ len(queuePacket['keySeq']) == 0: ? -Thanks, Tino

Re: [Tutor] Quick question,

2006-04-07 Thread Hugo González Monteverde
Carlos Benevides wrote: > Hi, > > Can someone tell me what the r before the expression means, as in > "re.compile(r'(\.exe|\.zip|\.pif|\.scr|\.ps|\.pdf|\.ppt)$')"? It is not specific to regular expressions, it is called a raw string. http://docs.python.org/tut/node5.html ___

Re: [Tutor] Quick question,

2006-04-07 Thread Noufal Ibrahim
On Fri, April 7, 2006 8:23 pm, Carlos Benevides wrote: > Hi, > > Can someone tell me what the r before the expression means, as in > "re.compile(r'(\.exe|\.zip|\.pif|\.scr|\.ps|\.pdf|\.ppt)$')"? r is the way of making a string "raw". This means that escape characters will not be interpreted. Here

[Tutor] Quick question,

2006-04-07 Thread Carlos Benevides
Hi, Can someone tell me what the r before the expression means, as in "re.compile(r'(\.exe|\.zip|\.pif|\.scr|\.ps|\.pdf|\.ppt)$')"? I've seen regular expressions both ways, and I've seen them work with or without the r. Just wondering what it does, or if it makes a difference. Thanks. ___

Re: [Tutor] quick question about threads

2006-01-17 Thread nephish
all i needed to know, thanks very much shawn On Tue, 2006-01-17 at 21:53 -0500, Kent Johnson wrote: > nephish wrote: > > Hey there, i have a program written in python that uses four threads > > that run all at the same time. Now i want to add a new thread with the > > same basic structure (threa

Re: [Tutor] quick question about threads

2006-01-17 Thread Kent Johnson
nephish wrote: > Hey there, i have a program written in python that uses four threads > that run all at the same time. Now i want to add a new thread with the > same basic structure (threading.thread) that will run only when needed. > This one will not run in a loop, it will just run once and quit.

[Tutor] quick question about threads

2006-01-17 Thread nephish
Hey there, i have a program written in python that uses four threads that run all at the same time. Now i want to add a new thread with the same basic structure (threading.thread) that will run only when needed. This one will not run in a loop, it will just run once and quit. So, i may need this to