Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Steven D'Aprano
On Tue, 17 Dec 2013 22:49:43 -0500, Paul Smith wrote: > On Wed, 2013-12-18 at 01:33 +, Steven D'Aprano wrote: >> And "What does 'implementation-specific undefined behaviour' actually >> mean in practice?", another common question when dealing with C. > > Only asked by people who haven't had i

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Steven D'Aprano
On Wed, 18 Dec 2013 13:11:58 +1100, Chris Angelico wrote: > On Wed, Dec 18, 2013 at 12:33 PM, Steven D'Aprano > wrote: >> On Tue, 17 Dec 2013 19:32:20 -0500, Roy Smith wrote: >> >>> There's very few mysteries in C. >> >> Apart from "What the hell does this piece of code actually do?". It's >> no

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 7:22 PM, Steven D'Aprano wrote: >> Well, okay. In C you can't have Foo.foo(). > > Hah, well according to Paul Smith's example code you can. So either: > > > - it's possible to be an experienced C programmer and still have > fundamental gaps in your knowledge about basic con

Re: Windows+Python: Why is the first opened window not shown active?

2013-12-18 Thread asmwarrior
On 2013-12-18 14:35, asmwarrior wrote: > Hello, Python community. > > I have found a very strange problem about using the python scripts under > Python Windows command line prompt, to reproduce this issue, you can simply > do those steps: > > 1. start a Python command line prompt(this is usually

CAPTCHA HANDLING IN MECHANIZE

2013-12-18 Thread Jai
HEY , I AM NEW TO THE PYTHON STARTED WORKING ON MECHANIZE , WANT HELP THAT TO HOW TO FILL A FORM HAVING CAPTCHA FIELD AUTOMATIC PLEASE ANSWER -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 7:18 PM, Steven D'Aprano wrote: > You want to know why programs written in C are so often full of security > holes? One reason is "undefined behaviour". The C language doesn't give a > damn about writing *correct* code, it only cares about writing > *efficient* code. Conseq

Re: CAPTCHA HANDLING IN MECHANIZE

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 7:35 PM, Jai wrote: > HEY , I AM NEW TO THE PYTHON > > STARTED WORKING ON MECHANIZE , WANT HELP THAT TO HOW TO FILL A FORM HAVING > CAPTCHA FIELD AUTOMATIC > > > PLEASE ANSWER Not going to help you. The whole point of a CAPTCHA is to stop you from doing this sort of thi

C langauge recvmmsg() function in Python

2013-12-18 Thread justhotshot
Hi All, Is there a C langauge recvmmsg() function (receive multiple messages on a socket) equivalent in python? recvmmsg details url: http://man7.org/linux/man-pages/man2/recvmmsg.2.html Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Windows+Python: Why is the first opened window not shown active?

2013-12-18 Thread Tim Golden
On 18/12/2013 06:35, asmwarrior wrote: > 1. start a Python command line prompt(this is usually to hit the Start > Menu->Python 2.7->Python(command line). > 2. > > type the following text, and hit Enter key. > > |import ctypes| > > 3. > > type the following text, and hit Enter

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread rusi
On Tuesday, December 17, 2013 4:42:07 PM UTC+5:30, Oscar Benjamin wrote: > On 17 December 2013 00:39, rusi wrote: > > I had a paper some years ago on why C is a horrible language *to teach with* > > http://www.the-magus.in/Publications/chor.pdf > Thanks for this Rusi, I just read it and it describ

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

2013-12-18 Thread wxjmfauth
Le mardi 17 décembre 2013 20:00:14 UTC+1, wxjm...@gmail.com a écrit : > Le mardi 17 décembre 2013 19:06:35 UTC+1, Michael Torrie a écrit : > > > On 12/17/2013 08:00 AM, Wolfgang Keller wrote: > > > > > > >> Python is sooo slow when it waits for the human. > > > > > > > > > > > > > >

HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Jai
RIGHT NOW NOW I AM WORKING WITH MECHANIZE MODULE . BUT UNABLE TO SUBMIT CAPTACHA AUTOMATICALLY . DO U HAVE ANY IDEA PLEASE SHARE WITH ME , ANY IDEA WILL BE APPRECIATES ON ANY M MODULE. -- https://mail.python.org/mailman/listinfo/python-list

Re: Logger module in python

2013-12-18 Thread Jean-Michel Pichavant
Original Message - > On Wednesday, December 18, 2013 8:52:11 AM UTC+5:30, > smileso...@gmail.com wrote: > > Hi, > > I am a newbie in python. I am looking for a existing module which > > I can import in my program to log the objects to a file? > > > I know there is a module Data::Dumpe

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Oscar Benjamin
On 18 December 2013 09:18, rusi wrote: >> (BTW is there any reason that the document is repeated twice in the same >> pdf?) > > Thanks for the heads-up -- some pdf generation issues I guess > > Is it ok now? Yes. Also it definitely reads better without the twocolumn format. Oscar -- https://m

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

2013-12-18 Thread Cameron Simpson
On 18Dec2013 14:35, Chris Angelico wrote: > On Wed, Dec 18, 2013 at 1:37 PM, Cameron Simpson wrote: > >> I'd say this is the right thing for a DB to do. If it comes back > >> from a commit() call, it better be on that disk, barring a failure > >> of the physical hardware. If it comes back from

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

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 9:31 PM, Cameron Simpson wrote: > On 18Dec2013 14:35, Chris Angelico wrote: >> An SQL database *is* a different form of storage. It's storing tabular >> data, not a stream of bytes in a file. You're supposed to be able to >> treat it as an efficient way to locate a particu

Re: Type of an object:

2013-12-18 Thread Gregory Ewing
Steven D'Aprano wrote: It's the *non-class* part I reckon is an accident, or a bug. Telling me that weakproxy sets __class__ to a *class* doesn't argue for or against me. I wouldn't describe what weakref.proxy is doing as *setting* __class__ to anything. Rather, it's arranging things so that w

Re: Type of an object:

2013-12-18 Thread Gregory Ewing
Ethan Furman wrote: This leads to another question: we've now seen two examples where (presumably) the internal type field and __class__ differ. In the weakproxy case, type(obj) returns the internal type field. In the "regular" case, where you set obj.__class__ to a class, type(obj) returns the n

python - jquery datatables with mongodb(mongoengine)

2013-12-18 Thread techno206
I am new to Python, MongoDB(mongoengine(ODM)) and the pyramid framework as a whole. I am currently working on a project using the above mentioned technologies and I want to use jQuery datatables(also new to this) I found a link on their site on how to use datatables with MongoDB, but it is in

Re: python - jquery datatables with mongodb(mongoengine)

2013-12-18 Thread techno206
please reply here: http://stackoverflow.com/questions/20656134/python-jquery-datatables-with-mongodbmongoengine -- https://mail.python.org/mailman/listinfo/python-list

Re: Struggling for inspiration with lists

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - > Hi > > I have a list of data that presents as: > > timestamp: value > > Timestamps are used solely to determine the sequence of items in the > list. > > I want to find the longest repeated sequence of values in the list. > Example, in the following list: > > data

Re: seeking a framework to automate router configurations

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - > Hi Pythoners, > I'm looking for a tool or framework in which I can do a slight > modification to achieve the following task: > "Asynchronously reset a large number of cisco routers back to their > original configurations and push prepared initial configurations to

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Dave Angel
On 18 Dec 2013 08:22:58 GMT, Steven D'Aprano wrote: On Wed, 18 Dec 2013 13:11:58 +1100, Chris Angelico wrote: > The one differentiation that I don't like is between the . and -> > operators. The distinction feels like syntactic salt. There's no context > when both are valid, save in C++ where

how to handle captcha through machanize module or any module

2013-12-18 Thread Jai
please do replay how to handle captcha through machanize module -- https://mail.python.org/mailman/listinfo/python-list

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

2013-12-18 Thread Jean Dubois
Op dinsdag 17 december 2013 10:37:37 UTC+1 schreef Jean-Michel Pichavant: > > I'm a newbie in Python programming that is very much true, and > > contrary to what you seem to suggest I did my homework > At no point that was my intention, my apologies. OK, no problem > If you fixed the syntax error,

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Jai
#/usr/bin/env python import mechanize, re import cookielib import cgi import urllib2 from random import choice def get_domain(url): return urlparse.urlparse(url).netloc if __name__=="__main__": br = mechanize.Browser() cj = cookielib.LWPCookieJar() br.set_proxies({"http": "217.174

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Robert Kern
On 2013-12-18 12:56, Jai wrote: please do replay how to handle captcha through machanize module You've asked the same question twice now. You have received the only answer that you are going to get here: we won't help you do this. We may help you learn to do other stuff with Python, but not t

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 8:29 AM, Robert Kern wrote: > On 2013-12-18 12:56, Jai wrote: > >> please do replay how to handle captcha through machanize module >> > > You've asked the same question twice now. You have received the only > answer that you are going to get here: we won't help you do this

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

2013-12-18 Thread Jean Dubois
Op woensdag 18 december 2013 14:04:08 UTC+1 schreef Jean Dubois: > Op dinsdag 17 december 2013 10:37:37 UTC+1 schreef Jean-Michel Pichavant: > > > I'm a newbie in Python programming that is very much true, and > > > contrary to what you seem to suggest I did my homework > > At no point that was my

Re: C langauge recvmmsg() function in Python

2013-12-18 Thread Roy Smith
In article <11b3f519-e0d6-40c3-a73d-aa673b225...@googlegroups.com>, justhots...@gmail.com wrote: > Hi All, > > Is there a C langauge recvmmsg() function (receive multiple messages on a > socket) equivalent in python? > recvmmsg details url: http://man7.org/linux/man-pages/man2/recvmmsg.2.html

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Chris Angelico
On Thu, Dec 19, 2013 at 1:48 AM, Joel Goldstick wrote: > So, what you need to do is show a small coding example of the problem you > are having. Give the OS, the python version, and copy the traceback if > there is an error. And give a good solid reason why you need to automate a CAPTCHA, becaus

Re: Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 11:53 PM, Dave Angel wrote: > Funny you should say that in the middle of a discussion about lifetime. In > C, when you do the -> thing, you're now in a different struct with a > potentially different lifetime. If p is a local, with auto lifetime, then > so is p.x > > So

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Neil Cerutti
On 2013-12-18, Chris Angelico wrote: > On Wed, Dec 18, 2013 at 11:53 PM, Dave Angel wrote: >> Funny you should say that in the middle of a discussion about >> lifetime. In C, when you do the -> thing, you're now in a >> different struct with a potentially different lifetime. If p >> is a local,

RE: Use of urllib (update)

2013-12-18 Thread Jeff James
Folks, I promise I'll get to the point where my questions aren't so basic, but I'm just now starting to get into Python. So I'm using the urllib script to check to make sure our company sites are up. As stated earlier, I have three sites which require some form of authentication in order to repo

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Ethan Furman
On 12/18/2013 12:18 AM, Steven D'Aprano wrote: On Tue, 17 Dec 2013 22:49:43 -0500, Paul Smith wrote: On Wed, 2013-12-18 at 01:33 +, Steven D'Aprano wrote: On 12/17/2013 04:32 PM, Roy Smith wrote: You never have to wonder what the lifetime of an object is, Since C isn't object oriented,

Re: Use of urllib (update)

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 10:16 AM, Jeff James wrote: > Folks, I promise I'll get to the point where my questions aren't so basic, > but I'm just now starting to get into Python. So I'm using the urllib > script to check to make sure our company sites are up. As stated earlier, > I have three si

Re: HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Mark Lawrence
On 18/12/2013 09:37, Jai wrote: RIGHT NOW NOW I AM WORKING WITH MECHANIZE MODULE . BUT UNABLE TO SUBMIT CAPTACHA AUTOMATICALLY . DO U HAVE ANY IDEA PLEASE SHARE WITH ME , ANY IDEA WILL BE APPRECIATES ON ANY M MODULE. Ditto the Chris Angelico answer to your earlier request. -- My fellow Py

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

2013-12-18 Thread Mark Lawrence
On 18/12/2013 09:24, wxjmfa...@gmail.com wrote: [once again snip all the double spaced crap from google groups] Installation of PySide 1.2.1 for Py32, Py33 -> same effect. win32, shiboken, Visual Studio, Qt: ??? jmf The point of this is? -- My fellow Pythonistas, ask not what our languag

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread rusi
On Wednesday, December 18, 2013 8:53:54 PM UTC+5:30, Ethan Furman wrote: > On 12/18/2013 12:18 AM, Steven D'Aprano wrote: > > On Tue, 17 Dec 2013 22:49:43 -0500, Paul Smith wrote: > >> On Wed, 2013-12-18 at 01:33 +, Steven D'Aprano wrote: > >>> On 12/17/2013 04:32 PM, Roy Smith wrote: > Yo

Re: How to import Wave files into python?

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 11:45 AM, wrote: > How exactly do I import a .wav file and run it? > also is it possible to run it inside a while loop if so or it just start > playing when its run? - Tom 14 > -- > https://mail.python.org/mailman/listinfo/python-list > Hi. How exactly have you tried to

How to import Wave files into python?

2013-12-18 Thread twilkins50
How exactly do I import a .wav file and run it? also is it possible to run it inside a while loop if so or it just start playing when its run? - Tom 14 -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Mark Lawrence
On 18/12/2013 08:18, Steven D'Aprano wrote: The C99 standard lists 191 different kinds of undefined behavior, including what happens when there is an unmatched ' or " on a line of source code. No compile-time error, no run-time error, just blindingly fast and correct (according to the standard)

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

2013-12-18 Thread dick
On Wed, 18 Dec 2013 21:50:00 +1100, Chris Angelico wrote: >On Wed, Dec 18, 2013 at 9:31 PM, Cameron Simpson wrote: >> On 18Dec2013 14:35, Chris Angelico wrote: >>> An SQL database *is* a different form of storage. It's storing tabular >>> data, not a stream of bytes in a file. You're supposed t

Re: How to import Wave files into python?

2013-12-18 Thread ishish
How exactly do I import a .wav file and run it? also is it possible to run it inside a while loop if so or it just start playing when its run? - Tom 14 -- For the GUI (Tkinter) there is tkSnack. If you want to run it from the command line you could use sox. -- https://mail.python.org/mailman/lis

Re: HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Michael Torrie
On 12/18/2013 02:37 AM, Jai wrote: > All capital letters, at least in English, is considered to be angry yelling. As to you question, you won't find help with that here. Please don't ask again. -- https://mail.python.org/mailman/listinfo/python-list

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

2013-12-18 Thread Tim Chase
On 2013-12-18 09:49, dick wrote: > Don't forget that most hard disks have an option to cache the write > data. This is a 'feature' that allows the manufacturers to claim > better write performance. You can't be sure when the data is written > to the disk if that option is in play. However, my unde

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Grant Edwards
On 2013-12-18, Chris Angelico wrote: > Well, okay. In C you can't have Foo.foo(). If "Foo" is a structure with a field named "foo" that is a pointer to a function, then you can indeed "have" Foo.foo(). -- Grant Edwards grant.b.edwardsYow! It's OKAY -- I'm an

Re: How to import Wave files into python?

2013-12-18 Thread Jean-Michel Pichavant
- Original Message - > How exactly do I import a .wav file and run it? > also is it possible to run it inside a while loop if so or it just > start playing when its run? - Tom 14 > -- > https://mail.python.org/mailman/listinfo/python-list I think the pygame module should be able to do so.

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Grant Edwards
On 2013-12-18, Roy Smith wrote: > In article , > Grant Edwards wrote: > >> Ideally, you should also have written at least one functioning >> compiler before learning C as well. > > Why? I've never written a compiler. I've written plenty of C. I don't > see how my lack of compiler writing ex

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Mark Lawrence
On 18/12/2013 18:00, Grant Edwards wrote: On 2013-12-18, Chris Angelico wrote: Well, okay. In C you can't have Foo.foo(). If "Foo" is a structure with a field named "foo" that is a pointer to a function, then you can indeed "have" Foo.foo(). Complete fooey :) -- My fellow Pythonistas, as

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Michael Torrie
On 12/18/2013 07:51 AM, Chris Angelico wrote: > On Thu, Dec 19, 2013 at 1:48 AM, Joel Goldstick > wrote: >> So, what you need to do is show a small coding example of the problem you >> are having. Give the OS, the python version, and copy the traceback if >> there is an error. > > And give a goo

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Mark Lawrence
On 18/12/2013 18:05, Grant Edwards wrote: On 2013-12-18, Roy Smith wrote: In article , Grant Edwards wrote: Ideally, you should also have written at least one functioning compiler before learning C as well. Why? I've never written a compiler. I've written plenty of C. I don't see how

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Mark Lawrence
On 18/12/2013 18:11, Michael Torrie wrote: On 12/18/2013 07:51 AM, Chris Angelico wrote: On Thu, Dec 19, 2013 at 1:48 AM, Joel Goldstick wrote: So, what you need to do is show a small coding example of the problem you are having. Give the OS, the python version, and copy the traceback if ther

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 1:21 PM, Mark Lawrence wrote: > On 18/12/2013 18:11, Michael Torrie wrote: > >> On 12/18/2013 07:51 AM, Chris Angelico wrote: >> >>> On Thu, Dec 19, 2013 at 1:48 AM, Joel Goldstick >>> wrote: >>> So, what you need to do is show a small coding example of the problem >>

Copy a file like unix cp -a --reflink

2013-12-18 Thread Paulo da Silva
Hi! Is there a way to copy a file the same as Unix command: cp -a --reflink src dest without invoking a shell command? Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Copy a file like unix cp -a --reflink

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 1:37 PM, Paulo da Silva < p_s_d_a_s_i_l_...@netcabo.pt> wrote: > Hi! > > Is there a way to copy a file the same as Unix command: > > cp -a --reflink src dest > > without invoking a shell command? > > Thanks > -- > https://mail.python.org/mailman/listinfo/python-list > You

Re: Copy a file like unix cp -a --reflink

2013-12-18 Thread Jerry Hill
On Wed, Dec 18, 2013 at 1:37 PM, Paulo da Silva wrote: > Hi! > > Is there a way to copy a file the same as Unix command: > > cp -a --reflink src dest > > without invoking a shell command? I started to dig through the cp man page to see what that did, then gave up when each option expanded out to

Is it easier to deploy a Python application with nginx than Clojure+nginx?

2013-12-18 Thread azeynel1
Hello, I've set up a home server (ubuntu + nginx) to learn this stuff. I was also interested in Clojure and I wanted to use Clojure to deploy a simple application. But from the questions that I asked, e.g., http://stackoverflow.com/questions/20666497/can-i-use-clojure-with-nginx it appears that

Re: HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Denis McMahon
On Wed, 18 Dec 2013 16:38:00 +, Mark Lawrence wrote: > On 18/12/2013 09:37, Jai wrote: >> RIGHT NOW NOW I AM WORKING WITH MECHANIZE MODULE . BUT UNABLE TO >> SUBMIT CAPTACHA AUTOMATICALLY . DO U HAVE ANY IDEA PLEASE SHARE WITH ME > Ditto the Chris Angelico answer to your earlier request. +

Re: how to handle captcha through machanize module or any module

2013-12-18 Thread Denis McMahon
On Wed, 18 Dec 2013 04:56:17 -0800, Jai wrote: > please do replay how to handle captcha through machanize module The purpose of a captcha is to prevent automated scraping of data. Many of us may choose, or even need, to use captcha. What on earth makes you think for one minute that we'll help y

how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Jean Dubois
I have a python-program which I want to perform its task first, then switch to the python console to experiment with further commands, using what was already defined in the python-program. I want this as an alternative for what I do now (but which is not very efficient): I start the python-console

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 3:17 PM, Jean Dubois wrote: > I have a python-program which I want to perform its task first, then > switch to > the python console to experiment with further commands, using what was > already > defined in the python-program. > I want this as an alternative for what I do n

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Jerry Hill
On Wed, Dec 18, 2013 at 3:17 PM, Jean Dubois wrote: > I have a python-program which I want to perform its task first, then > switch to > the python console to experiment with further commands, using what was > already > defined in the python-program. > I want this as an alternative for what I do n

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Joel Goldstick
On Wed, Dec 18, 2013 at 3:28 PM, Jerry Hill wrote: > On Wed, Dec 18, 2013 at 3:17 PM, Jean Dubois > wrote: > > I have a python-program which I want to perform its task first, then > > switch to > > the python console to experiment with further commands, using what was > > already > > defined in

Re: Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Dave Angel
On Thu, 19 Dec 2013 01:55:10 +1100, Chris Angelico wrote: Sure, but you can figure out whether p is a local struct or a local pointer to some other struct by looking at its declaration. Do you also need to look at every usage of it? C is a glorified macro assembler. So the -> operator is not

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Mark Lawrence
On 18/12/2013 20:17, Jean Dubois wrote: I have a python-program which I want to perform its task first, then switch to the python console to experiment with further commands, using what was already defined in the python-program. I want this as an alternative for what I do now (but which is not ve

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Terry Reedy
On 12/18/2013 3:28 PM, Jerry Hill wrote: On Wed, Dec 18, 2013 at 3:17 PM, Jean Dubois wrote: I have a python-program which I want to perform its task first, then switch to the python console to experiment with further commands, using what was already defined in the python-program. I want this a

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Terry Reedy
On 12/18/2013 3:18 AM, Steven D'Aprano wrote: We don't know what locals()['spam'] = 42 will do inside a function, I am mystified that you would write this. Locals() will "Update and return a dictionary representing the current local symbol table." The only thing unspecified is the relation b

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

2013-12-18 Thread Mark
Actually i live stream nearly everyday for 2 years, the problem with twitch is that the more "popular" people get first dibs and get treated better, have better perks, and all of that... Its all based on your initial viewer count, 90% of viewers just click the top video. All my views and numbers

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

2013-12-18 Thread dick
On Wed, 18 Dec 2013 12:00:50 -0600, Tim Chase wrote: >On 2013-12-18 09:49, dick wrote: >> Don't forget that most hard disks have an option to cache the write >> data. This is a 'feature' that allows the manufacturers to claim >> better write performance. You can't be sure when the data is written

Re: Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Rhodri James
On Wed, 18 Dec 2013 14:55:10 -, Chris Angelico wrote: On Wed, Dec 18, 2013 at 11:53 PM, Dave Angel wrote: Funny you should say that in the middle of a discussion about lifetime. In C, when you do the -> thing, you're now in a different struct with a potentially different lifetime. I

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Oscar Benjamin
On 18 December 2013 22:33, Terry Reedy wrote: > On 12/18/2013 3:18 AM, Steven D'Aprano wrote: > >> We don't know what locals()['spam'] = 42 will do inside a function, > > I am mystified that you would write this. Locals() will "Update and return a > dictionary representing the current local symbol

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Rhodri James
On Tue, 17 Dec 2013 15:51:44 -, Wolfgang Keller wrote: The only issue for me was to figure out how to do in C what I already knew in Pascal. And I had to waste a *lot* more time and mental effort to mess with that language than it took for me to learn *both* the basics of programming per

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Chris Angelico
On Thu, Dec 19, 2013 at 11:49 AM, Rhodri James wrote: > It's sounds like you made, and are carrying on making, one of the classic > mistakes of software engineering Never get into a flame war in Asia, and never go up against a C programmer when segfaults are on the line! ChrisA -- https://mail.

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

2013-12-18 Thread Chris Angelico
On Thu, Dec 19, 2013 at 11:31 AM, Dennis Lee Bieber wrote: > On Wed, 18 Dec 2013 15:14:55 -0800, dick declaimed the > following: > >>The drives may have something like that now, but they didn't have any >>power down flush capability when I was working for WD. Of course, that >>was 15 years ago...

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Roy Smith
In article , Grant Edwards wrote: > On 2013-12-18, Roy Smith wrote: > > In article , > > Grant Edwards wrote: > > > >> Ideally, you should also have written at least one functioning > >> compiler before learning C as well. > > > > Why? I've never written a compiler. I've written plenty of

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Roy Smith
In article , Mark Lawrence wrote: > I've never contemplated writing a compiler, let alone actually written > one. It's like the comments along the lines of "you can't call yourself > a programmer until you've mastered regular expressions". Who makes comments like that? As far as I can tell,

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Roy Smith
In article , Grant Edwards wrote: > On 2013-12-18, Chris Angelico wrote: > > > Well, okay. In C you can't have Foo.foo(). > > If "Foo" is a structure with a field named "foo" that is a pointer to > a function, then you can indeed "have" Foo.foo(). Sigh. This has gone off in a direction I ne

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

2013-12-18 Thread Tim Chase
On 2013-12-18 15:14, dick wrote: >>However, my understanding is that they have a small on-drive >>battery/capacitor that stores sufficient energy for the cached >>write(s) to complete in the event the system's power abruptly cuts >>off. >> >>Granted, this is purely hearsay, as it's been a long time

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Mark Lawrence
On 19/12/2013 01:49, Roy Smith wrote: In article , Mark Lawrence wrote: I've never contemplated writing a compiler, let alone actually written one. It's like the comments along the lines of "you can't call yourself a programmer until you've mastered regular expressions". Who makes comment

Re: how to develop code using a mix of an existing python-program and console-commands

2013-12-18 Thread Jean Dubois
Op woensdag 18 december 2013 21:28:05 UTC+1 schreef Jerry Hill: > On Wed, Dec 18, 2013 at 3:17 PM, Jean Dubois wrote: > > I have a python-program which I want to perform its task first, then > > switch to > > the python console to experiment with further commands, using what was > > already > > de

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

2013-12-18 Thread Jean Dubois
Op woensdag 18 december 2013 15:48:43 UTC+1 schreef Jean Dubois: > Op woensdag 18 december 2013 14:04:08 UTC+1 schreef Jean Dubois: > > Op dinsdag 17 december 2013 10:37:37 UTC+1 schreef Jean-Michel Pichavant: > > > > I'm a newbie in Python programming that is very much true, and > > > > contrary t

Re: HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Jai
sorry sir, it will not happen again in future. -- https://mail.python.org/mailman/listinfo/python-list

Re: HOW TO HANDLE CAPTCHA WHILE PARSING A WEB SITE

2013-12-18 Thread Jai
sorry sir , it will not happen in future -- https://mail.python.org/mailman/listinfo/python-list

Re: CAPTCHA HANDLING IN MECHANIZE

2013-12-18 Thread Jai
it will not happen in future -- https://mail.python.org/mailman/listinfo/python-list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread rusi
On Thursday, December 19, 2013 7:10:53 AM UTC+5:30, Roy Smith wrote: > Grant Edwards wrote: > > I've always felt that there are features in C that don't make a lot of > > sense until you've actually implemented a compiler -- at which point > > it becomes a lot more obvious why some thing are done

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Roy Smith
In article <07c6e6a3-c5f4-4846-9551-434bdaba8...@googlegroups.com>, rusi wrote: > Soon the foo has to split into foo1.c and foo2.c. And suddenly you need to > understand: > > 1. Separate compilation > 2. Make (which is separate from 'separate compilation') > 3. Header files and libraries and t

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Chris Angelico
On Thu, Dec 19, 2013 at 3:16 PM, Roy Smith wrote: > It's pretty common here to have people ask questions about how import > works. How altering sys.path effects import. Why is import not finding > my module? You quickly get into things like virtualenv, and now you've > got modules coming from y

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread rusi
On Thursday, December 19, 2013 6:19:04 AM UTC+5:30, Rhodri James wrote: > On Tue, 17 Dec 2013 15:51:44 -, Wolfgang Keller wrote: > > The only issue for me was to figure out how to do in C what I already > > knew in Pascal. And I had to waste a *lot* more time and mental effort > > to mess with

Unpacking the structures

2013-12-18 Thread smilesonisamal
Hi all, While performing the packing/unpacking of xdr structures of rpc I get an error as following. x = struct.unpack('>L', data)[0] struct.error: unpack requires a string argument of length 4. Can anybody help me in this regard? I checked the following link: http://docs.python.org/2/l

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread rusi
On Thursday, December 19, 2013 9:46:26 AM UTC+5:30, Roy Smith wrote: > rusi wrote: > > Soon the foo has to split into foo1.c and foo2.c. And suddenly you need to > > understand: > > 1. Separate compilation > > 2. Make (which is separate from 'separate compilation') > > 3. Header files and libra

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Mark Lawrence
On 19/12/2013 04:29, rusi wrote: On Thursday, December 19, 2013 6:19:04 AM UTC+5:30, Rhodri James wrote: On Tue, 17 Dec 2013 15:51:44 -, Wolfgang Keller wrote: The only issue for me was to figure out how to do in C what I already knew in Pascal. And I had to waste a *lot* more time and ment

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread rusi
On Thursday, December 19, 2013 10:20:54 AM UTC+5:30, Mark Lawrence wrote: > On 19/12/2013 04:29, rusi wrote: > > On Thursday, December 19, 2013 6:19:04 AM UTC+5:30, Rhodri James wrote: > >> On Tue, 17 Dec 2013 15:51:44 -, Wolfgang Keller wrote: > >>> The only issue for me was to figure out how

Re: Windows+Python: Why is the first opened window not shown active?

2013-12-18 Thread asmwarrior
On 2013-12-18 17:05, Tim Golden wrote: > This isn't related to Python specifically: ctypes is just handing the > values you pass straight on to the underlying DLL (here: user32.dll). > > If you check the MSDN page for the MessageBox function: > > http://msdn.microsoft.com/en-us/library/windows/de

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Mark Lawrence
On 19/12/2013 05:09, rusi wrote: On Thursday, December 19, 2013 10:20:54 AM UTC+5:30, Mark Lawrence wrote: On 19/12/2013 04:29, rusi wrote: On Thursday, December 19, 2013 6:19:04 AM UTC+5:30, Rhodri James wrote: On Tue, 17 Dec 2013 15:51:44 -, Wolfgang Keller wrote: The only issue for me

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Gregory Ewing
Roy Smith wrote: even if you've got all the signatures of foo() in front of you, it can sometimes be hard to figure out which one the compiler will pick. And conversely, sometimes the compiler will have a hard time figuring out which one you want it to pick! I had an experience in Java recent

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Roy Smith
In article , Gregory Ewing wrote: > Roy Smith wrote: > > even > > if you've got all the signatures of foo() in front of you, it can > > sometimes be hard to figure out which one the compiler will pick. > > And conversely, sometimes the compiler will have a hard > time figuring out which one y

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread 88888 Dihedral
Roy Smith於 2013年12月19日星期四UTC+8下午12時16分26秒寫道: > In article <07c6e6a3-c5f4-4846-9551-434bdaba8...@googlegroups.com>, > > rusi wrote: > > > > > Soon the foo has to split into foo1.c and foo2.c. And suddenly you need to > > > understand: > > > > > > 1. Separate compilation > > > 2. Make (wh

Re: Unpacking the structures

2013-12-18 Thread Dan Stromberg
On Wed, Dec 18, 2013 at 8:32 PM, wrote: > > Hi all, >While performing the packing/unpacking of xdr structures of rpc I get an > error as following. > > > x = struct.unpack('>L', data)[0] struct.error: unpack requires a string > argument of length 4. > > Can anybody help me in this regard?

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-18 Thread Gregory Ewing
Roy Smith wrote: I suspect what you mean is, "There are some things that don't make sense until you understand computer architecture". An example of that kind of thing from a different perspective: I learned Z80 assembly language by first learning Z80 *machine* language (my homebrew computer di

  1   2   >