ANN: eGenix PyRun - One file Python Runtime 1.3.0

2013-09-11 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyRun - One file Python Runtime Version 1.3.0 An easy-to-use single file relocatable Python run-time - available for Linux, Mac OS X and U

Re: How to split with "\" character, and licence copyleft mirror of �

2013-09-11 Thread Fábio Santos
On 6 Sep 2013 07:18, "Terry Reedy" wrote: > > On 9/5/2013 11:33 PM, Tim Roberts wrote: >> >> random...@fastmail.us wrote: >>> >>> >>> Of course, in 99% of situations where you can use a windows pathname in >>> Python, you are free to use it with a forward slash instead of a >>> backslash. >> >> >>

Re: Language design

2013-09-11 Thread Burak Arslan
On 09/10/13 09:09, Steven D'Aprano wrote: > What design mistakes, traps or gotchas do you think Python has? My favourite gotcha is this: elt, = elts It's a nice and compact way to do both: assert len(elts) == 0 elt = elts[0] but it sure looks strange at first sight. As a bonus, it

Telnet to remote system and format output via web page

2013-09-11 Thread Kenroy Bennett
Hi I would like to create a web app using flask or cgi library along with telnetlib to telnet to specific servers and execute commands and retrieve the output. The output will then be formatted and outputted to a webpage . . Is this the best way of getting info from a remote system to be ou

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread Jugurtha Hadjar
Hello, William On 09/11/2013 06:39 AM, William Bryant wrote: > user_input1 = input(prompt) I take it you are using Python 3.x . If that's not the case, take a look at raw_input(). def NOS(): if user_input1 == "String" or user_input1 == "string" or user_input1 == "STRING" or user_inp

Re: print function and unwanted trailing space

2013-09-11 Thread Wayne Werner
On Sat, 31 Aug 2013, candide wrote: # - for i in range(5): print(i, end=' ') # <- The last ' ' is unwanted print() # - Then why not define end='' instead? -W -- https://mail.python.org/mailman/listinfo/python-list

Re: Language design

2013-09-11 Thread Wayne Werner
On Tue, 10 Sep 2013, Ben Finney wrote: The sooner we replace the erroneous “text is ASCII” in the common wisdom with “text is Unicode”, the better. I'd actually argue that it's better to replace the common wisdom with "text is binary data, and we should normally look at that text through U

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread Dave Angel
On 11/9/2013 01:39, William Bryant wrote: > On Wednesday, September 11, 2013 5:11:23 PM UTC+12, John Gordon wrote: >> In William Bryant >> writes: >> >> >> >> > Hey, I am very new to python, I am 13 years old. I want to be able to make >> > = >> >> > a program the caculates the mean, meadi

Re: Language design

2013-09-11 Thread Dave Angel
On 11/9/2013 07:42, Wayne Werner wrote: > On Tue, 10 Sep 2013, Ben Finney wrote: >> The sooner we replace the erroneous >> “text is ASCII” in the common wisdom with “text is Unicode”, the >> better. > > I'd actually argue that it's better to replace the common wisdom with > "text is binary dat

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-11 Thread Fábio Santos
On 2 Sep 2013 18:13, "Roy Smith" wrote: > > In article , > Anthony Papillion wrote: > > > On 09/02/2013 11:12 AM, Chris “Kwpolska” Warrick wrote: > > > On Mon, Sep 2, 2013 at 6:06 PM, Anthony Papillion > > > wrote: > > >> Hello Everyone, > > >> > > >> I have a multi-line string and I need to re

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-11 Thread Terry Reedy
On 9/11/2013 8:08 AM, Fábio Santos wrote: Is there not a limit argument to str.split? This should be trivial. Yes, I posted an example using it the first day. I also showed how to use iter and next with files and avoid copying. first, rest = multiline_str.split('\n', 1) This does not work

global variable across modules

2013-09-11 Thread chandan kumar
Hi , I'm trying to understand using global variable across different modules.Here is what i have tried so far without much success.Please ignore any indentation issue  in the below code. Filename:Test1.py Debug_Value = " " import Test2 def globalValmethod():     global Debug_Value     Debug

