UK Python Conference - 19-20 April 2006

2006-02-28 Thread Andy Robinson
The ACCU is once again hosting a UK Python Conference on the above dates at the Randolph Hotel in Oxford. Sign up now. http://www.accu.org/index.php/conferences/2006/schedule PROGRAMME = I am happy to announce that Guido van Rossum is once again a keynote speaker for the

Re: different ways to strip strings

2006-02-28 Thread Steven D'Aprano
On Mon, 27 Feb 2006 13:28:44 -0500, rtilley wrote: s = ' qazwsx ' # How are these different? print s.strip() print str.strip(s) s.strip() strips white space from the start and end of string s. That is standard object-oriented behaviour: you have an instance, s, and you call its method,

Re: expat

2006-02-28 Thread Katja Suess
Merci à Frederik et Jarek! According to your hints I did tests with a different coding and another option in OpenOffice 'Size optimization for XML format'. Went fine! - Back to my files from yesterday the same proper converting... uups Anyway, it's running! Katja --

Re: Python and Flash

2006-02-28 Thread Sybren Stuvel
SamFeltus enlightened us with: PS. Here is an example... http://sonomasunshine.com/sonomasunshine/FrontPage.html The HTML version of that site is crap, by the way. Check out http://sonomasunshine.com/cgi-bin/old_school.py?pagename=FrontPage The HTML is sent as text/plain, and if interpreted

HTML/DOM parser

2006-02-28 Thread Xah Lee
is there a module that lets me parse validated html files and store it as a tree? for example, i want to be able to easily, say, replace the following hrpReferences/p pre • a href=aa.../a ... /pre to hrpReferences/p ul lia href=aa.../a/li ... /ul Thanks. Xah [EMAIL PROTECTED] ∑

Re: HTML/DOM parser

2006-02-28 Thread Sybren Stuvel
Xah Lee enlightened us with: is there a module that lets me parse validated html files and store it as a tree? http://docs.python.org/lib/module-xml.dom.html Assuming you're using XHTML. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for

Re: Scientific Computing with NumPy

