Re: how to write a C-style for loop?

2006-02-15 Thread Tim Roberts
John Salerno <[EMAIL PROTECTED]> wrote: > >I assume this is the way for loops are written in C, but if it helps to >be specific, I'm referring to C# for loops. The Python for loop seems to >be the same (or similar) to C#'s foreach loop: > >foreach int i in X > >But how would you write a C# for lo

Re: Soduku

2006-02-15 Thread Mikael Olofsson
Jonathan Gardner wrote: > How do you have a 16x16 grid for soduku? Are you using 16 digits? 0-F? > > The one I am using has 9 digits, 9 squares of 9 cells each, or 9x9 > cells. What alphabet you use is irrelevant. Sudokus has really nothing to do with numbers. You can use numbers, as well as let

Re: Self-identifying functions and macro-ish behavior

2006-02-15 Thread Duncan Booth
Michael wrote: > def func2(): > > print > return True > > I imagine this means things like closures which I'm not familiar with > (I'm not a CS person). In this case, each function is part of a class, > so I imagine I can take a dir() of the class if necessary. Use the inspect mod

Re: How to *Search* with google from inside my programme and get the search result?

2006-02-15 Thread Fuzzyman
Frank Potter wrote: > I want to search something by a key word from inside my py script. > The using google idea comes to my mind first because write a search > programme from scratch is not so easy. > > I want to take advantage of goolge results, but I don't know how. > To extract the result from

Re: Excel and TrackChanges

2006-02-15 Thread Gerard Flanagan
pierre_py wrote: > I have a problem with pycom automation with excel. > If i use the following in my excel_wrapper: > """ > self.Workbook.Save() > self.Workbook.HighlightChangesOptions(When=1) > self.Workbook.ListChangesOnNewSheet = True > """ > I don't get any history worksheet. If i use 2 (xlAllC

Re: Self-identifying functions and macro-ish behavior

2006-02-15 Thread Iain King
[EMAIL PROTECTED] wrote: > Hi, I was wondering how I may get a python function to know what its > name is without me having to write it manually? For example: > > def func1(): > > print 'func1' > return True > > def func2(): > > print 'func2' > return True > > should be

PyDot problem

2006-02-15 Thread Sbaush
Hi all. I use pydot for drawing nework link.the code is at bottom of mail.i have a png like this attachedIf you look png you can see that 10.0.0.1 and 10.0.0.2 are linked by 2 arrow, one from 1 to 2, one form 2 to 1. Is possible to draw only one line with both arrow?I would have a result like in r

a numarray question

2006-02-15 Thread avharut
hello everyone would anyone please tell me what is the best (fastest) way of replacing values in numarray arrays? lets say i have an array that may contain 0s, and i just want to get rid of those 0s by replacing them with another number. what would be the most efficient way to do that? many than

using the Filters DLL (image filters)

2006-02-15 Thread Dieter Vanderelst
Hello, I'm trying to access the Filters-Dll provided by the filters-project (http://filters.sourceforge.net/index.htm). Following the advice I got from the Python list -thank you for that-, I do this using ctypes (http://starship.python.net/crew/theller/ctypes/index.html). I can seem to acces

Re: Python advocacy in scientific computation

2006-02-15 Thread Juho Schultz
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. > Thank you - this was very good reading. > I would welcome comments and correc

Re: using the Filters DLL (image filters)

2006-02-15 Thread Michele Petrazzo
Dieter Vanderelst wrote: > Hello, > > I'm trying to access the Filters-Dll provided by the filters-project > (http://filters.sourceforge.net/index.htm). Nice project :) > > Following the advice I got from the Python list -thank you for that-, > I do this using ctypes > (http://starship.python

Re: a numarray question

2006-02-15 Thread Juho Schultz
[EMAIL PROTECTED] wrote: > hello everyone > > would anyone please tell me what is the best (fastest) way of replacing > values in numarray arrays? > > lets say i have an array that may contain 0s, and i just want to get > rid of those 0s by replacing them with another number. what would be > the

