Re: SSH utility

2009-07-07 Thread romeoamp
Please look at on : http://www.lag.net/paramiko/ http://www.lag.net/paramiko/ Sample Code: Find Attachment Thanks, S.V.RAJKUMAR, XOU Solutions India Private Limited No. 37, PM Towers, Greams Road, Thousand Lights, Chennai - 6 . Mobile No : +91 - 9940632275. half.italian wrote: > > On

count

2009-07-07 Thread Dhananjay
Dear all, I have file as follows,however, tab seperated (not shown in following file): 6 3 4.309726 7 65 93.377388 8 47 50.111952 9 270 253.045923 10 184182.684670 11 76 121.853455 12 85 136.283470

Re: tough-to-explain Python

2009-07-07 Thread Steven D'Aprano
On Tue, 07 Jul 2009 20:04:46 +, kj wrote: > I'm having a hard time coming up with a reasonable way to explain > certain things to programming novices. [...] > Or consider this one: > ham = [1, 2, 3, 4] spam = (ham,) spam > ([1, 2, 3, 4],) spam[0] is ham > True spam

Re: Python and webcam capture delay?

2009-07-07 Thread Tim Roberts
Nobody wrote: > >The webcam is bound to do some encoding; most of them use USB "full speed" >(12Mbit/sec), which isn't enough for raw 640x480x24...@30fps data. That's not true. Most of the web cams made in the last 5 years or so run at high speed, 480 Mbps. Full speed only gets you 1 fps at 640

Re: Check file is locked?

2009-07-07 Thread Rajat
On Jul 8, 4:57 am, Lawrence D'Oliveiro wrote: > In message , Christian > > Heimes wrote: > > By the way most operating systems don't lock a file when it's opened for > > reading or writing or even executed. > > The general conclusion seems to be that mandatory locking is more trouble > than it's w

Re: DBI module deprecated at Python 2.5--what to use in its place?

2009-07-07 Thread John Machin
On Jul 8, 3:05 am, dana wrote: > I have a variety of Python 2.4 scripts that utilitize the DBI and ODBC > modules together. Although I don't have Python 2.5, I've been informed > the DBI module has been deprecated at 2.5. > > A few questions: > > 1) Although deprecated, will it work at all in 2.5?

Re: tough-to-explain Python

2009-07-07 Thread Simon Forman
On Jul 7, 4:04 pm, kj wrote: > I'm having a hard time coming up with a reasonable way to explain > certain things to programming novices. > > Consider the following interaction sequence: > > >>> def eggs(some_int, some_list, some_tuple): > > ... some_int += 2 > ... some_list += [2] > ...

Re: How to use Python to interface with Web pages?

2009-07-07 Thread Ralf Schoenian
Peter wrote: Any help would be appreciated :-) I want to write an auction sniping tool in Python. I know Python, but I know absolutely nothing about web pages, javascript etc i.e. I want the program to automatically log me into my eBay account, access the appropriate item, locate how many mins/s

How to use Python to interface with Web pages?

2009-07-07 Thread Peter
Any help would be appreciated :-) I want to write an auction sniping tool in Python. I know Python, but I know absolutely nothing about web pages, javascript etc i.e. I want the program to automatically log me into my eBay account, access the appropriate item, locate how many mins/seconds until th

Re: tough-to-explain Python

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 17:04:46 -0300, kj escribió: I'm having a hard time coming up with a reasonable way to explain certain things to programming novices. ham = [1, 2, 3, 4] spam = (ham,) spam ([1, 2, 3, 4],) spam[0] is ham True spam[0] += [5] Traceback (most recent call last): File "",

Re: tough-to-explain Python

2009-07-07 Thread python
Ben, > I have got very good results from teaching using the analogy of "paper tags > tied to physical objects" to describe Python's references to values. Great analogy!! And an excellent analogy for newcomers to Python. (this would have saved me some personal pain in my early days). Regards, Ma

Re: tough-to-explain Python

2009-07-07 Thread Steven D'Aprano
On Tue, 07 Jul 2009 21:18:53 +, kj wrote: > I had not realized how *profoundly* different the meaning of the "=" in > Python's > > spam = ham > > is from the "=" in its > > spam[3] = ham[3] > > So much for "explicit is better than implicit"... I'm sorry, I don't get it. Can you explai