2006-02-28 Thread Travis E. Oliphant
[EMAIL PROTECTED] wrote: Terry Reedy wrote: kpp9c [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Numeric, Numarray, Numpy... some one stick a screwdriver in my forehead and end the madness that Numeric has become. For crying all night! Numpy was Numeric's nickname Given that

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Magnus Lycka
Tim Chase wrote: ...throw UnthrowableKoan ... (okay...maybe it's a little too early on a weekdays.mon morning) Probably, since a SyntaxError slipped in. Throw is C++ Tim. It's raise UnRaisableKoan. -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython: help(wx) causes segfaulting?

2006-02-28 Thread Magnus Lycka
Franz Steinhaeusler wrote: maybe you have 2.4.2 and I 2.4. This looks like a wxPython problem, not a Python problem. It might well be a version issue for you guys, but it's more likely that a certain wxPython version is the culprit, not a certain Python version. Note however that the OP is

Re: Python Indentation Problems

2006-02-28 Thread bruno at modulix
[EMAIL PROTECTED] wrote: I am a newbie to Python. I am mainly using Eric as the IDE for coding. Also, using VIM and gedit sometimes. I had this wierd problem of indentation. My code was 100% right but it wont run because indentation was not right. If indentation is not right, then your

Re: newbie trying understand sys.path

2006-02-28 Thread Fredrik Lundh
MARK LEEDS wrote: So, as it said in Beginning Python, I went into my .bashrc file and did export PYTHONPATH=$PYTHONPATH:~/mytemp then, i typed pprint.pprint(sys.path) and it worked. it was in there but, now I want to take it out. i deleted the command from the

C++ OpenGL rendering, wxPython GUI?

2006-02-28 Thread tobfon
I'm creating a scientific visualization application with rather high demands on performance. I've created a nice rendering engine for it in C++/OpenGL and a python interface to the rendering engine. Now I'm looking to build a GUI in python with the rendering engine as an integrated window. I will

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Stefan Rank
on 28.02.2006 07:50 Carl Banks said the following: Ben Finney wrote: This PEP specifies an enumeration data type for Python. [snip] Here's why I think it's not too useful to begin with: the benefits of the enum you describe here are pretty weak. I need to disagree heavily here :) +1 from

Fetching the Return results of a spawned Thread

2006-02-28 Thread Alvin A. Delagon
Is there any way to fetch the Return results of spawned threads within the parent script? I would like to do that because I'm having problems with Threads that do queries to a database, I often encounter Threads failing due to MySQL connection failures. As much as possible I plan to make the

Re: Fetching the Return results of a spawned Thread

2006-02-28 Thread Fredrik Lundh
Alvin A. Delagon wrote: Is there any way to fetch the Return results of spawned threads within the parent script? I would like to do that because I'm having problems with Threads that do queries to a database, I often encounter Threads failing due to MySQL connection failures. As much as

Re: sort one list using the values from another list

2006-02-28 Thread bearophileHUGS
_ is just a plain variable name in Python. It is sometimes when a variable is needed to receive a value that won't be used. Like in some other interactive systems (Mathematica, etc, but with a different syntax) _ has a use in the interactive shell, it contains the last unassigned result: a = 2

Re: bsddb3 database file, are there any unexpected file size limits occuring in practice?

2006-02-28 Thread Claudio Grondi
Klaas wrote: Claudio writes: I am on a Windows using the NTFS file system, so I don't expect problems with too large file size. how large can files grow on NTFS? I know little about it. No practical limit on current harddrives. i.e.: Maximum file size Theory: 16 exabytes

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Carl Banks
Stefan Rank wrote: on 28.02.2006 07:50 Carl Banks said the following: Ben Finney wrote: This PEP specifies an enumeration data type for Python. [snip] Here's why I think it's not too useful to begin with: the benefits of the enum you describe here are pretty weak. I need to

Printing a file

2006-02-28 Thread Fabian Steiner
Hello! I am currently working on an application where the user is able to create new worksheets and to delete existing ones. All of these worksheets have the same structure (-- template?), only some values should be changed. A minimal example would be something like this: Name: ...

Re: Printing a file

2006-02-28 Thread Jeremy Sanders
Fabian Steiner wrote: Unfortunately I don't know how to realize this, since also some images and different boxes should be printed out. As the whole application is based on QT, QPrinter might be used, but I couldn't find any examples how to use it. QPrinter is easy to use. You just draw to

Re: C++ OpenGL rendering, wxPython GUI?

2006-02-28 Thread Carl Banks
[EMAIL PROTECTED] wrote: I'm creating a scientific visualization application with rather high demands on performance. I've created a nice rendering engine for it in C++/OpenGL and a python interface to the rendering engine. Now I'm looking to build a GUI in python with the rendering engine as

Re: Printing a file

2006-02-28 Thread David Boddie
Jeremy Sanders wrote: Fabian Steiner wrote: Unfortunately I don't know how to realize this, since also some images and different boxes should be printed out. As the whole application is based on QT, QPrinter might be used, but I couldn't find any examples how to use it. [...] It's

Re: Python advocacy in scientific computation

2006-02-28 Thread Cameron Laird
In article [EMAIL PROTECTED], Georg Brandl [EMAIL PROTECTED] wrote: Michael Tobis wrote: Someone asked me to write a brief essay regarding the value-add proposition for Python in the Fortran community. Slightly modified to remove a few climatology-related specifics, here it is. Great text. Do

Multicolumn in Tix scrolledListBox

2006-02-28 Thread anil . pundoor
hi iam using Tix ScrolledListBox widget. is there any option so that i can disply the items in multiple colums thanks Anil -- http://mail.python.org/mailman/listinfo/python-list

Re: Fetching the Return results of a spawned Thread

2006-02-28 Thread Kent Johnson
Alvin A. Delagon wrote: Is there any way to fetch the Return results of spawned threads within the parent script? There are several examples of this in the threading section of the Python Cookbook for example http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/84317

Multicolumn in Tix scrolledListBox

2006-02-28 Thread anil . pundoor
hi iam using Tix ScrolledListBox widget. is there any option so that i can disply the items in multiple colums thanks Anil -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Cyril Bazin
What about that? SomeNumbers = enum('0', '1', '2', '3', '4', '5', '6', '7') or Rooms = enum('1bed', '2beds', 'moreThan2beds') or even Comments = enum('#', ';', '//') CyrilOn 28 Feb 2006 03:14:25 -0800, Carl Banks [EMAIL PROTECTED] wrote: Stefan Rank wrote: on 28.02.2006 07:50 Carl Banks

Vectorization and Numeric (Newbie)

2006-02-28 Thread Ronny Mandal
Assume you have a mathematical function, e.g. f(x) = x + 4 To calculate all the values from 1 to n, a loop is one alternative. But to make this function work with vectors instead i.e f(x_vector) = result_vector, how should the function then be implemented? Thanks RM -- Support bacteria -

compiled program input

2006-02-28 Thread mehmetmutigozel
i have a compiled program named m.exe. when i execute it asks me to enter a parameter like me.dat. the coder didn't manage the argv for this program and i only have the executable. is there a vay to call this executeable from python and give parameters to it? m.exe input1 ? me.dat

Re: Vectorization and Numeric (Newbie)

2006-02-28 Thread Cyril Bazin
Are you looking for the map function? def f(x): return x+4 map(f, [1,2,3,3,70]) [5, 6, 7, 7, 74] CyrilOn 2/28/06, Ronny Mandal [EMAIL PROTECTED] wrote: Assume you have a mathematical function, e.g. f(x) = x + 4To calculate all the values from 1 to n, a loop is one alternative.But to make this

Re: PyQT: QDialog and QMainWindow interacting with each other

2006-02-28 Thread Kai Teuber
Fabian Steiner schrieb: MyDialog is closed by calling MyDialog.accept(). What can I do so that self.showListViewItems() is called after MyDialog has been closed? Thank you for any input! Hi Fabian, override the accept() method and call self.showListViewItems() there. But remember to call

Re: compiled program input

2006-02-28 Thread mehmetmutigozel
i found something like import os os.system(c\\m.exe) but it gives An endfile record was detected in a READ statement (unit=40). Error occurs at or near line 51 of _MAIN__ 12 still don't have anything :( -- http://mail.python.org/mailman/listinfo/python-list

Re: compiled program input

2006-02-28 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: i have a compiled program named m.exe. when i execute it asks me to enter a parameter like me.dat. the coder didn't manage the argv for this program and i only have the executable. is there a vay to call this executeable from python and give parameters to it? m.exe

Re: PEP 354: Enumerations in Python

2006-02-28 Thread JW
It seems the concensus is that empty enums should be allowed for consistancy, and to support the loop that doesn't. I thought I'd find some data points in other languages as a guide: * C - builtin, empty enumerations not allowed * C++ - builtin, empty enumerations allowed. C++ doesn't have

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Stefan Rank
on 28.02.2006 12:14 Carl Banks said the following: [snip] It's a pretty weak case to have a dedicated builtin to prevent duplicates in something that changes maybe once a month, as enums tend to change rather slowly. (At least, that's the way enums in other languages are used, and the

Re: Vectorization and Numeric (Newbie)

2006-02-28 Thread Juho Schultz
Ronny Mandal wrote: Assume you have a mathematical function, e.g. f(x) = x + 4 To calculate all the values from 1 to n, a loop is one alternative. Numeric and friends (numarray,numpy) have something like numarray.arange - they return arrays similar to the lists returned by standard libs

Re: C++ OpenGL rendering, wxPython GUI?

2006-02-28 Thread Michael Ekstrand
On 28 Feb 2006 01:14:15 -0800 [EMAIL PROTECTED] wrote: I'm creating a scientific visualization application with rather high demands on performance. I've created a nice rendering engine for it in C++/OpenGL and a python interface to the rendering engine. Now I'm looking to build a GUI in python

Re: compiled program input

2006-02-28 Thread mehmetmutigozel
:) yes it does. thank you very much fredrick. -- http://mail.python.org/mailman/listinfo/python-list