Re: Telnet to remote system and format output via web page

2013-09-11 Thread Jean-Michel Pichavant
- Original Message - > Hi > > > I would like to create a web app using flask or cgi library along > with telnetlib to telnet to specific servers and execute commands > and retrieve the output. > The output will then be formatted and outputted to a webpage . > > . Is this the best way

Re: Telnet to remote system and format output via web page

2013-09-11 Thread Jugurtha Hadjar
On 09/11/2013 11:45 AM, Kenroy Bennett wrote: Hi I would like to create a web app using flask or cgi library along with telnetlib to telnet to specific servers and execute commands and retrieve the output. The output will then be formatted and outputted to a webpage . Is security an is

why syntax change in lambda

2013-09-11 Thread Neal Becker
In py2.7 this was accepted, but not in py3.3. Is this intentional? It seems to violate the 'principle' that extraneous parentheses are usually allowed/ignored In [1]: p = lambda x: x In [2]: p = lambda (x): x File "", line 1 p = lambda (x): x ^ SyntaxError: invalid syntax

Re: How can I remove the first line of a multi-line string? (SOLVED)

2013-09-11 Thread Roy Smith
In article , Fábio Santos wrote: One suggested solution: > > > > sansfirstline = '\n'.join(fullstring.split('\n')[1:]) To which I suggested a couple of alternatives: > > i = s.index('\n') > > print s[i+1:] > > [...] > > print re.sub(r'^[^\n]*\n', '', s) > > I'll admit, the split/slice/joi

Re: why syntax change in lambda

2013-09-11 Thread Oscar Benjamin
On 11 September 2013 14:03, Neal Becker wrote: > In py2.7 this was accepted, but not in py3.3. Is this intentional? It seems > to > violate the 'principle' that extraneous parentheses are usually > allowed/ignored > > In [1]: p = lambda x: x > > In [2]: p = lambda (x): x > File "", line 1 >

Python in XKCD today

2013-09-11 Thread Roy Smith
http://xkcd.com/1263/ -- https://mail.python.org/mailman/listinfo/python-list

Re: global variable across modules

2013-09-11 Thread Chris Angelico
On Wed, Sep 11, 2013 at 10:50 PM, chandan kumar wrote: > In Test2.py file I wanted to print the global value ,Debug_Value as 10.I'm > not getting expected result.Please can any one point where exactly i'm doing > wrong. > > Similarly , how can i use global variable inside a class and use the sa

Re: Telnet to remote system and format output via web page

2013-09-11 Thread Rodrick Brown
I would use something like fabric to automatically login to hosts via ssh then parse the data myself to generate static HTML pages in a document root. Having a web app execute remote commands on a server is so wrong in many ways. Sent from my iPhone On Sep 11, 2013, at 8:56 AM, Jugurtha Hadjar

better and user friendly IDE recommended?

2013-09-11 Thread mnish1984
Hey i am a programmer but new to python. Can anyone guide me in knowing which is a better IDE used to develop web related apps that connect to DB using python? -- https://mail.python.org/mailman/listinfo/python-list

Send alt key to subprocess.PIPE stdin

2013-09-11 Thread Wanderer
How do I send the command 'Alt+D' to subprocess.PIPE? My code is import subprocess rsconfig = subprocess.Popen(["C:\Program Files\Photometrics\PVCam64\utilities\RSConfig\RSConfig.exe", ],stdin=subprocess.PIPE) rsconfig.stdin.write('Alt+D') Thanks -- https://mail.python.org/mailman/listinfo/p

Re: Language design

2013-09-11 Thread Neil Cerutti
On 2013-09-11, Burak Arslan wrote: > On 09/10/13 09:09, Steven D'Aprano wrote: >> What design mistakes, traps or gotchas do you think Python has? > > My favourite gotcha is this: > > elt, = elts > > It's a nice and compact way to do both: > > assert len(elts) == 0 > elt = elts[0] I'm

Re: Language design