Re: IP Address Function

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 22:45:24 -0300, Fred Atkinson escribió: Is there a Python function I can use to get the user's IP address so I can display it on his browser? There is a long distance between "Python" and "browser" - you'll have to tell us what is in between the two. By example

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 09:51:10 -0300, Jean-Michel Pichavant escribió: I've never used sense in that way before, nor I've seen used by others until now. However Kj is right, and my dictionary seems wrong (wordreference.com). I've searched through others dictionaries and find out this is actua

Re: tough-to-explain Python

2009-07-07 Thread John Yeung
On Jul 7, 8:06 pm, Ben Finney wrote: > I have got very good results from teaching using > the analogy of “paper tags tied to physical objects” > to describe Python's references to values. Ah, I like that! I think it's better than what I used in my post (which I composed and submitted before your

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Paul Rubin
pdpi writes: > while abs(func(guess) - target) > epsilon: > guess = (lo + hi) / 2. > if sense * func(guess) > sense * target: > hi = guess > elif sense * func(guess) < sense * target: > lo = guess > elif lo == hi: > return Non

Re: IP Address Function

2009-07-07 Thread Chris Rebert
On Tue, Jul 7, 2009 at 6:45 PM, Fred Atkinson wrote: >        Is there a Python function I can use to get the user's IP > address so I can display it on his browser? from socket import gethostname, gethostbyname ip = gethostbyname(gethostname()) Cheers, Chris -- http://blog.rebertia.com -- http

Re: IP Address Function

2009-07-07 Thread Tim Harig
On 2009-07-08, Fred Atkinson wrote: > Is there a Python function I can use to get the user's IP > address so I can display it on his browser? If you are using CGI you can get it from the REMOTE_ADDR environmental variable. -- http://mail.python.org/mailman/listinfo/python-list

Re: tough-to-explain Python

2009-07-07 Thread John Yeung
On Jul 7, 5:11 pm, kj wrote: > I don't plan to present these examples to them. > But beginners have a way of bumping into such > conundrums all on their own [...].  I doubt that > an answer of the form "don't worry your pretty > little head over this now; wait until your second > course" will do t

IP Address Function

2009-07-07 Thread Fred Atkinson
Is there a Python function I can use to get the user's IP address so I can display it on his browser? Regards, Fred -- http://mail.python.org/mailman/listinfo/python-list

Re: Write matrix to text file

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 14:46:47 -0300, Hanna Michelsen escribió: I'm working with both python and matlab at the moment and I was wondering if there is an efficient way to take a 2-D array (of 1s and 0s) in python and write it to a text file such that matlab will be able to create a sparse ma

Re: tough-to-explain Python

2009-07-07 Thread Ben Finney
kj writes: > In Chris Rebert > writes: > > >You might find the following helpful (partially): > >http://effbot.org/zone/call-by-object.htm > > Extremely helpful. Thanks! (I learned more from it than someone > who will teach the stuff would care to admit...) I have got very good results fr

Re: Check file is locked?

2009-07-07 Thread Lawrence D'Oliveiro
In message , Christian Heimes wrote: > By the way most operating systems don't lock a file when it's opened for > reading or writing or even executed. The general conclusion seems to be that mandatory locking is more trouble than it's worth. -- http://mail.python.org/mailman/listinfo/python-l

Re: tough-to-explain Python

2009-07-07 Thread Bret Fledderjohn
I really enjoyed your boxes analogy, from a guy with a trucking background, it makes a lot of sense! -Bret > ... The more I delve into OOP the more I liken an 'object' to a box. A box > with a shipping manifest. > > There are big boxes, > little boxes, > squat boxes and so on. > > A box can conta

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread Stef Mientki
J Kenneth King wrote: Stef Mientki writes: So, the question is, can the same thing be done for Python apps? I love Python and all, but it'd be apt to ask, what's the point? The iPhone is running on what? A 400Mhz ARM processor? Resources on the device are already limited; ru

Re: Embedded Python : Why does thread lock here?

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 15:01:17 -0300, roschler escribió: I have the Python Intepreter embedded in a Delphi (Object Pascal) program. In the Python script shown below, I have a module that creates a thread object and starts it. Do you *execute* the module or do you *import* it? Isn't a good id

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread J Kenneth King
Stef Mientki writes: >>> So, the question is, can the same thing be done for Python apps? >>> >> >> I love Python and all, but it'd be apt to ask, what's the point? >> >> The iPhone is running on what? A 400Mhz ARM processor? Resources on the >> device are already limited; running your progr

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread Stef Mientki
So, the question is, can the same thing be done for Python apps? I love Python and all, but it'd be apt to ask, what's the point? The iPhone is running on what? A 400Mhz ARM processor? Resources on the device are already limited; running your program on top of an embedded Python interpre

RE: A Bug By Any Other Name ...

2009-07-07 Thread Phil Runciman
-Original Message- From: Dennis Lee Bieber [mailto:wlfr...@ix.netcom.com] Sent: Tuesday, 7 July 2009 4:45 p.m. To: python-list@python.org Subject: Re: A Bug By Any Other Name ... On Mon, 6 Jul 2009 19:48:39 -0700, Daniel Fetchinson declaimed the following in gmane.comp.python.general:

Re: tough-to-explain Python

2009-07-07 Thread norseman
Bearophile wrote: kj, as Piet van Oostrum as said, that's the difference between mutable an immutable. It comes from the procedural nature of Python, and probably an explanation of such topic can't be avoided if you want to learn/teach Python. ...(snip) See you later, bearophile

Re: Python Error from Apress book

2009-07-07 Thread Gabriel Genellina
En Tue, 07 Jul 2009 09:55:13 -0300, Dave Angel escribió: Gabriel Genellina wrote: En Mon, 06 Jul 2009 19:56:40 -0300, matt0177 escribió: When I try to run the command as outlined in the book "simple_markup2.py < test_input.txt > test_output.html i get the following error every time. IO

Re: Python and webcam capture delay?

2009-07-07 Thread Nobody
On Tue, 07 Jul 2009 09:01:39 +0300, jack catcher (nick) wrote: > Thanks for the comments. Unfortunately, such specifications aren't easy > to find, even in reviews. Fortunately several newer webcams seem at > least to use usb2. Supporting USB-2 doesn't mean that the camera necessarily uses high

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread python
> If you do write the interpreter, let me know. I would certainly experiment > with it. +2 over here! Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: finding most common elements between thousands of multiple arrays.

2009-07-07 Thread Andrew Henshaw
"mclovin" wrote in message news:c5332c9b-2348-4194-bfa0-d70c77107...@x3g2000yqa.googlegroups.com... > Currently I need to find the most common elements in thousands of > arrays within one large array (arround 2 million instances with ~70k > unique elements) > > so I set up a dictionary to handle

Re: tough-to-explain Python

2009-07-07 Thread Bearophile
kj, as Piet van Oostrum as said, that's the difference between mutable an immutable. It comes from the procedural nature of Python, and probably an explanation of such topic can't be avoided if you want to learn/teach Python. Lot of people think that a language where everything is immutable is sim

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread J Kenneth King
Dr Mephesto writes: > Sure, I am learning Objective C already, but the syntax is really > unfriendly after python. > > I think it really depends on the type of app you want to write. > Anything held back by network delays or that sits around waiting for > user input are perfectly acceptable targe

Re: DBI module deprecated at Python 2.5--what to use in its place?

2009-07-07 Thread Kevin Dwyer
Hello, I think this is discussed PEP 249 - see the "major changes" section. http://www.python.org/dev/peps/pep-0249/ Kev On Tue, 07 Jul 2009 10:05:07 -0700, dana wrote: > I have a variety of Python 2.4 scripts that utilitize the DBI and ODBC > modules together. Although I don't have Python 2.5

Re: tough-to-explain Python

2009-07-07 Thread kj
In Chris Rebert writes: >You might find the following helpful (partially): >http://effbot.org/zone/call-by-object.htm Extremely helpful. Thanks! (I learned more from it than someone who will teach the stuff would care to admit...) I had not realized how *profoundly* different the meaning o

Re: tough-to-explain Python

2009-07-07 Thread kj
In Piet van Oostrum writes: >> kj (k) wrote: >>k> I'm having a hard time coming up with a reasonable way to explain >>k> certain things to programming novices. >>k> Consider the following interaction sequence: >> def eggs(some_int, some_list, some_tuple): >>k> ... some_int += 2 >

Re: Opening a SQLite database in readonly mode

2009-07-07 Thread Joshua Kugler
Roger Binns wrote: > Joshua Kugler wrote: >> BTW, APSW is written by the same author as pysqlite. > Not even remotely true :-) Sorry about that...since pysqlite and APSW are both discusses on the pysqlite list, I had made an incorrect assumption. Oops. j -- http://mail.python.org/mailman/listin