Re: Downloading files using urllib in a for loop?

2006-02-15 Thread Martin Franklin
[EMAIL PROTECTED] wrote: > Hi, > I'm using Python 2.3 on Windows for the first time, and am doing > something wrong in using urllib to retrieve images from urls embedded > in a csv file. If I explicitly specify a url and image name it works > fine(commented example in the code), but if I pass in

Downloading files using urllib in a for loop?

2006-02-15 Thread justsee
Hi, I'm using Python 2.3 on Windows for the first time, and am doing something wrong in using urllib to retrieve images from urls embedded in a csv file. If I explicitly specify a url and image name it works fine(commented example in the code), but if I pass in variables in this for loop it throws

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Felipe Almeida Lessa
Em Ter, 2006-02-14 às 20:14 -0800, Farel escreveu: > Which is Faster in Python and Why? > > jc = {}; m = [] > x = [ [1,2,3,4,5,6,7,8,9],[..],...] # upwards of 1 entries > def binm() > for item in x: > b = item[:]; b.sort(); bc = 0 > for bitem in b: bc += int(bitem) >

Re: Downloading files using urllib in a for loop?

2006-02-15 Thread justsee
Thanks - but have printed and verified they are valid paths and filenames. One correction to the code I listed: theurl = imagepath[:-8] For some reason the values aren't being passed through urllib.urlretrieve properly but this makes no sense to me? -- http://mail.python.org/mailman/listinfo/

pop line from file

2006-02-15 Thread Sinan Nalkaya
hello all, i searched and google long long time but couldnt find any result, i want pop the first line from file, i dont want to read all file contents because file is being updated from another proccess. even i couldnt realize its algorithm, thanks for any suggestion -- http://mail.python.org/mai

Re: how to write a C-style for loop?

2006-02-15 Thread ZeD
Ciao, John Salerno! Che stavi dicendo? > for (int i = 0; i < 50; i += 5) > > How would that go in Python, in the simplest and most efficient way? i=0 while i<50: #... i+=5 about range()/xrange(): what if you want to traslate this c-loop? for (int i=1; i<50; i*=2) -- Evangelion e' la s

Re: Downloading files using urllib in a for loop?

2006-02-15 Thread Fredrik Lundh
Martin Franklin wrote: > "No such file or directory: ''" sounds to me like you are trying > to open a file called '' (empty string) > > try adding some debugging > > print theimage, imagepath or, better: print repr(theimage), repr(imagepath) -- http://mail.python.org/mailman/listi

choose and open a folder in Windows

2006-02-15 Thread palo
Hello I wrote a little script (that will be used only under Windows if at all) where the user should choose a directory and the script will then process some data files in the directory and write the result there. To make it a bit more pleasant, it would be nice if the directory were chosen by the

Re: a numarray question

2006-02-15 Thread Bas
I believe it is something like a[a==0] = 5 Note that numarray will eventually be replaced by Scipy/Numpy at some time, but this wouldn't change the basic stuff. Cheers, Bas -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic gui format?

2006-02-15 Thread Gregory Petrosyan
Bruno: in your original example, how can it be specified that image should be placed before text? Of course, it *can* be done with one extra level of wrapping of gui elements in list... did you mean that? Patrik: thanks a lot! Stan (the way it represents XML) is almost what I am looking for. --

[ANN] Movable Python 1.0.1

2006-02-15 Thread Fuzzyman
I'm pleased to be able to announce the release of `Movable Python 1.0.1 `_. This includes the release of **Movable Python** for Python 2.2. To obtain it, visit the `Movable Python Shop `_. Existing users of Movab

Re: Downloading files using urllib in a for loop?

2006-02-15 Thread Martin Franklin
Martin Franklin wrote: > [EMAIL PROTECTED] wrote: >> Hi, >> I'm using Python 2.3 on Windows for the first time, and am doing >> something wrong in using urllib to retrieve images from urls embedded >> in a csv file. If I explicitly specify a url and image name it works >> fine(commented example in