ANN: Leo 4.4a7 released

2006-02-28 Thread Edward K. Ream
Leo 4.4 alpha 7 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 This version fixes some minor problems with Leo 4.4a6 and adds autocompletion and calltips. There are no known problems with this release. It may be better than beta quality. Or not.

Re: Firebird and Python

2006-02-28 Thread Claudio Grondi
Ray Cote wrote: At 5:07 PM +0100 2/27/06, Magnus Lycka wrote: SNIP I'm still interested in experiences from Pythonistas using Firebird-- especially embedded. Works great. Python and Firebird embedded (at least on Windows) is very simple to use. Not currently using it on other

Deleting items from Tix Tree

2006-02-28 Thread anil . pundoor
hi iam using Tix tree widget in my python script. how can i delete the entire tree. i tried the following self.msgTree = Tix.Tree(self.msgWin) self.msgTree.hlist.delete() but it thorws the following error self.msgTree.hlist.delete() File /usr/local/lib/python2.2/lib-tk/Tix.py, line 320,

Re: HTML/DOM parser

2006-02-28 Thread Michael Ekstrand
On 28 Feb 2006 00:33:11 -0800 Xah Lee [EMAIL PROTECTED] wrote: is there a module that lets me parse validated html files and store it as a tree? BeautifulSoup will parse valid HTML (not just XHTML), and also crummy HTML while it's at it. And generates a tree structure. Warning: I haven't