Re: tough-to-explain Python

2009-07-07 Thread Piet van Oostrum
> kj (k) wrote: >k> I'm having a hard time coming up with a reasonable way to explain >k> certain things to programming novices. >k> Consider the following interaction sequence: > def eggs(some_int, some_list, some_tuple): >k> ... some_int += 2 >k> ... some_list += [2] >k> ...

Re: Problem reading file with umlauts

2009-07-07 Thread MRAB
Claus Hausberger wrote: Thanks a lot. Now I am one step further but I get another strange error: Traceback (most recent call last): File "./read.py", line 12, in of.write(text) UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128) ac

Re: ISO library ref in printed form

2009-07-07 Thread Piet van Oostrum
> kj (kj) wrote: >kj> Does anyone know where I can buy the Python library reference in >kj> printed form? (I'd rather not print the whole 1200+-page tome >kj> myself.) I'm interested in both/either 2.6 and 3.0. Maybe you can have a copy printed at lulu.com. It would even be nicer if the PS

Re: ISO library ref in printed form

2009-07-07 Thread Diez B. Roggisch
kj schrieb: In a...@pythoncraft.com (Aahz) writes: In article , kj wrote: Does anyone know where I can buy the Python library reference in printed form? (I'd rather not print the whole 1200+-page tome myself.) I'm interested in both/either 2.6 and 3.0. There used to be one for Python 2

Re: tough-to-explain Python

2009-07-07 Thread Chris Rebert
On Tue, Jul 7, 2009 at 1:04 PM, kj wrote: > > > I'm having a hard time coming up with a reasonable way to explain > certain things to programming novices. > > Consider the following interaction sequence: > def eggs(some_int, some_list, some_tuple): > ...     some_int += 2 > ...     some_list +

Re: Check file is locked?

2009-07-07 Thread Christian Heimes
dudeja.ra...@gmail.com wrote: > How to check if a particular file is locked by some application? (i.e. the > file is opened by some application)? It depends on your operating system. By the way most operating systems don't lock a file when it's opened for reading or writing or even executed. Chri

Re: library search path when compiling python

2009-07-07 Thread Christian Heimes
nn wrote: > I am trying to compile python with ssl support but the libraries are > not in /usr/lib but in /opt/freeware/lib. How do I add that folder to > the default library search path? > > It looks like configure --libdir=DIR might do the job but I don't want > to replace the default lib search

tough-to-explain Python

2009-07-07 Thread kj
I'm having a hard time coming up with a reasonable way to explain certain things to programming novices. Consider the following interaction sequence: >>> def eggs(some_int, some_list, some_tuple): ... some_int += 2 ... some_list += [2] ... some_tuple += (2,) ... >>> x = 42 >>> y = (

library search path when compiling python

2009-07-07 Thread nn
I am trying to compile python with ssl support but the libraries are not in /usr/lib but in /opt/freeware/lib. How do I add that folder to the default library search path? It looks like configure --libdir=DIR might do the job but I don't want to replace the default lib search path, just add an add

Re: ISO library ref in printed form

2009-07-07 Thread kj
In Scott David Daniels writes: >Also consider grabbing Gruet's "Python Quick Reference" page. Not quite what I had in mind, but handy all the same. Thanks. kj -- http://mail.python.org/mailman/listinfo/python-list

Re: ISO library ref in printed form

2009-07-07 Thread kj
In a...@pythoncraft.com (Aahz) writes: >In article , kj wrote: >> >>Does anyone know where I can buy the Python library reference in >>printed form? (I'd rather not print the whole 1200+-page tome >>myself.) I'm interested in both/either 2.6 and 3.0. >There used to be one for Python 2.1, but

Check file is locked?

2009-07-07 Thread dudeja . rajat
How to check if a particular file is locked by some application? (i.e. the file is opened by some application)? -- Regrads, Rajat -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Error from Apress book

2009-07-07 Thread Dave Angel
Matthew Edmondson wrote: Thanks a ton for the help. At first adding the path didn't work, but after restarting my computer, ran like a champ :) Hopefully I can get decent with this language one day! All you needed was to restart the DOS-box (Command Prompt), after you did the control-panel

Re: Clarity vs. code reuse/generality

2009-07-07 Thread pdpi
On Jul 7, 8:04 pm, Dave Angel wrote: > And of course your clarified function will fail if the func is > monotonically decreasing. yeah, I eventually realized that and corrected it... And the assert()/ cmp() confusion too. I blame lack of sleep. The whole sign/sense thing left a really bad taste

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Dave Angel
pdpi wrote: On Jul 7, 2:16 am, Steven D'Aprano wrote: On Mon, 06 Jul 2009 16:43:43 +0100, Tim Rowe wrote: 2009/7/4 kj : Precisely. As I've stated elsewhere, this is an internal helper function, to be called only a few times under very well-specified conditions. The assert sta

Re: Problem reading file with umlauts

2009-07-07 Thread Claus Hausberger
Thanks a lot. Now I am one step further but I get another strange error: Traceback (most recent call last): File "./read.py", line 12, in of.write(text) UnicodeEncodeError: 'ascii' codec can't encode character u'\ufeff' in position 0: ordinal not in range(128) according to google ufeff ha

Re: Clarity vs. code reuse/generality

2009-07-07 Thread pdpi
On Jul 7, 7:31 pm, pdpi wrote: > On Jul 7, 7:06 pm, Paul Rubin wrote: > > > pdpi writes: > > > Personally, I think the code is an unreadable mess, but that's mostly > > > because of all the micro optimizations, not the generality of it. > > > Here's my unoptimized,

Re: Clarity vs. code reuse/generality

2009-07-07 Thread pdpi
On Jul 7, 7:06 pm, Paul Rubin wrote: > pdpi writes: > > Personally, I think the code is an unreadable mess, but that's mostly > > because of all the micro optimizations, not the generality of it. > > Here's my unoptimized, but still equally generic, version: > > That

Re: Clarity vs. code reuse/generality

2009-07-07 Thread pdpi
On Jul 7, 7:26 pm, Andre Engels wrote: > On Tue, Jul 7, 2009 at 8:01 PM, pdpi wrote: > > He asserts: > >    assert lo < hi > > but then compares: > >    sense = cmp(func(hi), func(lo)) > > > sense can't ever be anything other than 1. > > It can - there is no necessity that func is monotonically in

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Andre Engels
On Tue, Jul 7, 2009 at 8:01 PM, pdpi wrote: > He asserts: >    assert lo < hi > but then compares: >    sense = cmp(func(hi), func(lo)) > > sense can't ever be anything other than 1. It can - there is no necessity that func is monotonically increasing. -- André Engels, andreeng...@gmail.com --

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Paul Rubin
pdpi writes: > Personally, I think the code is an unreadable mess, but that's mostly > because of all the micro optimizations, not the generality of it. > Here's my unoptimized, but still equally generic, version: That version doesn't use "sense" inside the binary search, i.e. it relies on the fu

Re: Where does setuptools live?

2009-07-07 Thread Inky 788
On Jul 7, 4:06 am, Chris Withers wrote: > David Lyon wrote: > > > What hasn't happened is enough testing of pypi packages and installing > > with setuptools/pip/enstall from pypi. > > What needs testing? > > More important for me is which of these has the most active development > community. How d

Re: Clarity vs. code reuse/generality

2009-07-07 Thread pdpi
On Jul 7, 2:16 am, Steven D'Aprano wrote: > On Mon, 06 Jul 2009 16:43:43 +0100, Tim Rowe wrote: > > 2009/7/4 kj : > > >> Precisely.  As I've stated elsewhere, this is an internal helper > >> function, to be called only a few times under very well-specified > >> conditions.  The assert statements c

Embedded Python : Why does thread lock here?

2009-07-07 Thread roschler
I have the Python Intepreter embedded in a Delphi (Object Pascal) program. In the Python script shown below, I have a module that creates a thread object and starts it. The thread's run() call calls a function called deleteOutputVariables() declared at the module level. In my code's first incarn

Re: A Bug By Any Other Name ...

2009-07-07 Thread Stefan Behnel
Lawrence D'Oliveiro wrote: > I wonder how many people have been tripped up by the fact that > > ++n > > and > > --n > > fail silently for numeric-valued n. I doubt that there are many. Plus, you misspelled them from the more obvious n++ and n-- which *do* fail with

Write matrix to text file

2009-07-07 Thread Hanna Michelsen
Hi, I'm working with both python and matlab at the moment and I was wondering if there is an efficient way to take a 2-D array (of 1s and 0s) in python and write it to a text file such that matlab will be able to create a sparse matrix from it later. Thanks! -- http://mail.python.org/mailman/lis

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread Piet van Oostrum
> a...@pythoncraft.com (Aahz) (A) wrote: >A> In article <85ljn0ej4h@agentultra.com>, >A> J Kenneth King wrote: >>> >>> The iPhone is running on what? A 400Mhz ARM processor? Resources on the >>> device are already limited; running your program on top of an embedded >>> Python interprete

Re: Unable to get Tkinter menubar to appear under OS X

2009-07-07 Thread weforgottenuno
I'm having the same problem, though I am just using the pre-installed python and tkinter versions that are on my OS X 10.5 computer, I did not install them on my own. Any advice? -Doug On Jun 24, 9:22 am, Eric Winter wrote: > Hi all. I've googled this issue several times and come up dry. Here's

Re: A Bug By Any Other Name ...

2009-07-07 Thread MRAB
Daniel Fetchinson wrote: and my point is that users are most of time correct when they assume that something will work the same way as in C. Oh, really ? They would surely be wrong if they'd expect the for loop to have any similarity with a C for loop, or - a *very* common error - if they'd expe

DBI module deprecated at Python 2.5--what to use in its place?

2009-07-07 Thread dana
I have a variety of Python 2.4 scripts that utilitize the DBI and ODBC modules together. Although I don't have Python 2.5, I've been informed the DBI module has been deprecated at 2.5. A few questions: 1) Although deprecated, will it work at all in 2.5? Does the fact that it is deprecrated mean it

Re: Problem reading file with umlauts

2009-07-07 Thread Stefan Behnel
Michiel Overtoom schrob: > Viele Röhre. Macht spaß! Tsüsch! LOL! :) Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Code that ought to run fast, but can't due to Python limitations.

2009-07-07 Thread John Nagle
Stefan Behnel wrote: John Nagle wrote: I have a small web crawler robust enough to parse real-world HTML, which can be appallingly bad. I currently use an extra-robust version of BeautifulSoup, and even that sometimes blows up. So I'm very interested in a new Python parser which supposedly

Re: A Bug By Any Other Name ...

2009-07-07 Thread Daniel Fetchinson
>> and my point is that users >> are most of time correct when they assume that something will work the >> same way as in C. > > Oh, really ? They would surely be wrong if they'd expect the for loop to > have any similarity with a C for loop, or - a *very* common error - if > they'd expect assignme

Re: A Bug By Any Other Name ...

2009-07-07 Thread Daniel Fetchinson
Yes, there are plenty of languages other than Java and C, but the influence of C is admittedly huge in Python. Why do you think loops are called "for", conditionals "if" or "while", functions return via "return", loops terminate via "break" and keep going via "continue" and

Re: automatic multiprocessing

2009-07-07 Thread Simon Forman
On Jul 7, 11:08 am, Cheng Soon Ong wrote: > Hi all, > > I'm trying to automate the use of multiprocessing when it is available. The > setting I have is quite simple, with a for loop where the operations inside > are > independent of each other. Here's a bit of code. function_inputs is a list of >

Re: A Bug By Any Other Name ...

2009-07-07 Thread Daniel Fetchinson
> (snip) >> and my point is that users >> are most of time correct when they assume that something will work the >> same way as in C. > > Oh, really ? They would surely be wrong if they'd expect the for loop to > have any similarity with a C for loop, or - a *very* common error - if > they'd expect

Re: Python Error from Apress book

2009-07-07 Thread Dave Angel
matt0177 wrote: Adding the python before the command line didn't work at first, but upon moving the files to the c:\python25 it worked like a champ. Thank you both for the help. Very frustrating to run into stuff like this when you're first trying to learn a knew language, it really throws off yo

Re: ISO library ref in printed form

2009-07-07 Thread Aahz
In article , kj wrote: > >Does anyone know where I can buy the Python library reference in >printed form? (I'd rather not print the whole 1200+-page tome >myself.) I'm interested in both/either 2.6 and 3.0. There used to be one for Python 2.1, but I can't tell whether it's ever been updated be

automatic multiprocessing

2009-07-07 Thread Cheng Soon Ong
Hi all, I'm trying to automate the use of multiprocessing when it is available. The setting I have is quite simple, with a for loop where the operations inside are independent of each other. Here's a bit of code. function_inputs is a list of dictionaries, each of which match the signature of f

Re: Newbie needs help

2009-07-07 Thread Pablo Torres N.
On Tue, Jul 7, 2009 at 10:02, wrote: > Hello Gurus, > > Thank you for trying to help to my initial and not well written questions.  I > will compile more detailed information and ask again.  Btw, I am giving a > glimpse to: "How To Ask Questions The Smart Way". > > nacim Give this one a try too

Re: Problem reading file with umlauts

2009-07-07 Thread Michiel Overtoom
Claus Hausberger wrote: I have a text file with is encoding in Latin1 (ISO-8859-1). I can't change that as I do not create those files myself. I have to read those files and convert the umlauts like ö to stuff like &oumol; as the text files should become html files. umlaut-in.txt: This fi

Re: ISO library ref in printed form

2009-07-07 Thread Scott David Daniels
kj wrote: Does anyone know where I can buy the Python library reference in printed form? (I'd rather not print the whole 1200+-page tome myself.) I'm interested in both/either 2.6 and 3.0. Personally, I'd get the new Beazley's Python Essential Reference, which is due out "real soon now," and

RE: Newbie needs help

2009-07-07 Thread nacim_bravo
Hello Gurus, Thank you for trying to help to my initial and not well written questions. I will compile more detailed information and ask again. Btw, I am giving a glimpse to: "How To Ask Questions The Smart Way". nacim -Original Message- From: Simon Forman [mailto:sajmik...@gmail.co

Re: Python Error from Apress book

2009-07-07 Thread matt0177
Adding the python before the command line didn't work at first, but upon moving the files to the c:\python25 it worked like a champ. Thank you both for the help. Very frustrating to run into stuff like this when you're first trying to learn a knew language, it really throws off your momentum! --

Re: Remoting over SSH

2009-07-07 Thread Tim Harig
On 2009-07-07, Hussein B wrote: > I want to perform commands on a remote server over SSH. > What do I need? catb.org/esr/faqs/smart-questions.html There are many ways to remote using ssh. If we know what you are trying to do, maybe we could give you a better answer. If you just want to open th

Re: Remoting over SSH

2009-07-07 Thread alex23
On Jul 8, 12:46 am, Hussein B wrote: > I want to perform commands on a remote server over SSH. > What do I need? Take a look at pexpect: http://pexpect.sourceforge.net/pexpect.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread Aahz
In article <85ljn0ej4h@agentultra.com>, J Kenneth King wrote: > >The iPhone is running on what? A 400Mhz ARM processor? Resources on the >device are already limited; running your program on top of an embedded >Python interpreter would only be adding pressure to the constraints; >even if it wa

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Simon Forman
On Tue, Jul 7, 2009 at 8:51 AM, Jean-Michel Pichavant wrote: > Steven D'Aprano wrote: >> >> On Tue, 07 Jul 2009 05:13:28 +, Lie Ryan wrote: >> >> >>> >>> When people are fighting over things like `sense`, although sense may >>> not be strictly wrong dictionary-wise, it smells of something burni

Re: Clarity vs. code reuse/generality

2009-07-07 Thread Aahz
In article , Jean-Michel Pichavant wrote: > >Can't we just calm down ? I'm really sorry my ignorance started this >thread, and my apologies go to Kj who's obviously more fluent in english >than me. >I've never used sense in that way before, nor I've seen used by others >until now. However Kj i

Re: Catching control-C

2009-07-07 Thread Simon Forman
On Jul 6, 6:02 pm, Michael Mossey wrote: > On Jul 6, 2:47 pm, Philip Semanchuk wrote: > > > On Jul 6, 2009, at 5:37 PM, Michael Mossey wrote: > > > > What is required in a python program to make sure it catches a   > > > control- > > > c on the command-line? Do some i/o? The OS here is Linux. > >

Re: Newbie needs help

2009-07-07 Thread Simon Forman
On Mon, Jul 6, 2009 at 7:00 PM, wrote: > Dear Python gurus, > > If I'd like to set dielectric constant for the certain material, is it > possible to do such in Python environment? If yes, how to do or what syntax > can be used? > > Also, I'd like to get a simulation result, like voltage, is it p

Re: Problem reading file with umlauts

2009-07-07 Thread Stefan Behnel
Claus Hausberger wrote: > Hello > > I have a text file with is encoding in Latin1 (ISO-8859-1). I can't change > that as I do not create those files myself. > > I have to read those files and convert the umlauts like ö to stuff like > &oumol; as the text files should become html files. > > I h

Problem reading file with umlauts

2009-07-07 Thread Claus Hausberger
Hello I have a text file with is encoding in Latin1 (ISO-8859-1). I can't change that as I do not create those files myself. I have to read those files and convert the umlauts like ö to stuff like &oumol; as the text files should become html files. I have this code: #!/usr/bin/python # -*- c

Re: Tkinter.Canvas thread safety problem?

2009-07-07 Thread Peter Otten
Zdenek Maxa wrote: > I would like to ask if you could have a look at the snippet in the > attachment and tell me if that is actually me doing something wrong or > indeed Tkinter thread safety problem and what the workaround could be. http://effbot.org/zone/tkinter-threads.htm -- http://mail.pyt

Re: Semi-Newbie needs a little help

2009-07-07 Thread Nile
Thanks all for your help. I appreciate it. The problem was in the function. A simple bug which I should have caught but I had my mental blinders on and was sure the problem was outside the function. The answers have given me a lot to learn so thanks for that as well. -- http://mail.python.org/m

Re: Creating alot of class instances?

2009-07-07 Thread Piet van Oostrum
> Steven D'Aprano (SD) wrote: >SD> On Mon, 06 Jul 2009 05:47:18 -0700, Scott David Daniels wrote: >>> Steven D'Aprano wrote: ... That's the Wrong Way to do it -- you're using a screwdriver to hammer a nail >>> >>> Don't knock tool abuse (though I agree with you here). Sometimes

Re: Why re.match()?

2009-07-07 Thread pdpi
On Jul 2, 4:49 am, kj wrote: > In Duncan Booth > writes: > > >So, for example: > re.compile("c").match("abcdef", 2) > ><_sre.SRE_Match object at 0x02C09B90> > re.compile("^c").search("abcdef", 2) > > I find this unconvincing; with re.search alone one could simply > do: > > >>>

Re: A Bug By Any Other Name ...

2009-07-07 Thread Dave Angel
Duncan Booth wrote: Dennis Lee Bieber wrote: for, if, and return were common keywords in FORTRAN. Really? What does 'for' do in FORTRAN? P.S. Does FORTRAN actually have keywords these days? Back when I learned it there was no such thing as a reserved word though for all I know they

Re: Why re.match()?

2009-07-07 Thread Bruno Desthuilliers
Paul Rudin a écrit : Bruno Desthuilliers writes: kj a écrit : In <4a4e2227$0$7801$426a7...@news.free.fr> Bruno Desthuilliers writes: kj a écrit : (snipo To have a special-case re.match() method in addition to a general re.search() method is antithetical to language minimalism, FWIW, Pyt

Re: Python/pyobjC Apps on iPhone now a possibility?

2009-07-07 Thread Dr Mephesto
Sure, I am learning Objective C already, but the syntax is really unfriendly after python. I think it really depends on the type of app you want to write. Anything held back by network delays or that sits around waiting for user input are perfectly acceptable target apps. If you need speed for som

  1   2   >