2013-09-11 Thread Chris Angelico
On Thu, Sep 12, 2013 at 12:32 AM, Neil Cerutti wrote: > On 2013-09-11, Burak Arslan wrote: >> My favourite gotcha is this: >> >> elt, = elts >> >> It's a nice and compact way to do both: >> >> assert len(elts) == 0 >> elt = elts[0] > > I'm confused. Your rewrite looks like an assertio

TypeError in date_parse.py

2013-09-11 Thread pestrella
Hello, I'm running an application using python 2.7 with django 1.5 and when posting a page I get the error "TypeError" I guess it is something related to timestamps? Below I paste part of the code I think is causing the problem and the stacktace I see Any help is welcome, Thanks! Paula ==

Re: Dealing with Lists

2013-09-11 Thread stas poritskiy
ok, so i think that getting the nested list is a little more for what i need, however, i could be wrong here, i got confused with Dave's suggestion. so, i got my lists broken up in a list of lists, but how would i access each of the elements? When i implement this solution my output list (the new

Re: Language design

2013-09-11 Thread Ethan Furman
On 09/11/2013 03:38 AM, Burak Arslan wrote: On 09/10/13 09:09, Steven D'Aprano wrote: What design mistakes, traps or gotchas do you think Python has? My favourite gotcha is this: elt, = elts It's a nice and compact way to do both: assert len(elts) == 0 Perhaps you meant 'assert

Re: Dealing with Lists