UK Python Conference - 19-20 April 2006

2006-02-28 Thread Andy Robinson
The ACCU is once again hosting a UK Python Conference on the above dates at the Randolph Hotel in Oxford. Sign up now. http://www.accu.org/index.php/conferences/2006/schedule PROGRAMME = I am happy to announce that Guido van Rossum is once again a keynote speaker for the

comple list slices

2006-02-28 Thread William Meyer
Hi, I have a list of rows which contains a list of cells (from a html table), and I want to create an array of logical row groups (ie group rows by the rowspan). I am only concerned with checking the rowspan of specific columns, so that makes it easier, but I am having trouble implementing it in

Re: Python and Flash

2006-02-28 Thread SamFeltus
I aint a professional coder, but a gardener. However, the Flash-JSON-Python technique works. It is poorly coded, but it is IMO a very simple way to integrate Flash and Python compared to the methods normally suggested on the net. The HTML is just some junk thrown up for people with lower tech

error: argument after ** must be a dictionary

2006-02-28 Thread abcd
I have class like this... import threading class MyBlah(object): def __init__(self): self.makeThread(self.blah, (4,9)) def blah(self, x, y): print X and Y:, x, y def makeThread(self, func, args=(), kwargs={}): threading.Thread(target=self.blah, args=args,

Re: error: argument after ** must be a dictionary

2006-02-28 Thread Fredrik Lundh
abcd [EMAIL PROTECTED] wrote: I have class like this... import threading class MyBlah(object): def __init__(self): self.makeThread(self.blah, (4,9)) def blah(self, x, y): print X and Y:, x, y def makeThread(self, func, args=(), kwargs={}):

Get my airlines boarding pass

2006-02-28 Thread rh0dium
Hi all, Has any of you fine geniuses figured out a nice python script to go to the Southwest airlines website and check in, and retrieve your boarding pass - automatically 24 hours in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: comple list slices

2006-02-28 Thread shandy . b
A couple questions: 1- what is j? 2- what does the rows[x][y] object look like? I assume it's a dict that has a rowspan key. Can rows[x][y][rowspan] sometimes be 0? Perhaps you're looking for something like this: rowgroups = [] rowspan = 0 for i in range( len(rows) ): if rowspan = 0:

Re: Python advocacy in scientific computation

2006-02-28 Thread tooper
Maybe I'd also emphasize the nice COM interface that allow your wrapped Fortran to be made available in your Excel macros in a snap. It happens that Fortran programmers/users tends to be poor Office users except for Excel which they master at unbelievable level... My own best low work/high user

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Steven Bethard
Ben Finney wrote: This PEP specifies an enumeration data type for Python. An enumeration is an exclusive set of symbolic names bound to arbitrary unique values. Values within an enumeration can be iterated and compared, but the values have no inherent relationship to values outside the

Re: Firebird and Python

2006-02-28 Thread Magnus Lycka
Claudio Grondi wrote: Do I understand it right, that I can use Firebird database in the same way as I can use the Berkeley one provided in Python standard distribution? That depends on what you mean by the same way... As with Berkeley, you can use it in-process, and don't need a separate

Re: comple list slices

2006-02-28 Thread johnzenger
Python lets you iterate through a list using an integer index, too, although if you do so we will make fun of you. You can accomplish it with a while loop, as in: i = 0 while i len(rows): if rows[i] == This code looks like BASIC without the WEND, doesn't it?: rowgroups.append(Pretty

Re: time.sleep(1) sometimes runs for 200 seconds under windows

2006-02-28 Thread Mladen Adamovic
Magnus Lycka wrote: On Windows that it. At least on Linux and Solaris, time.clock() returns CPU time. If time.clock() returns significantly different values before and after time.sleep(1), there's something seriously broken in sleep on such platforms. No! When process run the sleep, the

Re: Vectorization and Numeric (Newbie)

2006-02-28 Thread johnzenger
map takes a function and a list, applies the function to each item in a list, and returns the result list. For example: def f(x): return x + 4 numbers = [4, 8, 15, 16, 23, 42] map(f, numbers) [8, 12, 19, 20, 27, 46] So, rather that ask if there is a different way to write f, I'd just use f

Re: comple list slices

2006-02-28 Thread William Meyer
shandy.b at gmail.com writes: A couple questions: 1- what is j? 2- what does the rows[x][y] object look like? I assume it's a dict that has a rowspan key. Can rows[x][y][rowspan] sometimes be 0? Perhaps you're looking for something like this: rowgroups = [] rowspan = 0 for i in

Re: comple list slices

2006-02-28 Thread William Meyer
johnzenger at gmail.com writes: Python lets you iterate through a list using an integer index, too, although if you do so we will make fun of you. You can accomplish it with a while loop, as in: i = 0 while i len(rows): if rows[i] == This code looks like BASIC without the WEND,

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-28 Thread dananrg
What would be the next best Oracle database module for Python next to cx_oracle? I'd like to compare two and choose one, just for the sake of seeing how two modules doing the same thing operate. Also, does installing cx_oracle create registry entries or require admin privs on a Windows XP

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-28 Thread dananrg
Also, what's the difference between something like cx_oracle and an ODBC module? If I were to use an ODBC module (not trying to torture myself here, I promise, but I just want to see what alternatives exist and how they work). -- http://mail.python.org/mailman/listinfo/python-list

Re: comple list slices

2006-02-28 Thread johnzenger
Although I don't know if this is faster or more efficient than your current solution, it does look cooler: def grouprows(inrows): rows = [] rows[:] = inrows # makes a copy because we're going to be deleting while len(rows) 0: rowspan = rows[0][rowspan] yield

Re: Is Python a Zen language?

2006-02-28 Thread Mc Osten
On 26 Feb 2006 14:55:04 -0800, Andrea Griffini wrote: IMO another language that would be hard to classify is COBOL ... but for other reasons :-) According to Dijkstra: The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. That makes Cobol a