Re: Downloading files using urllib in a for loop?

2006-02-15 Thread Martin Franklin
[EMAIL PROTECTED] wrote: > Thanks - but have printed and verified they are valid paths and > filenames. One correction to the code I listed: >theurl = imagepath[:-8] > > For some reason the values aren't being passed through > urllib.urlretrieve properly but this makes no sense to me? > A wo

RE: choose and open a folder in Windows

2006-02-15 Thread Tim Golden
[palo] | But I didn't find how to make windows to open | a given directory in file expolorer) | P. At the risk of suggesting the obvious, have you tried: import os os.system ("explorer.exe c:\\temp") or import os os.startfile ("c:\\temp") or something similar? TJG _

Re: Pythonic gui format?

2006-02-15 Thread Ivan Voras
James Stroud wrote: > The reasons given in the blog were fairly precise. I think "only on > vague[...]" is misleading here. The idea of the article was to educate a > Java user how to change his or her frame of reference to better use Python. > > The author was not being territorial as you are

Re: Pythonic gui format?

2006-02-15 Thread Fuzzyman
Gregory Petrosyan wrote: > > > Isn't it ugly a bit? > >I'd even say 'ugly 16-bits' !-) > > You are right of course. Those "examples" are really bad, and, most > of all, really un-pythonic. > > Thanks for JSON. It's more clean&simple than XML, but my main idea is > to remove any extra layer betwe

Re: a numarray question