2013-09-11 Thread stas poritskiy
ok, while writing this, i figured out where those elements are located, so each element is always at the position 0, and to get deeper i have to follow something similar to this chopGrp = [[u'arms', [u'a', [u'super', [u'group', [u'type', [u'is', [u'here']]] print chopGrp[1][1][1][1][0] (th

Re: Dealing with Lists

2013-09-11 Thread Peter Otten
stas poritskiy wrote: By now your post consists of over 1300 lines, most of them containing nothing but quoting marks. Please be courteous to your readers and avoid that. https://wiki.python.org/moin/GoogleGroupsPython may be helpful. > ok, while writing this, i figured out where those elemen

Re: TypeError in date_parse.py

2013-09-11 Thread John Gordon
In <09d39e02-c741-4a46-b34f-551e8...@googlegroups.com> pestre...@gmail.com writes: > = > # Compute duration for this item. > duration = None > if end_timestamp and start_timestamp: > start_datetime = datetime.fromtimestamp(float(star

Re: Python TUI that will work on DOS/Windows and Unix/Linux

2013-09-11 Thread James Harris
"Michael Torrie" wrote in message news:mailman.229.1378858009.5461.python-l...@python.org... ... > A toolkit (that's old, arguably), that might help you is TVision, a port > of the old Turbo Vision library that formed the foundation for Borland's > old DOS IDEs back in the day (check wikipedia)

Re: Send alt key to subprocess.PIPE stdin

2013-09-11 Thread Nobody
On Wed, 11 Sep 2013 07:26:32 -0700, Wanderer wrote: > How do I send the command 'Alt+D' to subprocess.PIPE? You don't. GUI programs don't read stdin, they receive key press events from the windowing system. -- https://mail.python.org/mailman/listinfo/python-list

Re: TypeError in date_parse.py

2013-09-11 Thread pestrella
I think it's a float, I see in the code if request.method == "POST": end_timestamp = request.POST.get('end_timestamp', None) start_timestamp = request.POST.get('start_timestamp', None) and in the debug of django https://mail.python.org/mailman/listinfo/python-list

Re: TypeError in date_parse.py

2013-09-11 Thread John Gordon
In <3d0038fd-00ec-4560-ab0d-06528f838...@googlegroups.com> pestre...@gmail.com writes: > I think it's a float, I see in the code > if request.method == "POST": > end_timestamp = request.POST.get('end_timestamp', None) > start_timestamp = request.POST.get('start_timestamp', None)

Re: embedding interactive python interpreter

2013-09-11 Thread Eric Frederich
Scott, Yes. As Mark Hammond suggested I took a look into the code/console modules. I wound up using InteractiveConsole from the code module. I'm sure my requirements are completely different from yours but I'll explain what I did anyway... I was working with a client/server architecture where I w

Re: Send alt key to subprocess.PIPE stdin

2013-09-11 Thread Gary Herron
On 09/11/2013 07:26 AM, Wanderer wrote: How do I send the command 'Alt+D' to subprocess.PIPE? My code is import subprocess rsconfig = subprocess.Popen(["C:\Program Files\Photometrics\PVCam64\utilities\RSConfig\RSConfig.exe", ],stdin=subprocess.PIPE) rsconfig.stdin.write('Alt+D') Thanks Tha

Re: Can I trust downloading Python?

2013-09-11 Thread Mr. Roboto
On Saturday, September 7, 2013 9:17:46 PM UTC-4, Aaron Martin wrote: > Hi, I am thinking about getting a software but it requires python, so that > brought up a few questions. Is it safe do download python, and does it come > with spam or advertisements? If it doesn't then should I get the latest

Re: Language design

2013-09-11 Thread Burak Arslan
On 09/11/13 17:52, Ethan Furman wrote: > On 09/11/2013 03:38 AM, Burak Arslan wrote: >> On 09/10/13 09:09, Steven D'Aprano wrote: >>> What design mistakes, traps or gotchas do you think Python has? >> >> My favourite gotcha is this: >> >> elt, = elts >> >> It's a nice and compact way to do bot

Oportunidade: Desenvolvedor Python

2013-09-11 Thread zughumancapital
Arpex Capital seleciona para uma de suas empresas: Desenvolvedor Python Objetivo geral da Posição: Desenvolver software estável e de primeira linha, que será incorporado à plataforma de WiFi mais moderna atualmente. Pré-requisitos: - Conhecimento em Python - MongoDB - Cloud computing, BigData

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread William Bryant
@Dave Angel What is .lower() ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread William Bryant
@Jugurtha Hadjar What does user_input.lower() mean/do? -- https://mail.python.org/mailman/listinfo/python-list

Re: Send alt key to subprocess.PIPE stdin

2013-09-11 Thread Wanderer
On Wednesday, September 11, 2013 1:43:09 PM UTC-4, Gary Herron wrote: > On 09/11/2013 07:26 AM, Wanderer wrote: > > > How do I send the command 'Alt+D' to subprocess.PIPE? > > > > > > My code is > > > > > > import subprocess > > > rsconfig = subprocess.Popen(["C:\Program > > Files\Photometri

Re: better and user friendly IDE recommended?

2013-09-11 Thread Adam Tauno Williams
On Wed, 2013-09-11 at 07:14 -0700, mnish1...@gmail.com wrote: > Hey i am a programmer but new to python. Can anyone guide me in knowing which > is a better IDE used to develop web related apps that connect to DB using > python? geany; it's awesome. -- Adam Tauno Willia

Re: global variable across modules

2013-09-11 Thread Dave Angel
On 11/9/2013 08:50, chandan kumar wrote: > Hi , > > I'm trying to understand using global variable across different modules. Python doesn't have such a thing, unless you consider builtins. > Here is what i have tried so far without much success.Please ignore any > indentation issue  in the below

Re: Send alt key to subprocess.PIPE stdin

2013-09-11 Thread Dave Angel
On 11/9/2013 10:26, Wanderer wrote: > How do I send the command 'Alt+D' to subprocess.PIPE? That's not a command, it's a keystroke combination. And without knowing what RSConfig.exe is looking to get its keystrokes, it might not even be possible to feed it any keystrokes via the pipe. if the pr

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread John Gordon
In William Bryant writes: > @Jugurtha Hadjar > What does user_input.lower() mean/do? String objects have a number of built-in functions, lower() being one of them. It returns a copy of the string with all uppercase letters converted to lowercase. Example: >>> x = "Hello There" >>> y

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread Dave Angel
On 11/9/2013 15:31, William Bryant wrote: > @Dave Angel > > What is .lower() ? It is a method on the str class. You could teach yourself. At the interpreter prompt, type help("test response".lower) Or on the web: http://docs.python.org/2/library/stdtypes.html#str.lower There are lots of

RE: Help please, why doesn't it show the next input?

2013-09-11 Thread Prasad, Ramit
William Bryant wrote: > Sent: Wednesday, September 11, 2013 2:32 PM > To: python-list@python.org > Subject: Re: Help please, why doesn't it show the next input? > > @Dave Angel > > What is .lower() ? Thanks for bottom posting and trimming, but you should leave some content quoted for context. Ot

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread Terry Reedy
On 9/11/2013 3:31 PM, William Bryant wrote: What is .lower() ? The Python docs have a pretty good index that includes 'lower() (str method)'. Learn to use it. If you know that .lower is a str method, >>> help(str.lower) at interactive prompt prints a page. Learn to use help(ob) also. --

Re: Chardet, file, ... and the Flexible String Representation

2013-09-11 Thread Serhiy Storchaka
09.09.13 22:27, random...@fastmail.us написав(ла): On Mon, Sep 9, 2013, at 15:03, Ian Kelly wrote: Do you mean that it breaks when overwriting Python string object buffers, or when overwriting arbitrary C strings either received from C code or created with create_unicode_buffer? If the former,

Re: Language design

2013-09-11 Thread Mark Janssen
> * Imports are fiendishly complex, hidden below deceptively simple > syntax. > > It's a reasonable expectation that one can import a module from a > source code file given its path on the filesystem, but this turns out > to be much more complicated than in many other languages. Why is thi

Python GUI?

2013-09-11 Thread eamonnrea
There are a few known GUI toolkits out there, and the main ones from what I can tell are: Tkinter -- Simple to use, but limited PyQT -- You have a GUI designer, so I'm not going to count that PyGTK -- Gnome officially back this I think wxPython -- Very nice, very professional, approved by Python

Re: Language design

2013-09-11 Thread Markus Rother
Hello all, Thanks for this thread. Here are my two cents... On 10.09.2013 08:09, Steven D'Aprano wrote: > What design mistakes, traps or gotchas do you think Python has? Gotchas > are not necessarily a bad thing, there may be good reasons for it, but > they're surprising. """ 1. Occas

Re: Language design

2013-09-11 Thread Mark Janssen
1) It tried to make Object the parent of every class. No one's close enough to God to make that work. 2) It didn't make dicts inherit from sets when they were added to Python. 3) It used the set literal for dict, so that there's no obvious way to do it. This didn't get changed in Py3k. 4?) It all

Re: Language design

2013-09-11 Thread Ethan Furman
On 09/11/2013 01:41 PM, Markus Rother wrote: 4. As has been mentioned already, some built-in functions do magic stuff behind the scenes: That's why they're called magic methods. ;) >>> () == [] False But: >>> bool(().__eq__([])) True This is not a tra

Re: global variable across modules

2013-09-11 Thread John Pote
Chris, Interesting. > > # Test1.py > Debug_Value = " " > > # Test2.py > from Test1 import * > # is exactly equivalent to > Debug_Value = " " > I take it then that assigning to Debug_Value in Test2.py will not change the value of Debug_Value in Test1.py. That being the case it would be wrong t

Re: global variable across modules

2013-09-11 Thread Dave Angel
On 11/9/2013 17:49, John Pote wrote: > Chris, > Interesting. >> >> # Test1.py >> Debug_Value = " " >> >> # Test2.py >> from Test1 import * >> # is exactly equivalent to >> Debug_Value = " " >> > I take it then that assigning to Debug_Value in Test2.py will not change the > value of Debug_Valu

RE: Language design

2013-09-11 Thread Prasad, Ramit
Mark Janssen wrote: > 1) It tried to make Object the parent of every class. No one's close > enough to God to make that work. > 2) It didn't make dicts inherit from sets when they were added to Python. > 3) It used the set literal for dict, so that there's no obvious way to > do it. This didn't g

Re: Language design

2013-09-11 Thread Ben Finney
Wayne Werner writes: > On Tue, 10 Sep 2013, Ben Finney wrote: > > The sooner we replace the erroneous > > “text is ASCII” in the common wisdom with “text is Unicode”, the > > better. > > I'd actually argue that it's better to replace the common wisdom with > "text is binary data, and we should

Please omit false legalese footers (was: Language design)

2013-09-11 Thread Ben Finney
"Prasad, Ramit" writes: > This email is confidential and subject to important disclaimers and > conditions including on offers for the purchase or sale of securities, > accuracy and completeness of information, viruses, confidentiality, > legal privilege, and legal entity disclaimers, available a

Re: Language design

2013-09-11 Thread Chris Angelico
On Thu, Sep 12, 2013 at 6:41 AM, Markus Rother wrote: > 3. The default return value of methods is None instead of self. > If it was self, it would be possible to chain method calls (which > is called a cascade in smalltalk). > > > >>> lst = [] > >>> lst.append(1).append(2).appe

Re: Language design

2013-09-11 Thread Ben Finney
Mark Janssen writes: > > * Imports are fiendishly complex, hidden below deceptively simple > > syntax. > > > > It's a reasonable expectation that one can import a module from a > > source code file given its path on the filesystem, but this turns out > > to be much more complicated than i

Re: better and user friendly IDE recommended?

2013-09-11 Thread Ben Finney
mnish1...@gmail.com writes: > Hey i am a programmer but new to python. Welcome! Congratulations on finding Python. > Can anyone guide me in knowing which is a better IDE used to develop > web related apps that connect to DB using python? The question of IDEs is a common one, and is a matter of

Re: Language design

2013-09-11 Thread Steven D'Aprano
On Wed, 11 Sep 2013 14:30:54 -0700, Mark Janssen wrote: > 1) It tried to make Object the parent of every class. Tried, and succeeded. > No one's close enough to God to make that work. Non-sequitor. One doesn't need to be close to a deity to have a single root of the object hierarchy. > 2)

Re: Language design

2013-09-11 Thread Steven D'Aprano
On Wed, 11 Sep 2013 22:41:50 +0200, Markus Rother wrote: > 2. Reduce removed from standard library. That is a big fail, in my > opinion. And Guido's Time Machine strikes again! py> from functools import reduce py> reduce [...] > 4. As has been mentioned already, some built-in

Re: Language design

2013-09-11 Thread Terry Reedy
On 9/11/2013 7:19 PM, Ben Finney wrote: Er? That doesn't address the task of importing a module from a source code file given its path on the filesystem. Other languages have the equivalent of ‘include "/path/to/file.py"’, Some includes are equivalent to with open("/path/to/file.py") as f:

Re: why syntax change in lambda

2013-09-11 Thread Steven D'Aprano
On Wed, 11 Sep 2013 09:03:49 -0400, Neal Becker wrote: > In py2.7 this was accepted, but not in py3.3. Is this intentional? It > seems to violate the 'principle' that extraneous parentheses are usually > allowed/ignored > > In [1]: p = lambda x: x > > In [2]: p = lambda (x): x > File "", lin

Re: global variable across modules

2013-09-11 Thread John Pote
Sorry about the html - did not realise. Thanks for your comments. John On 11 Sep 2013, at 22:49, John Pote wrote: > Chris, > Interesting. >> >> # Test1.py >> Debug_Value = " " >> >> # Test2.py >> from Test1 import * >> # is exactly equivalent to >> Debug_Value = " " >> > I take it then that

Re: Language design

2013-09-11 Thread Mark Janssen
>> On Tue, 10 Sep 2013, Ben Finney wrote: >> > The sooner we replace the erroneous >> > “text is ASCII” in the common wisdom with “text is Unicode”, the >> > better. >> >> I'd actually argue that it's better to replace the common wisdom with >> "text is binary data, and we should normally look a

Re: Language design

2013-09-11 Thread Chris Angelico
On Thu, Sep 12, 2013 at 10:25 AM, Mark Janssen wrote: >>> On Tue, 10 Sep 2013, Ben Finney wrote: >>> > The sooner we replace the erroneous >>> > “text is ASCII” in the common wisdom with “text is Unicode”, the >>> > better. >>> >>> I'd actually argue that it's better to replace the common wisdo

Re: Language design

2013-09-11 Thread Mark Janssen
>> Why is this so difficult? >> Add a Graph class to the collections module (networkx is quite good) >> and simply check for circular imports. > > Er? That doesn't address the task of importing a module from a source > code file given its path on the filesystem. That's true, I guess was hooked on

Re: Language design

2013-09-11 Thread Mark Janssen
> Unicode is not 16-bit any more than ASCII is 8-bit. And you used the > word "encod[e]", which is the standard way to turn Unicode into bytes > anyway. No, a Unicode string is a series of codepoints - it's most > similar to a list of ints than to a stream of bytes. Okay, now you're in blah, blah

Re: Language design

2013-09-11 Thread Chris Angelico
On Thu, Sep 12, 2013 at 10:37 AM, Mark Janssen wrote: >> Unicode is not 16-bit any more than ASCII is 8-bit. And you used the >> word "encod[e]", which is the standard way to turn Unicode into bytes >> anyway. No, a Unicode string is a series of codepoints - it's most >> similar to a list of ints

Re: Language design

2013-09-11 Thread Mark Janssen
>> 1) It tried to make Object the parent of every class. > > Tried, and succeeded. Really? Are you saying you (and the community at-large) always derive from Object as your base class? >> No one's close enough to God to make that work. > > Non-sequitor. One doesn't need to be close to a deity to

Re: Language design

2013-09-11 Thread Benjamin Kaplan
On Wed, Sep 11, 2013 at 5:37 PM, Mark Janssen wrote: >> Unicode is not 16-bit any more than ASCII is 8-bit. And you used the >> word "encod[e]", which is the standard way to turn Unicode into bytes >> anyway. No, a Unicode string is a series of codepoints - it's most >> similar to a list of ints t

Re: Language design

2013-09-11 Thread Ben Finney
Mark Janssen writes: > > Unicode is not 16-bit any more than ASCII is 8-bit. And you used the > > word "encod[e]", which is the standard way to turn Unicode into bytes > > anyway. No, a Unicode string is a series of codepoints - it's most > > similar to a list of ints than to a stream of bytes. >

Re: Language design

2013-09-11 Thread Terry Reedy
On 9/11/2013 8:49 PM, Mark Janssen wrote: 1) It tried to make Object the parent of every class. Tried, and succeeded. Really? Are you saying you (and the community at-large) always derive from Object as your base class? The name is 'object', and yes, everyone does it because it is automati

Re: Language design

2013-09-11 Thread Chris Angelico
On Thu, Sep 12, 2013 at 10:49 AM, Mark Janssen wrote: >>> 1) It tried to make Object the parent of every class. >> >> Tried, and succeeded. > > Really? Are you saying you (and the community at-large) always derive > from Object as your base class? Uhh, yep? It kinda happens automatically for me:

Re: Python in XKCD today

2013-09-11 Thread Jugurtha Hadjar
On 09/11/2013 02:09 PM, Roy Smith wrote: http://xkcd.com/1263/ Nice one! -- ~Jugurtha Hadjar, -- https://mail.python.org/mailman/listinfo/python-list

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread Jugurtha Hadjar
On 09/11/2013 08:33 PM, William Bryant wrote: @Jugurtha Hadjar What does user_input.lower() mean/do? Hello, As did other people point out, it returns the lower case of a string. It's not user_input.lower(), it's any_string.lower() For example: Try this on your python prompt mystring = "T

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread Jugurtha Hadjar
On 09/12/2013 02:08 AM, Jugurtha Hadjar wrote: Try this on your python prompt mystring = "ThIs Is ThE wAy SoMe StUpId PeOpLe WrItE i DoN't KnOw WhY!" mystring.lower() This should return: "You shouldn't treat people of stupid, but I feel your pain", or let's be more realistic: "this is th

Re: Language design

2013-09-11 Thread Steven D'Aprano
On Thu, 12 Sep 2013 10:31:26 +1000, Chris Angelico wrote: > On Thu, Sep 12, 2013 at 10:25 AM, Mark Janssen > wrote: >> Well now, this is an area that is not actually well-defined. I would >> say 16-bit Unicode is binary data if you're encoding in base 65,536, >> just as 8-bit ascii is binary da

Re: Language design

2013-09-11 Thread Roy Smith
In article <523127e2$0$29988$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > just 3 bits if you only cared about decimal digits. That's a neat trick. -- https://mail.python.org/mailman/listinfo/python-list

Re: Language design

2013-09-11 Thread Chris Angelico
On Thu, Sep 12, 2013 at 12:43 PM, Roy Smith wrote: > In article <523127e2$0$29988$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> just 3 bits if you only cared about decimal digits. > > That's a neat trick. It is! It's one of the fancy things we can do in the Land Downunder.

Parsing an html line and pulling out only numbers that meet a certain criteria

2013-09-11 Thread Cory Mottice
I am using line.rfind to parse a particular line of html code. For example, this is the line of html code I am parsing: 79°Lo 56° and this is the code I use to split the line to (in this case) pull out the '79'. position0 = line.rfind('{}'.format(date1.strftime("%a"))) if position0 > 0 :

Re: Language design

2013-09-11 Thread Joshua Landau
On 11 September 2013 11:38, Burak Arslan wrote: > On 09/10/13 09:09, Steven D'Aprano wrote: >> What design mistakes, traps or gotchas do you think Python has? > > My favourite gotcha is this: > > elt, = elts > > It's a nice and compact way to do both: > > assert len(elts) == 0 > elt =

Re: Python GUI?

2013-09-11 Thread Michael Torrie
On 09/11/2013 02:55 PM, eamonn...@gmail.com wrote: > PyQT -- You have a GUI designer, so I'm not going to count that What do you mean? Gtk has a GUI designer too. what of it? > I, personally, really like wxPython, but I also really like Tkinter. > I've messed with PyGTK, but I'd choose wxPython

Re: Language design

2013-09-11 Thread Steven D'Aprano
On Wed, 11 Sep 2013 22:43:20 -0400, Roy Smith wrote: > In article <523127e2$0$29988$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> just 3 bits if you only cared about decimal digits. > > That's a neat trick. Well obviously it's compressed. :-) Sorry for the typo, I mean

Re: Language design

2013-09-11 Thread Steven D'Aprano
By the way, please keep attributions for those you are quoting. It is rude otherwise. On Wed, 11 Sep 2013 17:49:09 -0700, Mark Janssen wrote: >>> 1) It tried to make Object the parent of every class. >> >> Tried, and succeeded. > > Really? Are you saying you (and the community at-large) alway

Re: Parsing an html line and pulling out only numbers that meet a certain criteria

2013-09-11 Thread John Gordon
In Cory Mottice writes: > I am using line.rfind to parse a particular line of html code. For example, > this is the line of html code I am parsing: > 79° class="low">Lo 56° > and this is the code I use to split the line to (in this case) pull out the > '79'. > position0 = line.rfind('{}'.f

Re: Help please, why doesn't it show the next input?

2013-09-11 Thread William Bryant
Thanks everyone for helping but I did listen to you :3 Sorry. This is my code, it works, I know it's not the best way to do it and it's the long way round but it is one of my first programs ever and I'm happy with it: '''#*'

Accessing class attribute

2013-09-11 Thread chandan kumar
Hi , I'm new to python ,please correct me if there is any thing wrong with the way accessing class attributes. Please see the below code .I have inherited confid in ExpectId class, changed self.print_msg to Hello. Now inherited confid in TestprintmsgID class.Now I wanted to print self.print

Re: Accessing class attribute

2013-09-11 Thread Peter Otten
chandan kumar wrote: > Hi , > > I'm new to python ,please correct me if there is any thing wrong with the > way accessing class attributes. > > Please see the below code .I have inherited confid in ExpectId class, > changed self.print_msg to Hello. Now inherited confid in TestprintmsgID > clas