Re: Python and Flash

2006-02-28 Thread SamFeltus
By the way Sybren, if you don't mind, what kinda computer and browser were you using, trying to figure out which browsers get redirected to html and which get the Flash Site. If you have Flash plugin, what version was it? Thanks, Sam the Gardener --

Re: minimize a program into an icon on the taskbar.

2006-02-28 Thread Frank Niessink
Rajesh Sathyamoorthy: Hi, I would know how to minimize a program (wxpython app) into an icon on the taskbar on windows (the one at the side near the clock, i can't remember what is it called.) Is it easy to be done? Is there a way to do the same thing on Linux? Did you look into

Re: Python and Flash

2006-02-28 Thread [EMAIL PROTECTED]
SamFeltus wrote: I aint a professional coder, but a gardener. However, the Flash-JSON-Python technique works. It is poorly coded, but it is IMO a very simple way to integrate Flash and Python compared to the methods normally suggested on the net. The HTML is just some junk thrown up for

Re: Python and Flash

2006-02-28 Thread Sybren Stuvel
SamFeltus enlightened us with: By the way Sybren, if you don't mind, what kinda computer and browser were you using, trying to figure out which browsers get redirected to html and which get the Flash Site. Mozilla Firefox 1.5, on Ubuntu Linux Breezy. If you have Flash plugin, what version

Re: Matplotlib logarithmic scatter plot

2006-02-28 Thread John Hunter
Derek == Derek Basch [EMAIL PROTECTED] writes: Derek Great! That worked fine after I played with it for a Derek bit. One last question though. How do I label the ticks Derek with the product of the exponentiation? For instance: Derek 100 Derek instead of Derek 10**2

Re: PEP 354: Enumerations in Python

2006-02-28 Thread [EMAIL PROTECTED]
Ben Finney wrote: PEP 354: Enumerations in Python has been accepted as a draft PEP. The current version can be viewed online: -1 on the proposal as a builtin, -0 on including any kind of enumeration in the standard library unless I can see a compelling use case; Carl Banks' approach seems more

Re: comple list slices

2006-02-28 Thread William Meyer
johnzenger at gmail.com writes: Although I don't know if this is faster or more efficient than your current solution, it does look cooler: def grouprows(inrows): rows = [] rows[:] = inrows # makes a copy because we're going to be deleting while len(rows) 0:

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Toby Dickenson
On Monday 27 February 2006 02:49, Ben Finney wrote: Coercing a value from an enumeration to a ``str`` results in the string that was specified for that value when constructing the enumeration:: That sentence seems to assume that all enumeration values will have been specified as strings.

Looking for Pythonic Examples

2006-02-28 Thread G. Völkl
Hello I am looking for examples of Pythonic Thinking: One example I found: Here some lines of the web side of Bruce Eckel: http://www.mindview.net/WebLog/log-0053 How to read a text file: for line in file(FileName.txt): # Process line It is a easy and sophisticated thing in python, but hard

escaping quotes

2006-02-28 Thread John Salerno
I'm reading through the tutorial and found this in section 3: 'Isn\'t, she said.' 'Isn\'t, she said.' Why doesn't the escape sequence work in this case? -- http://mail.python.org/mailman/listinfo/python-list

RE: MySQLdb compile error with AMD64

2006-02-28 Thread keith
Can anyone offer any assistance on this one? Is it unsupported on AMD64 ? Nothing in the README points to that. I thought it would default to 32bit if not supported under 64. Hi, I have been using MySQLdb on a 32-bit processor, no worries. Love it. I went to install on an AMD64 running

Numerical solver

2006-02-28 Thread Laszlo Zsolt Nagy
Hello, I would like to use a numerical solver for a specific problem. My problem looks like this: 1. I have numeric constants, named A,B,C etc. 2. I have numeric variables, named x,y,z etc. 3. I have functions, like f1(x), f2(x), f3(x,y), f4(y) etc. 4. I have constraints like

Re: Best python module for Oracle, but portable to other RDBMSes

2006-02-28 Thread Gerhard Häring
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: What would be the next best Oracle database module for Python next to cx_oracle? That would probably be DCOracle2. I'd like to compare two and choose one, just for the sake of seeing how two modules doing the same thing

Re: escaping quotes

2006-02-28 Thread Fredrik Lundh
John Salerno wrote: I'm reading through the tutorial and found this in section 3: 'Isn\'t, she said.' 'Isn\'t, she said.' Why doesn't the escape sequence work in this case? because the interactive prompt echos the result back to you as a Python literal, where possible. compare

Re: Numerical solver

2006-02-28 Thread Robert Kern
Laszlo Zsolt Nagy wrote: Hello, I would like to use a numerical solver for a specific problem. My problem looks like this: 1. I have numeric constants, named A,B,C etc. 2. I have numeric variables, named x,y,z etc. 3. I have functions, like f1(x), f2(x), f3(x,y), f4(y) etc.

telnetlib problems

2006-02-28 Thread vercingetorix52
I'm trying to use a python script to access an embedded computer running linux and connected via a crossover ethernet cable using the following script... ...and I realize the username and password is not realistic... I'm still in proof of concept stage here :) # import

Re: sort one list using the values from another list

2006-02-28 Thread Ron Adam
[EMAIL PROTECTED] wrote: Following Ron Adam solution (and using [] instead of list() in the last line), this may be a possible solution of the problem, that is often quite fast: def psort16(s1, s2): try: d = dict(izip(s2, s1)) except TypeError: _indices =

Threading - will threads run in parallel?

2006-02-28 Thread SolaFide
I have 2 threads that I want to run at the same time: for instance: from threading import Thread class test(Thread): def run(self): while True: get(asdf) class test2(Thread): def run(self): while True:

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Terry Reedy
Stefan Rank [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] recent examples from this list: 2006-01-03: http://www.nabble.com/Re%3A-Regex-anomaly-p2179421.html 2006-02-20: http://www.nabble.com/Re%3A-Regular-expression-gone-mad-p3029028.html If the re flags were implemented as

Re: telnetlib problems

2006-02-28 Thread vercingetorix52
I just hit upon something that seems to work... ## import telnetlib from select import select tn = telnetlib.Telnet('192.168.100.11') sock = tn.get_socket() tn.read_until('login: ', 5) select([sock], [], [], 5) tn.write('user\n') tn.read_until('Password: ', 5)

Thread Question

2006-02-28 Thread D
I have a client application that I want (behind the scenes) to check and make sure a remote host is up (i.e. by ping or TCP connect). I'm assuming that, since I want this to go on unknowingly to the user, that I would put this in a thread. My question is, how would I go about creating the

Re: Threading - will threads run in parallel?

2006-02-28 Thread Ido Yehieli
Also, is it possible to split off a program for the terminal that started it? As in I type in python test.py and test.py runs in the background and lets me do other things in that terminal? try: python test.py -- http://mail.python.org/mailman/listinfo/python-list

Re: Threading - will threads run in parallel?

2006-02-28 Thread Rene Pijlman
SolaFide: (get() is a function which waits for a ping on a specific port, thus stopping the program for a while.) Will these run together, Thread 2 can run while thread 1 is blocked for I/O and v.v. Also, is it possible to split off a program for the terminal that started it? As in I type in

Re: Threading - will threads run in parallel?

2006-02-28 Thread SolaFide
Thanks! The problem is on Windows: when I run c:\python24\myprogram.py, it has a command window open up. If I close it, the program ends. So I want it to run without opening that window. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for Pythonic Examples

2006-02-28 Thread Ido Yehieli
This one is from our very own BDFL, behold- wget implemented in 7 lines of python code: import sys, urllib def reporthook(*a): print a for url in sys.argv[1:]: i = url.rfind('/') file = url[i+1:] print url, -, file urllib.urlretrieve(url, file, reporthook) --

Re: Threading - will threads run in parallel?

2006-02-28 Thread Jarek Zgoda
SolaFide napisał(a): The problem is on Windows: when I run c:\python24\myprogram.py, it has a command window open up. If I close it, the program ends. So I want it to run without opening that window. Give it .pyw extension or start using pythonw.exe instead of python.exe. -- Jarek Zgoda

Re: escaping quotes

2006-02-28 Thread John Salerno
Fredrik Lundh wrote: because the interactive prompt echos the result back to you as a Python literal, where possible. compare Ah, of course! I forgot it wasn't 'print'ing it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread Question

2006-02-28 Thread Grant Edwards
On 2006-02-28, D [EMAIL PROTECTED] wrote: I have a client application that I want (behind the scenes) to check and make sure a remote host is up (i.e. by ping or TCP connect). I'm assuming that, since I want this to go on unknowingly to the user, that I would put this in a thread. Probably.

Re: comple list slices

2006-02-28 Thread johnzenger
You don't need to copy the list; but if you don't, your original list will be emptied. Len(rows) recalculates each time the while loop begins. Now that I think of it, rows != [] is faster than len(rows) 0. By the way, you can also do this using (gasp) a control index: def grouprows(rows):

Re: Thread Question

2006-02-28 Thread Felipe Almeida Lessa
Em Ter, 2006-02-28 às 20:24 +, Grant Edwards escreveu: I have seen examples that used classes, and other examples that just called one thread start command - when should you use one over another? I'm not sure what you mean by use classes vs. calling a thread start command. My

Re: Thread Question

2006-02-28 Thread D
Thanks, Grant. I apologize for not being clear on what I meant by using classes. This is an example of what I was referring to: http://www.wellho.net/solutions/python-python-threads-a-first-example.html See the second (threaded) example. Doug --

Make staticmethod objects callable?

2006-02-28 Thread Nicolas Fleury
Hi everyone, I was wondering if it would make sense to make staticmethod objects callable, so that the following code would work: class A: @staticmethod def foo(): pass bar = foo() I understand staticmethod objects don't need to implement __call__ for their other use cases, but

Re: Firebird and Python

2006-02-28 Thread haxier
All the info you need is in the kinterbasdb module. I've worked with it under windows and Linux and... it just works. Really well indeed. I'd recommend it a lot. http://kinterbasdb.sourceforge.net/dist_docs/usage.html#faq_fep_embedded_using_with -- Asier. --

Re: comple list slices

2006-02-28 Thread Felipe Almeida Lessa
Em Ter, 2006-02-28 às 09:10 -0800, [EMAIL PROTECTED] escreveu: Although I don't know if this is faster or more efficient than your current solution, it does look cooler: [snip] print [x for x in grouper] This is not cool. Do print list(grouper) -- Quem excele em empregar a força militar

Re: Thread Question

2006-02-28 Thread Grant Edwards
On 2006-02-28, D [EMAIL PROTECTED] wrote: Thanks, Grant. I apologize for not being clear on what I meant by using classes. This is an example of what I was referring to: http://www.wellho.net/solutions/python-python-threads-a-first-example.html Ah, I see. I had forgotten that people

Re: comple list slices

2006-02-28 Thread Fredrik Lundh
[EMAIL PROTECTED]: Len(rows) recalculates each time the while loop begins. Now that I think of it, rows != [] is faster than len(rows) 0. the difference is very small, and len(rows) is faster than rows != [] (the latter creates a new list for each test). and as usual, using the correct

Re: Thread Question

2006-02-28 Thread Felipe Almeida Lessa
Em Ter, 2006-02-28 às 20:38 +, Grant Edwards escreveu: On 2006-02-28, D [EMAIL PROTECTED] wrote: Thanks, Grant. I apologize for not being clear on what I meant by using classes. This is an example of what I was referring to:

Re: PEP 354: Enumerations in Python

2006-02-28 Thread Terry Hancock
On Tue, 28 Feb 2006 14:26:49 -0500 Terry Reedy [EMAIL PROTECTED] wrote: Stefan Rank [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] recent examples from this list: 2006-01-03: http://www.nabble.com/Re%3A-Regex-anomaly-p2179421.html 2006-02-20:

Long running Script stops responding, CPU usage increases

2006-02-28 Thread Jeff Quandt
Title: Long running Script stops responding, CPU usage increases This is running Python 2.3 on windows 2003/windows xp. I have written a script to display and filter the Win32 event log in a scrolling list to the command line (it also does some summary tasks). It uses the

  1   2   >