Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Monday, December 16, 2013 2:48:56 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > > > On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > > > > > > > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > > > > > > > > >

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > > > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > > > > > On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano > > > > > > > > > > > > > >

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 6:43 PM, Mark wrote: > Syntax Error: invalid syntax python twitch.py 10 10 >File " line 1 > python twitch.py 10 10 You're trying to run that from the interactive Python prompt. Run it from the system - exit Python and run just this script. ChrisA -- https://

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano > > > > > > wrote: > > > > > > > Step 1: replace the modified version of the script with a known good cop

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 6:09 PM, Mark wrote: > Traceback (most recent call last): > File "C:\Python27\Scripts\Twitch.py", line 9, in > numberOfViewers = int(sys.argv[1]) > IndexError: list index out of range > > Is this where i would plug in the variables to make it work? I'm not quite > s

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano > > wrote: > > > Step 1: replace the modified version of the script with a known good copy. > > > > > > > Actually, this might be where the problem is, unfortunately. Not

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Ben Finney
Chris Angelico writes: > On Mon, Dec 16, 2013 at 3:50 PM, Ben Finney > wrote: > > Should we expect (ignoring pathological cases) the assertion > > ‘type(obj) is obj.__class__’ to hold true? If not, under what > > circumstances would it be sensible for those to differ? > > By "pathological cases

Need Help with the BeautifulSoup problem, please

2013-12-15 Thread seaspeak
I need to replace all tag with after ■. But the result from below is '■ D / ' Can you explain what I did wrong, please. s = '■A B C D / ' soup = BeautifulSoup(s) for i in soup.find_all(text='■'): tag = soup.new_tag('span') tag['style'] = 'REPLACE' for i

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Devin Jeanpierre
On Sun, Dec 15, 2013 at 8:50 PM, Ben Finney wrote: > Should we expect (ignoring pathological cases) the assertion > ‘type(obj) is obj.__class__’ to hold true? If not, under what > circumstances would it be sensible for those to differ? They differ on old-style classes (in 2.x): the type will be e

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 12:38:14 UTC+8, shengjie...@live.com wrote: > Hi guys, I am trying to create a fixed list which would allow my values to be > wrapped around it. > > For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 > > I need to create a list which contains 4 numbers and when the n

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 13:10:22 UTC+8, Gary Herron wrote: > On 12/15/2013 08:38 PM, shengjie.sheng...@live.com wrote: > > > Hi guys, I am trying to create a fixed list which would allow my values to > > be wrapped around it. > > > For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 > > > I

Re: Wrapping around a list in Python.

2013-12-15 Thread Gary Herron
On 12/15/2013 08:38 PM, shengjie.sheng...@live.com wrote: Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 I need to create a list which contains 4 numbers and when the number exceeds the list, it

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 13:07:46 UTC+8, shengjie...@live.com wrote: > On Monday, 16 December 2013 12:59:32 UTC+8, Ben Finney wrote: > > > shengjie.sheng...@live.com writes: > > > > > > > > > > > > > Hi guys, I am trying to create a fixed list which would allow my > > > > > > > valu

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 3:50 PM, Ben Finney wrote: > Should we expect (ignoring pathological cases) the assertion > ‘type(obj) is obj.__class__’ to hold true? If not, under what > circumstances would it be sensible for those to differ? By "pathological cases", do you mean arbitrarily changing obj

Re: Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
On Monday, 16 December 2013 12:59:32 UTC+8, Ben Finney wrote: > shengjie.sheng...@live.com writes: > > > > > Hi guys, I am trying to create a fixed list which would allow my > > > values to be wrapped around it. > > > > This doesn't make a lot of sense to me, but I assume you have a purpose

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 3:51 PM, Michael Torrie wrote: > I think Python is a great overall application development language, > especially for the GUI. First-class functions for callbacks make it > very nice compared to other languages. Python is fast enough for > full-blown apps too. Slow part

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 3:09 PM, Tamer Higazi wrote: > I also believe in performance. An application written in C++, can be > compiled easily on the target platform (like on windows systems) with it's > native compiler. > How would it be with wxPython ?! It's going to spend more than 99% of its t

Re: Wrapping around a list in Python.

2013-12-15 Thread Ben Finney
shengjie.sheng...@live.com writes: > Hi guys, I am trying to create a fixed list which would allow my > values to be wrapped around it. This doesn't make a lot of sense to me, but I assume you have a purpose in mind for this. What is the purpose? Perhaps it will help the explanation if we know wh

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 09:51 PM, Michael Torrie wrote: > And all modern web apps are a combination of many languages and > domains, most of which are "compiled" in the traditional sense. Meant to say, *not* compiled. -- https://mail.python.org/mailman/listinfo/p

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 09:09 PM, Tamer Higazi wrote: > However, I believe according wxWidgets it would be better coding in the > native language the system had been developed. > The other thing, specially if you would make a customer project, I don't > know how to pack the app written in python in an inst

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 05:34 PM, Tamer Higazi wrote: > For wxPython there is a good book. > You will feel convinient. > > > But to be honest, I don't believe that Python is the best choice for GUI > development, but it's only an opinion. > Otherwise I would advise you going into C++ and code with wxWidge

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Ben Finney
Ned Batchelder writes: > Generally, my answer would be, "You probably don't need the type as > much as you think you do." > […] > Also, don't overlook isinstance(). Agreed. > But when you do need it, type(x) is better than x.__class__, simply > because we should always favor builtin functions

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Tamer Higazi
Hi Mark! It is an advise, in which language somebody wants to code is of course everybodys free choice. However, I believe according wxWidgets it would be better coding in the native language the system had been developed. The other thing, specially if you would make a customer project, I don

Wrapping around a list in Python.

2013-12-15 Thread shengjie . shengjie
Hi guys, I am trying to create a fixed list which would allow my values to be wrapped around it. For example i have 10 values : 0,1,2,3,4,5,6,7,8,9 I need to create a list which contains 4 numbers and when the number exceeds the list, it would overwrite the first value. [0,1,2,3] [4,1,2,3] [5,4,1

Want guidance to set proxy please help

2013-12-15 Thread Jai
hey i am working on parsing like project . so , i need some step to set proxy so that my ip is not blocked by them += i am using this method proxy_support = urllib2.ProxyHandler({"http":"http://61.147.82.87:8000"}) opener = urllib2.build_opener(proxy_support) u

Re: Eliminate "extra" variable

2013-12-15 Thread Igor Korot
Hi, I have the same result even with: sqlite3.connect(r'...') Any other alternatives? Thank you. On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote: > On 15/12/2013 22:46, Igor Korot wrote: >> >> Tim, >> >> On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase >> wrote: >>> >>> On 2013-12-15 06:17, Tim Chase

Re: a question about list as an element in a tuple

2013-12-15 Thread rusi
On Monday, December 16, 2013 9:27:11 AM UTC+5:30, Chris Angelico wrote: > On Mon, Dec 16, 2013 at 2:30 PM, liuerfire Wang wrote: > > TypeError: 'tuple' object does not support item assignment > > In [5]: a > > Out[5]: ([1, 1], []) > > no problem, there is an exception. But a is still changed. > >

Re: a question about list as an element in a tuple

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 2:30 PM, liuerfire Wang wrote: > TypeError: 'tuple' object does not support item assignment > > In [5]: a > Out[5]: ([1, 1], []) > > no problem, there is an exception. But a is still changed. > > is this a bug, or could anyone explain it? It's not a bug, but it's a bit con

a question about list as an element in a tuple

2013-12-15 Thread liuerfire Wang
Just like below: In [1]: a = ([], []) In [2]: a[0].append(1) In [3]: a Out[3]: ([1], []) In [4]: a[0] += [1] --- TypeError Traceback (most recent call last) in () > 1 a[0] += [1] TypeEr

Re: Comparing values of counter in python 3.3

2013-12-15 Thread rusi
On Monday, December 16, 2013 8:10:57 AM UTC+5:30, Roy Smith wrote: > rusi wrote: > > On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote: > > > > # Need to compare values of counter and reject in function/routine in > > > > value in counter2 is higher then value in counter1 for a cur

Re: Eliminate "extra" variable

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 1:43 PM, Igor Korot wrote: > So, how do I convert my string to one of those? > I realized I can just do replace '/' to '\', but is there a better > alternative? The path is exactly the same, whether you use forward slashes or backslashes, on Windows. Most of the world use

Re: Eliminate "extra" variable

2013-12-15 Thread Dave Angel
On Sun, 15 Dec 2013 18:43:53 -0800, Igor Korot wrote: On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote: > When writing paths on Windows, it's a good idea to use raw string > literals or slashes instead of backslashes: > > conn = sqlite3.connect(r'c:\Documents and > Settings\Igor.FORDANWORK

Re: Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Ned Batchelder
On 12/15/13 8:51 PM, Ben Finney wrote: Howdy all, What is the Pythonic way to determine the type of an object? Are there multiple valid ways, and when should each be used? We have ‘obj.__class__’, an attribute bound to the object's class. Or is it? When is that true, and when should we not rely

Re: Comparing values of counter in python 3.3

2013-12-15 Thread Roy Smith
In article <905d6e7e-6748-42dd-8b63-d80a4d175...@googlegroups.com>, rusi wrote: > On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote: > > > # Need to compare values of counter and reject in function/routine in > > > value in counter2 is higher then value in counter1 for a current ke

Re: Eliminate "extra" variable

2013-12-15 Thread Igor Korot
Hi, On Sun, Dec 15, 2013 at 4:58 PM, MRAB wrote: > On 15/12/2013 22:46, Igor Korot wrote: >> >> Tim, >> >> On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase >> wrote: >>> >>> On 2013-12-15 06:17, Tim Chase wrote: > > conn = sqlite3.connect('x.sqlite', >> >> ... detect_types=sqli

Re: Comparing values of counter in python 3.3

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 1:32 PM, rusi wrote: > But 'counter' is a strange name -- after checking whether > 'bag' and 'multiset' are there in the library, I would not think to > check anything else. Which is why we have this list. Question: Is there a way to do x, y, and z, in Python? Answer: Chec

Re: Comparing values of counter in python 3.3

2013-12-15 Thread rusi
On Monday, December 16, 2013 7:29:31 AM UTC+5:30, alex23 wrote: > > # Need to compare values of counter and reject in function/routine in value > > in counter2 is higher then value in counter1 for a current key > [(k,Counter2[k]) for k in Counter2 - Counter1] Why not just? Counter2 - Count

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano wrote: > Step 1: replace the modified version of the script with a known good copy. > Actually, this might be where the problem is, unfortunately. Not the OP's fault at all. I went and looked at the post linked to, and it has buggy indentation. (Q

Re: Comparing values of counter in python 3.3

2013-12-15 Thread alex23
On 12/12/2013 5:49 PM, Amjad Syed wrote: Hello, I have 2 counters generated from list using Collections.counter() I want to print only key,values in Counter2 which have values > then corresponding value in Counter1. E.g Counter1={97:1,99:2,196:2,198:1} Counter2={97:1 ,99:3, 196:1,198:1} # O

Type of an object: ‘obj.__class__’ versus ‘type(obj)’

2013-12-15 Thread Ben Finney
Howdy all, What is the Pythonic way to determine the type of an object? Are there multiple valid ways, and when should each be used? We have ‘obj.__class__’, an attribute bound to the object's class. Or is it? When is that true, and when should we not rely on it? We have ‘type(obj)’, calling the

Re: New to Python, Help to get script working?

2013-12-15 Thread Steven D'Aprano
On Sun, 15 Dec 2013 13:31:10 -0800, Mark wrote: > I originally get an indent error on line 19, i delete the indent and i > get > > ***'return outside function (Twitch.py, line 19) > > Thats where i am at. This is on version 2.7 Remember the bit where we asked you to copy and paste the entire e

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Mark Lawrence
On 16/12/2013 00:34, Tamer Higazi wrote: But to be honest, I don't believe that Python is the best choice for GUI development, but it's only an opinion. Otherwise I would advise you going into C++ and code with wxWidgets. Tamer Can you state why you prefer C++ and wxWidgets over Python and w

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Tamer Higazi
For wxPython there is a good book. You will feel convinient. But to be honest, I don't believe that Python is the best choice for GUI development, but it's only an opinion. Otherwise I would advise you going into C++ and code with wxWidgets. Tamer On 14.12.2013 14:12, Jai wrote: GUI:-want

Re: Eliminate "extra" variable

2013-12-15 Thread MRAB
On 15/12/2013 22:46, Igor Korot wrote: Tim, On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase wrote: On 2013-12-15 06:17, Tim Chase wrote: conn = sqlite3.connect('x.sqlite', ... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) Your example code omitted this one crucial line. Do you s

Re: Is it more CPU-efficient to read/write config file or read/write sqlite database?

2013-12-15 Thread Tim Chase
On 2013-12-16 10:12, Cameron Simpson wrote: > On 14Dec2013 10:15, Tim Chase wrote: > Annoyingly, sqlite: > > + only lets one process access the db at a time, taking you back > to a similar situation as with config files Is this a Python limitation? According to the docs[1], it's not a sqlite

Re: Is it more CPU-efficient to read/write config file or read/write sqlite database?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 10:12 AM, Cameron Simpson wrote: > + traditionally, sqlite is extreme fsync() happy; forces a disc > level flush on each commit - extremely slow on busy databases, > not to mention hard of drives I'd say that's correct behaviour. A commit should be sync'd to disk

Re: Is it more CPU-efficient to read/write config file or read/write sqlite database?

2013-12-15 Thread Cameron Simpson
On 14Dec2013 10:15, Tim Chase wrote: > On 2013-12-14 07:29, JL wrote: > > I have a number of python processes which communicate with each > > other through writing/reading config text files. The python > > ConfigParser is used. I am wondering if it is more CPU-efficient to > > switch to using sqli

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 9:42 AM, Grant Edwards wrote: > Good point -- I meant send(). I keep forgetting that the libc socket > write() operation is missing in Python and only the send() call has > been made visible. In C write() and send() are effectively the same > thing (the parameters are arra

Re: Eliminate "extra" variable

2013-12-15 Thread Igor Korot
Tim, On Sun, Dec 15, 2013 at 4:29 AM, Tim Chase wrote: > On 2013-12-15 06:17, Tim Chase wrote: >>> conn = sqlite3.connect('x.sqlite', ... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) >> >> Your example code omitted this one crucial line. Do you specify the >> detect_types

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Grant Edwards
On 2013-12-15, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> UDP is a a _datagram_ service. Either all the bytes in a write() >> should get sent or none of them. Sending a paritial datagram is _not_ >> a valid option. > > I would agree with the above if you said send() instead of

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 8:31 AM, Mark wrote: > I originally get an indent error on line 19, i delete the indent and i get > > ***'return outside function (Twitch.py, line 19) Good point, someone's made a mistake in that file. What you need to do is match the "output = ..." line and the "return ..

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 4:01 AM, Steven D'Aprano wrote: > As I stated earlier, this is just the Interpreter design pattern, with > the minor complication that the domain specific language happens to be an > existing language, Tcl, with an interpreter that usually runs in a > separate process, inst

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Sunday, December 15, 2013 4:19:47 PM UTC-5, Mark wrote: > Thanks for the replies, I was hoping that one of you guys could actually try > it for me, as it might be easier to correct? In the meantime i will install > 2.7 instead of 3.3 and give it a try. > > > > Once again, i have very little

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
Thanks for the replies, I was hoping that one of you guys could actually try it for me, as it might be easier to correct? In the meantime i will install 2.7 instead of 3.3 and give it a try. Once again, i have very little experience in this, which is why i am looking for help :) I am more worri

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Dan Stromberg
On Sun, Dec 15, 2013 at 7:35 AM, Jean Dubois wrote: >> You can "svn checkout ". You might try Sliksvn if you're on >> Windows, or if you're on Linux it's in synaptic or yum or whatever. >> You can "wget ". >> You can bring up the URL in a web browser and cut and paste. > I'm using Linux, I did t

Re: a Python Static Analyzer

2013-12-15 Thread Mark Lawrence
On 15/12/2013 20:25, arie.lake...@gmail.com wrote: On Sunday, 15 December 2013 02:36:56 UTC, Chris Rebert wrote: On Sat, Dec 14, 2013 at 5:31 PM, Dan Stromberg wrote: Where does PySonar2 sit in the spectrum from pylint (thorough/pedantic) to pyflakes (relaxed/few-false-positives)?

Re: a Python Static Analyzer

2013-12-15 Thread arie . lakeman
On Sunday, 15 December 2013 02:36:56 UTC, Chris Rebert wrote: > On Sat, Dec 14, 2013 at 5:31 PM, Dan Stromberg wrote: > > > Where does PySonar2 sit in the spectrum from pylint > > > (thorough/pedantic) to pyflakes (relaxed/few-false-positives)? > > > > > > I use pylint and pyflakes a lot, and

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Mark Lawrence
On 15/12/2013 17:52, Chris “Kwpolska” Warrick wrote: On Sun, Dec 15, 2013 at 4:33 PM, Wolfgang Keller wrote: And besides, again, a commercially licensed PyQt itself isn't *that* expensive. The cost of a commercial PyQt license for a single developer is £350 (GBP). You may pay in either US Do

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Chris “Kwpolska” Warrick
On Sun, Dec 15, 2013 at 4:33 PM, Wolfgang Keller wrote: > And besides, again, a commercially licensed PyQt itself isn't *that* > expensive. > The cost of a commercial PyQt license for a single developer is £350 > (GBP). You may pay in either US Dollars, Euros or GBP. (£420 incl. VAT for UK and s

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Dec 16, 2013 at 2:51 AM, Roy Smith wrote: > > In article , > > Grant Edwards wrote: > > > >> UDP is a a _datagram_ service. Either all the bytes in a write() > >> should get sent or none of them. Sending a paritial datagram is _not_ > >> a valid op

Re: Python for IPSA (Power flow analysis)

2013-12-15 Thread muhamadwahidi
Pada Selasa, 28 Mei 2013 17:00:42 UTC+7, Debbie menulis: > Hi there, > > I am new to Python, and wondering if you could help me with python based > coding for the IPSA (Power system analysis software). I have a electrical > distribution network with generators, buses and loads, on which I am >

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Michael Torrie
On 12/15/2013 08:33 AM, Wolfgang Keller wrote: >> I think PyQt is slowly being pushed aside in favor of PySide, which is >> more license-friendly for use in closed or open projects. I would >> recommend using PySide unless PyQt is a requirement for your project. > > Except the issue that Pyside a

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Steven D'Aprano
On Sun, 15 Dec 2013 14:53:45 +, Grant Edwards wrote: > On 2013-12-14, Steven D'Aprano > wrote: > >> But more seriously, 100% seriously in fact, I think that you'll find >> that *every* GUI framework for Python ships with an entirely different >> language under the hood, usually C. > > Name

Re: collections Counter most_common method

2013-12-15 Thread Mark Lawrence
On 14/12/2013 19:42, Peter Otten wrote: Mark Lawrence wrote: This method returns a list, the example from The Fine Docs being:- >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] With the trend in Python being more and more towards methods returning iterators, is there

SQLObject 1.5.1

2013-12-15 Thread Oleg Broytman
Hello! I'm pleased to announce version 1.5.1, the first bugfix release of branch 1.5 of SQLObject. What's new in SQLObject === * SQLiteConnection.close() now closes and reopens a connection to in-memory database. Contributor for this release is Maciej (Matchek) Blizinski.

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 2:51 AM, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> UDP is a a _datagram_ service. Either all the bytes in a write() >> should get sent or none of them. Sending a paritial datagram is _not_ >> a valid option. > > I would agree with the above if you said s

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Roy Smith
In article , Grant Edwards wrote: > UDP is a a _datagram_ service. Either all the bytes in a write() > should get sent or none of them. Sending a paritial datagram is _not_ > a valid option. I would agree with the above if you said send() instead of write(). Python socket objects don't have

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 2:35 AM, Jean Dubois wrote: > I'm using Linux, I did the following: > svn checkout http://stromberg.dnsalias.org/svn/bufsock/ > which resulted in a directory 'bufsock' being added to my home-directory, > Do I have to run further commands on the files in this directory? > Ho

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Jean Dubois
Op zondag 15 december 2013 02:03:14 UTC+1 schreef Dan Stromberg: > On Sat, Dec 14, 2013 at 5:33 AM, Jean Dubois wrote: > > Op vrijdag 13 december 2013 16:35:31 UTC+1 schreef Jean-Michel Pichavant: > >> - Original Message - > >> > I have an ethernet-rs232 adapter which allows me to connect

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Wolfgang Keller
> I think PyQt is slowly being pushed aside in favor of PySide, which is > more license-friendly for use in closed or open projects. I would > recommend using PySide unless PyQt is a requirement for your project. Except the issue that Pyside always seems to lag a bit behind Qt releases, while PyQ

Re: New to Python, Help to get script working?

2013-12-15 Thread Denis McMahon
On Sat, 14 Dec 2013 20:51:59 -0800, Mark wrote: > I have successfully installed python 3.3 for windows, pip and > livestreamer that is needed for it to work. They are in my scripts > folder. I either do not understand the script or it no longer works. It > is more than likely my error. I get error

Re: [newbie] trying socket as a replacement for nc

2013-12-15 Thread Grant Edwards
On 2013-12-15, Dan Stromberg wrote: > On Fri, Dec 13, 2013 at 8:06 AM, Grant Edwards > wrote: >> On 2013-12-12, Dan Stromberg wrote: Just to be pedantic: _TCP_ sockets reserve that right. UDP sockets do not, and do in fact guarantee that each message is discrete. [It appears t

Re: GUI:-please answer want to learn GUI programming in python , how should i proceed.

2013-12-15 Thread Grant Edwards
On 2013-12-14, Steven D'Aprano wrote: > But more seriously, 100% seriously in fact, I think that you'll find that > *every* GUI framework for Python ships with an entirely different > language under the hood, usually C. Name one GUI framework that ships with a C implementation. > Even if the

Re: CP65001 fails (was re: ...)

2013-12-15 Thread Mark Lawrence
On 15/12/2013 04:48, Chris Angelico wrote: On Sun, Dec 15, 2013 at 3:42 PM, rusi wrote: To me all this GG complaining sounds like some elderly mom-pop-uncle who weeps/coaxes/moans/pleads/grumbles/ about a fused light bulb, rather than climbing on a stool and changing the bloody thing. No, it'

Re: Eliminate "extra" variable

2013-12-15 Thread Tim Chase
On 2013-12-15 06:17, Tim Chase wrote: >> conn = sqlite3.connect('x.sqlite', >>>... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) > > Your example code omitted this one crucial line. Do you specify the > detect_types parameter to connect()? It's really the PARSE_DECLTYPES that

Re: Eliminate "extra" variable

2013-12-15 Thread Tim Chase
On 2013-12-14 23:49, Igor Korot wrote: > Tim, > > On Sun, Dec 8, 2013 at 2:18 PM, Tim Chase wrote: > conn = sqlite3.connect('x.sqlite', >>... detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES) Your example code omitted this one crucial line. Do you specify the detect_types paramete

Re: CP65001 fails (was re: ...)

2013-12-15 Thread wxjmfauth
Le dimanche 15 décembre 2013 06:07:09 UTC+1, Terry Reedy a écrit : > On 12/14/2013 9:39 PM, Steven D'Aprano wrote: > > > On Sat, 14 Dec 2013 13:43:41 -0500, Terry Reedy wrote: > > > > > >> This was reported by Victor Stinner as part of > > >> http://bugs.python.org/issue19914 > > >> to explain