2006-02-15 Thread avharut
thanks guys! import timeit first_way = "the_array[the_array == 0] = 5.0" second_way = "another_array = numarray.choose(the_array == 0, (the_array, 5.0))" some_third_way = """\ indx = numarray.where(the_array == 0)[0] another_array = numarray.put(the_array, indx, len(indx) * [5.0,]) ""

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread bruno at modulix
Farel wrote: > Which is Faster in Python and Why? Why don't you try by yourself ? hint : from timeit import Timer help(Timer) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman

Re: Embedding an Application in a Web browser

2006-02-15 Thread paron
You may already know this, but I don't think anyone has mentioned it explicitly. You can run a Python web server (I like CherryPy) on the local machine, and serve pages to "localhost." Everything else is just plain old Python, and talking to the OS is no problem. Ron -- http://mail.python.org/m

Re: Pythonic gui format?

2006-02-15 Thread bruno at modulix
Fuzzyman wrote: (snip) > You say you don't want an 'extra layer' between your GUI and Python - > but your approach of using XML has the same drawback. Storing your 'GUI > configuration' in a text based format is a nice idea, but you will need > *something* to do the translation. Well, if the con

Re: Pythonic gui format?

2006-02-15 Thread bruno at modulix
Gregory Petrosyan wrote: > Bruno: in your original example, how can it be specified that image > should be placed before text? Of course, it *can* be done with one > extra level of wrapping of gui elements in list... did you mean that? Yes. That's a pretty straightforward translation of the real

Re: processing limitation in Python

2006-02-15 Thread Steven D'Aprano
On Wed, 15 Feb 2006 10:16:07 +, Dennis Lee Bieber wrote: > Why bother collecting the "factors" into a list only to print them > at the bottom of the procedure -- you aren't returning a value from > factor(), so I'd suggest dropping the > factors = [] > and > print factors >

low level data types

2006-02-15 Thread dementrio
How can I handle low-level data types in Python? What I want to do is writing an interface to a C daemon which waits for stuff like unsigned ints on a socket. For example, I need to craft and decode data structures that look like this: 32-bit unsigned int MSG_LENGTH 32-bit unsigned int MSG_CODE 64

Re: Python and ASP

2006-02-15 Thread Roger Upole
No, what I mean is that until you upload the file to the web server and request it back thru the server, it's just a text source file. However, let me make sure I understood your previous post. I had thought you meant you were opening the ASP file directly, as in locally and not from a web servic

Re: Downloading files using urllib in a for loop?

2006-02-15 Thread justsee
ah - thanks for your help, but what is happening is the first line being returned contains the field names from the csv file! Schoolboy errors :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: low level data types

2006-02-15 Thread Fredrik Lundh
"dementrio" wrote: > What I want to do is writing an interface to a C daemon which waits for > stuff like unsigned ints on a socket. For example, I need to craft and > decode data structures that look like this: > > 32-bit unsigned int MSG_LENGTH > 32-bit unsigned int MSG_CODE > 64-bit signed int

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Steven D'Aprano
On Wed, 15 Feb 2006 08:44:10 +0100, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Farel wrote: > >> Which is Faster in Python and Why? > > ``if not b in m`` looks at each element of `m` until it finds `b` in it > and stops then. Assuming `b` is in `m`, otherwise all elements of `m`

Re: Embedding an Application in a Web browser

2006-02-15 Thread paron
I forgot -- I like the idea of Kerrigell, too. It runs on top of CherryPy, and lets you use python either in the server (which is just a little program on your local machine) or embedded in the html pages, or in a Kerrigell service, which is an application server based on Python. So, a script to p

[ANN] pyqonsole-0.2.0

2006-02-15 Thread Alexandre Fayolle
Logilab has released pyqonsole-0.2.0 Pyqonsole is a X Window terminal written in Python. The code is based on konsole, and it uses the Qt toolkit. It is mainly meant for use by Python application developpers who would like to embed a terminal in their application, but it can be used as a not blazi

Re: how to write a C-style for loop?

2006-02-15 Thread Steven D'Aprano
On Wed, 15 Feb 2006 10:20:13 +, ZeD wrote: > Ciao, John Salerno! Che stavi dicendo? > >> for (int i = 0; i < 50; i += 5) >> >> How would that go in Python, in the simplest and most efficient way? > > i=0 > while i<50: > #... > i+=5 That's exceedingly unPythonic. In fact I'd go far

Re: how to write a C-style for loop?

2006-02-15 Thread Duncan Booth
Steven D'Aprano wrote: >> about range()/xrange(): what if you want to traslate this c-loop? for >> (int i=1; i<50; i*=2) > > That's a completely different question, so of course it has a completely > different answer. Here is one way: ... various options snipped ... and another way for use when

Re: pop line from file

2006-02-15 Thread Dylan Wilson
Try open.readline() >>>help(open) ... -- http://mail.python.org/mailman/listinfo/python-list

Re: choose and open a folder in Windows

2006-02-15 Thread palo
thanks a lot, it works and sorry for intelligent questions:) -- http://mail.python.org/mailman/listinfo/python-list

Re: Rethinking the Python tutorial

2006-02-15 Thread Magnus Lycka
JW wrote: > I started with the official tutorial. It seemed up to date to me. > Things that changed from 2.4 to 2.5 changed in the tutorial as well. Agreed. I mainly felt that A Byte of Python seems to go through the features in Python in a more systematic way. The official tutorial is being kep

Re: Embedding an Application in a Web browser

2006-02-15 Thread paron
I forgot -- I like the idea of Kerrigell, too. It runs on top of CherryPy, and lets you use python either in the server (which is just a little program on your local machine) or embedded in the html pages, or in a Kerrigell service, which is an application server based on Python. So, a script to p

Re: pop line from file

2006-02-15 Thread Sybren Stuvel
Sinan Nalkaya enlightened us with: > i searched and google long long time but couldnt find any result, i > want pop the first line from file, i dont want to read all file > contents because file is being updated from another proccess. So basically, what you want is some sort of on-disk FIFO queue,

Re: Embedding an Application in a Web browser

2006-02-15 Thread Kent Johnson
paron wrote: > I forgot -- I like the idea of Kerrigell, too. It runs on top of > CherryPy Karrigell is independent of CherryPy, it has it's own web server built in. Kent -- http://mail.python.org/mailman/listinfo/python-list

Re: 'could not open display' error when import gtk - how fix?

2006-02-15 Thread ngw
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Why can't I import gtk (pygtk) module? It appears gtk module want X > perms? > > import gtk > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line > 37, in ?from _gtk

Code organization

2006-02-15 Thread Thomas Girod
Hi. I found a lot of documentation about how to code in Python, but not much about how you organize your code in various modules / packages ... As I am not yet used to python, this puzzle me a bit. So, can anyone explain how one should organize and store its code ? the uses of __init__.py files ?

Re: Win32_Process.Create -- not starting process

2006-02-15 Thread abcd
Tim, Ok, well I verified that my python script and batch script are working properly. In fact, if I double click on the batch script (when its on Computer B), it starts the python script and the script runs fine with no problem. However when I try to execute the batch script from computer A

Re: Python and ASP

2006-02-15 Thread Steve Holden
Tempo wrote: > What do you mean? I can't just upload the file to the server that is > going to host my site? > Note that the language identifier directive <%@ Language=Python %> should come right at the top of the file to do any good. Is this an ISP-managed web server? If so it's possible that

Re: Code organization

2006-02-15 Thread bruno at modulix
Thomas Girod wrote: > Hi. > > I found a lot of documentation about how to code in Python, but not > much about how you organize your code in various modules / packages ... > As I am not yet used to python, this puzzle me a bit. > > So, can anyone explain how one should organize and store its code

Re: Pythonic gui format?

2006-02-15 Thread Fuzzyman
bruno at modulix wrote: > Fuzzyman wrote: > (snip) > > > You say you don't want an 'extra layer' between your GUI and Python - > > but your approach of using XML has the same drawback. Storing your 'GUI > > configuration' in a text based format is a nice idea, but you will need > > *something* to

Re: Best way of finding terminal width/height?

2006-02-15 Thread Joel Hedlund
> Sure. I was going to do that yesterday, but I realized that I > didn't know how/where to do it. I assume there's a link > somewhere at www.python.org, but I haven't had a chance to look > yet. It's already reported to the bug tracker: http://www.python.org/sf/210599 Apparently, this has been

RE: Win32_Process.Create -- not starting process

2006-02-15 Thread Tim Golden
[abcd] |Ok, well I verified that my python script and batch script are | working properly. In fact, if I double click on the batch | script (when its on Computer B), it starts the python script and the script runs | fine with no problem. That's all very well, and it does confirm that there'

Re: how do you pronounce 'tuple'?

2006-02-15 Thread Grant Griffin
Tim Peters wrote: ... > "tuhple" is a girly-man affectation. That's why Guido and I both say > the manly "toople". ... Yes, but doesn't Guido say 'Guido' with some sort of strange faux-manly 'H'-ish sortta sound? methinks-the-lady-doth-protest-too-much-ly y'rs, =g2 --

file existence checking

2006-02-15 Thread john peter
does anyone have a suggestion on simplest way to check for the existence of a file within the same directory where a python script was started without really opening it? i've seen some people use this as a mechanism for informing an application of an external event, signalling it for example to

Re: Code organization

2006-02-15 Thread Kent Johnson
bruno at modulix wrote: > Thomas Girod wrote: >> >>I found a lot of documentation about how to code in Python, but not >>much about how you organize your code in various modules / packages ... >>As I am not yet used to python, this puzzle me a bit. > > Now for best practices and whatnots, this isn

Re: How to *Search* with google from inside my programme and get the search result?

2006-02-15 Thread Brett g Porter
I V wrote: > Frank Potter wrote: >> Does google supply some webservice to programmers? I did see > > Googling for "google api" gets you to: > > http://www.google.com/apis/ > > It appears to be a SOAP API, which you can access with python, but I > think you'll need a third-party library. Googling

Re: windows security descriptors

2006-02-15 Thread rtilley
The link changed... sorry. http://opensource.w2k.vt.edu/Win32_Perms.php -- http://mail.python.org/mailman/listinfo/python-list

Re: 'could not open display' error when import gtk - how fix?

2006-02-15 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Why can't I import gtk (pygtk) module? It appears gtk module want X > perms? > > > >>> import gtk > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line > 37, in ?from _gtk import * >

Re: file existence checking

2006-02-15 Thread Fredrik Lundh
"john peter" <[EMAIL PROTECTED]> wrote: > does anyone have a suggestion on simplest way to check for the existence of a > file > within the same directory where a python script was started without really > opening > it? it's not like opening a file is a very expensive or dangerous operation,

Re: low level data types

2006-02-15 Thread Simon Brunning
On 15 Feb 2006 04:07:37 -0800, dementrio <[EMAIL PROTECTED]> wrote: > How can I handle low-level data types in Python? > What I want to do is writing an interface to a C daemon which waits for > stuff like unsigned ints on a socket. For example, I need to craft and > decode data structures that loo

Re: how to write a C-style for loop?

2006-02-15 Thread John Salerno
Tim Roberts wrote: > John Salerno <[EMAIL PROTECTED]> wrote: >> I assume this is the way for loops are written in C, but if it helps to >> be specific, I'm referring to C# for loops. The Python for loop seems to >> be the same (or similar) to C#'s foreach loop: >> >> foreach int i in X >> >> But

Re: Embedding an Application in a Web browser

2006-02-15 Thread paron
Thanks, Kent -- you're right. That'll teach me to work from memory! Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption application/NEED A HACKER TO TRY IT

2006-02-15 Thread Fredrik Lundh
"atanas Cosmas Nkelame" <[EMAIL PROTECTED]> wrote: > I'm putting here the 'encoded' text for someone to try to encipher the text > or tell me what is the chance that one can encipher the text. > > > Here we go.. > > .>. 3;0.$0.8:;07&:00: 07&.>..&;.$> 9::.$0. .&;..9>.;.$0.3;0 ;...$0.3;0 > 9::.$0.

RE: Encryption application/NEED A HACKER TO TRY IT

2006-02-15 Thread atanas Cosmas Nkelame
Hi guys,There was an instence in our office whereby someone happened to get his eyes on information he is not supposed to.I got an idea to write a python application which ciphers and enciphers informationation (converting it to a format which only the person who changed it understands as he is the

Re: file names longer than MAX_PATH under Windows 2003

2006-02-15 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >I see from another post that CreateFile cannot open your file. >That puts it further away from Python, although it doesn't >explain how some other program can see the files. Can you use >os.startfile (or its equiva

Re: Self-identifying functions and macro-ish behavior

2006-02-15 Thread Ben Cartwright
[EMAIL PROTECTED] wrote: > How do I get some > sort of macro behavior so I don't have to write the same thing over and > over again, but which is also not neatly rolled up into a function, > such as combining the return statements with a printing of ? Decorators: http://www.python.org/peps/pep-03

Re: Which is faster? (if not b in m) or (if m.count(b) > 0)

2006-02-15 Thread Georg Brandl
Steven D'Aprano wrote: > On Wed, 15 Feb 2006 08:44:10 +0100, Marc 'BlackJack' Rintsch wrote: > >> In <[EMAIL PROTECTED]>, Farel wrote: >> >>> Which is Faster in Python and Why? >> >> ``if not b in m`` looks at each element of `m` until it finds `b` in it >> and stops then. Assuming `b` is in `m

Re: Python advocacy in scientific computation

2006-02-15 Thread Georg Brandl
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 you want to put it onto a Wiki page at wiki.python.org? Georg --

Re: Best way of finding terminal width/height?

2006-02-15 Thread Grant Edwards
On 2006-02-15, Joel Hedlund <[EMAIL PROTECTED]> wrote: >> Sure. I was going to do that yesterday, but I realized that I >> didn't know how/where to do it. I assume there's a link >> somewhere at www.python.org, but I haven't had a chance to look >> yet. > > It's already reported to the bug tracke

Re: Encryption application/NEED A HACKER TO TRY IT

2006-02-15 Thread Paul Boddie
Fredrik Lundh wrote: > "atanas Cosmas Nkelame" <[EMAIL PROTECTED]> wrote: > > > I'm putting here the 'encoded' text for someone to try to encipher the text > > or tell me what is the chance that one can encipher the text. [From an FAQ on the subject...] > "I just came up with this neat method

RE: file names longer than MAX_PATH under Windows 2003

2006-02-15 Thread Tim Golden
[Sergey] | "Tim Golden" <[EMAIL PROTECTED]> wrote in | message news:[EMAIL PROTECTED] | [Sergey] | | >I see from another post that CreateFile cannot open your file. | >That puts it further away from Python, although it doesn't | >explain how some other program can see the files. Can you use | >o

Re: low level data types

2006-02-15 Thread dementrio
Thanks for the hint! However now I have another problem - endianness (the client runs on powerpc, the server on x86). I found that simply reversing the stuff I recv() works, but is there any cleaner way for taking care of this? -- http://mail.python.org/mailman/listinfo/python-list

Re: file names longer than MAX_PATH under Windows 2003

2006-02-15 Thread Claudio Grondi
Sergey wrote: > "Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [Sergey] > > >>I see from another post that CreateFile cannot open your file. >>That puts it further away from Python, although it doesn't >>explain how some other program can see the files. Can you use >>o

Re: low level data types

2006-02-15 Thread Diez B. Roggisch
dementrio wrote: > Thanks for the hint! > > However now I have another problem - endianness (the client runs on > powerpc, the server on x86). I found that simply reversing the stuff I > recv() works, but is there any cleaner way for taking care of this? Have you actually _read_ the struct docum

Re: file names longer than MAX_PATH under Windows 2003

2006-02-15 Thread Sergey
"Tim Golden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [Sergey] >Have a look at win32file.FindFilesIterator from the pywin32 extensions. >Maybe that can cope? (I haven't looked at the source). Yeah, it works! THANK YOU! (but now I must have two pieces of code, one for linux an

Re: low level data types

2006-02-15 Thread Fredrik Lundh
"dementrio" wrote: > However now I have another problem - endianness (the client runs on > powerpc, the server on x86). I found that simply reversing the stuff I > recv() works, but is there any cleaner way for taking care of this? http://docs.python.org/lib/module-struct.html (see the second ta

Re: Win32_Process.Create -- not starting process

2006-02-15 Thread abcd
so far i tried adding SET > c:\tmp.txt start SET > c:\tmp2.txt ...and I saw both tmp files created but no python running. I still have to try skipping the batch file...i'll let u know. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: low level data types

2006-02-15 Thread Daniel Dittmar
dementrio wrote: > Thanks for the hint! > > However now I have another problem - endianness (the client runs on > powerpc, the server on x86). I found that simply reversing the stuff I > recv() works, but is there any cleaner way for taking care of this? > http://docs.python.org/lib/module-struc

kwargs keyword evaluation

2006-02-15 Thread [EMAIL PROTECTED]
Ok, so here is my situation: Let's assume I have a function that makes good use of the kwargs parameter. It requires that there is a certain "format" for the kwargs keywords. (I am using Django, btw). The format is like such: "SOMEVAL__exact", etc., where SOMEVAL is some value that it parses from

Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
I want to find a way to embed a tar file *in* my python script, and then use the tarfile module to extract it. That is, instead of distributing two files (extractor.py and archive.tar) I want to be able to distribute *one* file (extractor-with-embedded-archive.py). Is there a way to do this? Than

How to tell the parent frame is a C module? (Lazy importing)

2006-02-15 Thread David Christian
Hello all, I've been working on a lazy import module to be found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473888 The basic idea is that a module proxy for foo is returned from an 'import foo' statement. When an attribute of foo is accessed, or dir(foo) is called, or a from fo

Re: kwargs keyword evaluation

2006-02-15 Thread Carsten Haese
On Wed, 2006-02-15 at 11:40, [EMAIL PROTECTED] wrote: > Ok, so here is my situation: > > Let's assume I have a function that makes good use of the kwargs > parameter. It requires that there is a certain "format" for the kwargs > keywords. (I am using Django, btw). The format is like such: > "SOMEV

Re: kwargs keyword evaluation

2006-02-15 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Let's assume I have a function that makes good use of the kwargs > parameter. It requires that there is a certain "format" for the kwargs > keywords. (I am using Django, btw). The format is like such: > "SOMEVAL__exact", etc., where SOMEVAL is some value that it parses f

Re: kwargs keyword evaluation

2006-02-15 Thread [EMAIL PROTECTED]
Well, I knew about the apply() function, but totally forgot to use it. It worked. Example: apply(function_call, (), {keyword: "Tom"}) -- http://mail.python.org/mailman/listinfo/python-list

Re: file names longer than MAX_PATH under Windows 2003

2006-02-15 Thread Sergey
"Claudio Grondi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sergey wrote: > I don't know if and how it apply and can be of any help here, but in my C > programs in the very past after switching from DOS to > Windows long names a following trick solved often my problems with to

Re: Embedding a binary file in a python script

2006-02-15 Thread Rene Pijlman
mrstephengross: >I want to find a way to embed a tar file *in* my python script, and >then use the tarfile module to extract it. That is, instead of >distributing two files (extractor.py and archive.tar) I want to be able >to distribute *one* file (extractor-with-embedded-archive.py). Is there >a w

Re: Embedding a binary file in a python script

2006-02-15 Thread Fredrik Lundh
"mrstephengross" wrote: > I want to find a way to embed a tar file *in* my python script, and > then use the tarfile module to extract it. That is, instead of > distributing two files (extractor.py and archive.tar) I want to be able > to distribute *one* file (extractor-with-embedded-archive.py).

Clarity: GIL, processes and CPUs etc

2006-02-15 Thread adsheehan
I have been reading many of the posting on the GIL and impact on threading etc. I have found is confusing and would welcome some clarity on this. I understand that embedding the interpreter in a C/C++ application limits it to one CPU. If the application is multi-threaded (system threads) in will n

Re: Embedding an Application in a Web browser

2006-02-15 Thread Magnus Lycka
bruno at modulix wrote: > rodmc wrote: > >>Is it possible to embed a Python application within Internet explorer? > > No. Nor in any other browser (except from Grail, but I think this > doesn't count). This is simply not true! Python can work as a Windows scripting language just as VB Script. T

Re: kwargs keyword evaluation

2006-02-15 Thread [EMAIL PROTECTED]
Thanks. That also worked. I will use that, since apply() is deprecated as of 2.3. Thanks! -Tom -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
Ok, this is a neat idea... The uu module deals with files though, not strings. Is there a way in python to make a string act like a file handle? Example: my_string = "uu-encoded-stuf.." my_out_file_handle = ?? # What should this variable look like? import uu uu.decode(my_string, my_out_file_h

Re: Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
Ok, this looks really cool, but can you explain a little more step-by-step what's going on? In the end, I need to have a single python script that (1) contains the archive and (2) can extract that archive. The example you've given is interesting, but it's not clear to me how to create the actual py

Re: Embedding a binary file in a python script

2006-02-15 Thread Diez B. Roggisch
mrstephengross wrote: > Ok, this is a neat idea... The uu module deals with files though, not > strings. Is there a way in python to make a string act like a file > handle? (c)?StringIO Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of finding terminal width/height?

2006-02-15 Thread Kent Johnson
Grant Edwards wrote: > I've got no complaints about the way things work, I was just > going to suggest changing the documentation to correctly > describe the way things work. Too mundane a solution? Submit a patch, it's quick and easy and fun: http://docs.python.org/about.html Kent -- http://mai

Re: Embedding a binary file in a python script

2006-02-15 Thread Rene Pijlman
mrstephengross: >Ok, this looks really cool, but can you explain a little more >step-by-step what's going on? What happened to "Hey thanks, I'll look into that" :-( -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >