XML Pickle with PyGraphLib - Problems

2005-09-05 Thread Mike P.
Hi all, I'm working on a simulation (can be considered a game) in Python where I want to be able to dump the simulation state to a file and be able to load it up later. I have used the standard Python pickle module and it works fine pickling/unpickling from files. However, I want to be able to us

Re: is dict.copy() a deep copy or a shallow copy

2005-09-05 Thread Alex
Thanks max, Now it's much clearer. I made the following experiment >>>#1 >>> D={'a':1, 'b':2} >>> D {'a': 1, 'b': 2} >>> E=D.copy() >>> E {'a': 1, 'b': 2} >>> D['a']=3 >>> D {'a': 3, 'b': 2} >>> E {'a': 1, 'b': 2} >>>#2 >>> D={'a':[1,3], 'b':[2,4]} >>> D {'a': [1, 3], 'b': [2, 4]} >>> E=D.copy() >>

wxImage can't read tif file? (WxPython)

2005-09-05 Thread James Hu
Hi, all gurus, I am working on a small project, which needs to display 16 bit tiff image on screen directly, I use wxStaticBitmap to do that, and I can show png and jpg file on the screen without any problem. (converting from tiff to png first is not option though). However, when I try to read tif

Re: pain

2005-09-05 Thread Steve Holden
Peter Hansen wrote: > Steve Holden wrote: > >>and the day managers stop being ignorant we'll all be able to fly around >>on pigs. Not wishing to offend the pigs, of course. >> >>still-working-for-myself-ly y'rs - steve > > > What Steve means here, of course, is that he is his own manager. > >

Re: Python Doc Problem Example: os.system

2005-09-05 Thread Robert Wierschke
Xah Lee schrieb: > Python Doc Problem Example: os.system > > Xah Lee, 2005-09 > > today i'm trying to use Python to call shell commands. e.g. in Perl > something like > > output=qx(ls) > > in Python i quickly located the the function due to its > well-named-ness: > > import os > os.system("ls"

Re: mod_python: what's going on here?

2005-09-05 Thread Olivier
Robert J. Hansen a écrit : > Does anyone have any experience with mod_python on OS X/Apache > environments? Can anyone shed some light on 500s that don't leave > traces in the error logs, or what precise incantation I need to make > mod_python start serving up scripts? Here is a setup that

Re: Possible improvement to slice opperations.

2005-09-05 Thread Szabolcs Nagy
with the current syntax L[i:i+1] returns [L[i]], with nxlist it returns L[i+1] if i<0. L=range(10) L[1:2]==[L[1]]==[1] L[-2:-1]==[L[-2]]==[8] L=nxlist(range(10)) L[1:2]==[L[1]]==[1] L[-2:-1]==[L[-1]]==[9] # not [L[-2]] IMHO in this case current list slicing is more consistent. -- http://mail.p

warning when doubly liked list is defined globally

2005-09-05 Thread chand
Hi., In my api.py file 'g_opt_list' is defined globally g_opt_list =[[],[],[],[],[],[],[]] when I run the py file, I am getting the Following Error SyntaxWarning: name 'g_opt_list' is used prior to global declaration Please let me know how to remove this error Here is the code which gives the

Re: Online Modification of Python Code

2005-09-05 Thread malv
I wrote a module testalgo.py with some functions to be modified. After modification I typed to the interactive shell: >>>import testalgo >>>reload(testalgo) ... and things seem to workout as you suggested. At least I modified some quickie print statements to check. I use eric3 and nothing in this I

Re: Assigning 'nochage' to a variable.

2005-09-05 Thread [EMAIL PROTECTED]
Thanks for the suggestions, although I'll probably continue to use: var1 = 17 var1 = func1(var1) print var1 and have func1 return the input value if no change is required. It's *almost* as nice as if there was a Nochange value available.. BR /CF -- http://mail.python.org/mailman/listinfo/py

sslerror: (8, 'EOF occurred in violation of protocol')

2005-09-05 Thread Robert
I'm using the https-protocol. On my systems and network everything works ok. But on some connections from some other users' computers/network I get this error (Python 2.3.5 on Windows): Traceback (most recent call last): File "", line 1, in ? File "ClientCookie\_urllib2_support.pyo", line 524,

Re: Online Modification of Python Code

2005-09-05 Thread malv
Hi Robert: (1) Things are not that simple. In fact in setting up a run, extensive database backup is already involved. Subsequently, data structures are built at runtime of typically 0.5Gbytes. Although saving this should work, it would require quite some debug/verification to check out the validit

Optional algol syntax style

2005-09-05 Thread Sokolov Yura
I think, allowing to specify blocks with algol style (for-end, if-end, etc) will allow to write easy php-like templates and would attract new web developers to python (as php and ruby do). It can be straight compilled into Python bytecode cause there is one-to-one transformation. So this: # -*- s

Re: time.mktime problem

2005-09-05 Thread Edvard Majakari
"McBooCzech" <[EMAIL PROTECTED]> writes: > ===snip=== > Values 100-1899 are always illegal. > . > . > strptime(string[, format]) > . > . > The default values used to fill in any missing data are: > (1900, 1, 1, 0, 0, 0, 0, 1, -1) > ===snip=== > > BTW, check the following code: >>>import datetime,

Re: regular expression unicode character class trouble

2005-09-05 Thread Diez B. Roggisch
Steven Bethard wrote: > I'd use something like r"[^_\d\W]", that is, all things that are neither > underscores, digits or non-alphas. In action: > > py> re.findall(r'[^_\d\W]+', '42badger100x__xxA1BC') > ['badger', 'x', 'xxA', 'BC'] > > HTH, Seems so, great! Diez -- http://mail.python.org/ma

Re: Online Modification of Python Code

2005-09-05 Thread Diez B. Roggisch
> > I seem to recall a post by Diez Roggish that reload() doesn't always > work as it should. Any news on this? At least im my preliminary test it > works. Read the docs on reload: http://www.python.org/doc/current/lib/built-in-funcs.html """ If a module is syntactically correct but its initia

Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Huron
Hi all, Sopinspace, Society For Public Information Spaces (specialized in Web-based citizen public debate and collaborative initiatives) is looking for a new developer / R&D engineer with strong Plone focus. The position is located in Paris, France (11eme). All details (in french) can be found he

Re: warning when doubly liked list is defined globally

2005-09-05 Thread Fredrik Lundh
"chand" <[EMAIL PROTECTED]> wrote: > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > when I run the py file, I am getting the Following Error > > SyntaxWarning: name 'g_opt_list' is used prior to global declaration > > Please let me know how to remove th

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Paul Rubin
Huron <[EMAIL PROTECTED]> writes: > Sopinspace, Society For Public Information Spaces (specialized in Web-based > citizen public debate and collaborative initiatives) is looking for a new > developer / R&D engineer with strong Plone focus. > The position is located in Paris, France (11eme). > > Al

RE: What is the role of F in dict(E, **F)

2005-09-05 Thread Marc Boeren
> As I understand update() is used to merge two dictionaries, > for example > >>> D={'a':1, 'b':2} > >>> E={'b':4,'c':6} > >>> D.update(E) > >>> D > {'a': 1, 'c': 6, 'b': 4} > >>> > > But what is the role of **F? >>> D={'a':1, 'b':2} >>> E={'b':4,'c':6} >>> D.update(E, a=3) >>> D {'a': 3, 'c'

Re: warning when doubly liked list is defined globally

2005-09-05 Thread Daniel Dittmar
chand wrote: > Hi., > > In my api.py file 'g_opt_list' is defined globally > g_opt_list =[[],[],[],[],[],[],[]] > > when I run the py file, I am getting the Following Error > > SyntaxWarning: name 'g_opt_list' is used prior to global declaration g_del_opt_list =[[],[],[],[],[],[],[]] #g_opt_lis

Re: Assigning 'nochage' to a variable.

2005-09-05 Thread [EMAIL PROTECTED]
Oh, right I see you also thought of that. (Sorry, didnt read your entire mail.) -- http://mail.python.org/mailman/listinfo/python-list

Re: dual processor

2005-09-05 Thread Nick Craig-Wood
Jeremy Jones <[EMAIL PROTECTED]> wrote: > One Python process will only saturate one CPU (at a time) because > of the GIL (global interpreter lock). I'm hoping python won't always be like this. If you look at another well known open source program (the Linux kernel) you'll see the progression I'

Re: Online Modification of Python Code

2005-09-05 Thread malv
Diez, You are quite right on using module.name when importing module objects. This happened to be the way I ran my initial successful tests. Later I modified things by using 'import * from algotest' and my modifications stopped from coming through. In my case reload comes in very handy. I can see

simple question: $1, $2 in py ?

2005-09-05 Thread es_uomikim
Hi, I have one small simple question, that I didn't found answer in google's. It's kind of begginers question because I'm a one. ; ) I wanned to ask how to use scripts with vars on input like this: $ echo "something" | ./my_script.py or: $ ./my_scripy.py var1 var2 As far as I understand the

Re: simple question: $1, $2 in py ?

2005-09-05 Thread Diez B. Roggisch
> > As far as I understand there's no $1, $2... etc stuff right ? Yes - but there is sys.argv Try this import this print sys.argv and invoke it as script with args. Make also sure to checkout modules optparse and getopt to deal with the options. Diez -- http://mail.python.org/mailman/lis

Re: dual processor

2005-09-05 Thread Alan Kennedy
[Jeremy Jones] >> One Python process will only saturate one CPU (at a time) because >> of the GIL (global interpreter lock). [Nick Craig-Wood] > I'm hoping python won't always be like this. Me too. > However its crystal clear now the future is SMP. Definitely. > So, I believe Python has got to

error when parsing xml

2005-09-05 Thread Odd-R.
I use xml.dom.minidom to parse some xml, but when input contains some specific caracters(æ, ø and å), I get an UnicodeEncodeError, like this: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 604: ordinal not in range(128). How can I avoid this error? All help much ap

Re: python logo

2005-09-05 Thread Joal Heagney
Tim Churches wrote: > Fredrik Lundh wrote: > >>Tim Churches wrote: >> >> >> >>>PPS Emerson's assertion might well apply not just to Python logos, but >>>also, ahem, to certain aspects of the Python standard library. >> >> >>you've read the python style guide, I presume? >> >>http://www.python.

Problem with: urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

2005-09-05 Thread Josef Cihal
Hi, I get an error, when I am trying to download URL with using Cookies. Where is the Problem? Thank u very much for all ideas!!! sincerely Josef import os, cookielib, urllib2 cj = cookielib.MozillaCookieJar() os.environ["http_proxy"] = "http://proxy.irm.at:1234"; os.environ['HOME']= r"C:\tmp

Re: Warning when doubly linked list is defined gloablly

2005-09-05 Thread chand
Hi All.., Sorry for mailing the code which does't even compile !! Please find below the code which compiles. Please let me know how to resolve this warning message..!! SyntaxWarning: name 'g_opt_list' is used prior to global declaration import os,sys,re,string,math from xml.dom import minidom,

Re: Assigning 'nochage' to a variable.

2005-09-05 Thread Bengt Richter
On 5 Sep 2005 02:19:05 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >Thanks for the suggestions, although I'll probably continue to use: > > var1 = 17 > var1 = func1(var1) > print var1 > >and have func1 return the input value if no change is required. >It's *almost* as nice as if there wa

Re: Controlling memory allocation

2005-09-05 Thread Tommy . Ryding
Hello. I have done the thing you are requesting. You can easily create your own memory pool and have Python to use it. I added some rows to Pyconfig.h: #ifdef malloc #undef malloc #endif /*malloc*/ #define malloc Python_malloc Then I have some overhead in my own Python_malloc(size_t nBytes) --

Re: simple question: $1, $2 in py ?

2005-09-05 Thread es_uomikim
Diez B. Roggisch wrote: >> >> As far as I understand there's no $1, $2... etc stuff right ? > > > Yes - but there is sys.argv > Oh, yes. Right : ) It feels that I miss-looked it. thank You very much for an advice : ) greetz, T -- "Przyjacielu, lepiej nas dobrze wypieprz zamiast prawić nam k

Re: python logo

2005-09-05 Thread Fredrik Lundh
Tim Churches wrote: >>> also, ahem, to certain aspects of the Python standard library. >> >> you've read the python style guide, I presume? >> >> http://www.python.org/peps/pep-0008.html > > A Foolish Consistency is the Hobgoblin of Little Minds. > --often ascribed to Ralph Waldo Emerson b

Re: error when parsing xml

2005-09-05 Thread Fredrik Lundh
Odd-R. wrote: > I use xml.dom.minidom to parse some xml, but when input < contains some specific caracters(æ, ø and å), I get an > UnicodeEncodeError, like this: > > UnicodeEncodeError: 'ascii' codec can't encode character > u'\xe6' in position 604: ordinal not in range(128). > > How can I avoid t

Re: Optional algol syntax style

2005-09-05 Thread Mikael Olofsson
Sokolov Yura wrote: > I think, allowing to specify blocks with algol style (for-end, if-end, > etc) will allow to write easy php-like templates > and would attract new web developers to python (as php and ruby do). > It can be straight compilled into Python bytecode cause there is > one-to-one tr

Re: simple question: $1, $2 in py ?

2005-09-05 Thread Laszlo Zsolt Nagy
>Oh, yes. Right : ) >It feels that I miss-looked it. > >thank You very much for an advice : ) > > Also try the OptParse module. http://www.python.org/doc/2.4/lib/module-optparse.html It handles the GNU/POSIX syntax very well. Les -- http://mail.python.org/mailman/listinfo/python-list

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Huron
> Since you're posting in English, is there any point in responding > to it in English, and are non-Europeans eligible? I'm afraid not. The team is too small to welcome remote work at the present time ... I was posting in english mainly to avoid beeing flag as spam ... and because I though I might

Has anybody tried to make a navigation like Google?

2005-09-05 Thread Lad
Hi, I would like to make in my web application a similar navigation like Google uses, I mean at the bottom of each page there are numbers of returned pages after you search query. Has anyone tried that? Is there an algorithm for that? I do not want to re-invent the wheel. Thank you for help La. -

Re: error when parsing xml

2005-09-05 Thread Diez B. Roggisch
if you're getting this on the way in, something is broken (posting a short self-contained test program will help us figure out what's wrong). Or he tries to pass a unicode object to parseString. Regards, Diez # -*- coding: utf-8 -*- import xml.dom.minidom dom3 = xml.dom.minidom.parseString(

Re: dual processor

2005-09-05 Thread Scott David Daniels
Nick Craig-Wood wrote: > Splitting the GIL introduces performance and memory penalties > However its crystal clear now the future is SMP. Modern chips seem to > have hit the GHz barrier, and now the easy meat for the processor > designers is to multiply silicon and make multiple thread / core

error when parsing xml

2005-09-05 Thread Albert Leibbrandt
>> I use xml.dom.minidom to parse some xml, but when input >> contains some specific caracters(æ, ø and å), I get an >> UnicodeEncodeError, like this: >> >> UnicodeEncodeError: 'ascii' codec can't encode character >> u'\xe6' in position 604: ordinal not in range(128). >> >> How can I avoid this err

Re: python logo

2005-09-05 Thread Tim Churches
Fredrik Lundh wrote: >Tim Churches wrote: > > > also, ahem, to certain aspects of the Python standard library. >>>you've read the python style guide, I presume? >>> >>>http://www.python.org/peps/pep-0008.html >>> >>> >>A Foolish Consistency is the Hobgoblin of Lit

Re: error when parsing xml

2005-09-05 Thread Odd-R.
On 2005-09-05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Odd-R. wrote: > >> I use xml.dom.minidom to parse some xml, but when input >< contains some specific caracters(æ, ø and å), I get an >> UnicodeEncodeError, like this: >> >> UnicodeEncodeError: 'ascii' codec can't encode character >> u'\xe6'

Re: Has anybody tried to make a navigation like Google?

2005-09-05 Thread Sybren Stuvel
Lad enlightened us with: > I would like to make in my web application a similar navigation like > Google uses, I mean at the bottom of each page there are numbers of > returned pages after you search query. Has anyone tried that? Is > there an algorithm for that? I do not want to re-invent the wh

Re: error when parsing xml

2005-09-05 Thread Fredrik Lundh
Odd-R. wrote: > This is retrieved through a webservice and stored in a variable test > > > > > ]> > æøå > > printing this out yields no problems, so the trouble seems to be when > executing < the following: > > doc = minidom.parseString(test) unless we have a cut-and-paste problem here, that

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Bengt Richter
On 05 Sep 2005 03:06:34 -0700, Paul Rubin wrote: >Huron <[EMAIL PROTECTED]> writes: >> Sopinspace, Society For Public Information Spaces (specialized in Web-based >> citizen public debate and collaborative initiatives) is looking for a new >> developer / R&D engineer wit

Re: Possible improvement to slice opperations.

2005-09-05 Thread Magnus Lycka
Ron Adam wrote: > Slicing is one of the best features of Python in my opinion, but > when you try to use negative index's and or negative step increments > it can be tricky and lead to unexpected results. Hm... Just as with positive indexes, you just need to understand the concept properly. > Thi

Re: error when parsing xml

2005-09-05 Thread Diez B. Roggisch
Odd-R. wrote: > This is retrieved through a webservice and stored in a variable test > > > > > ]> > æøå > > printing this out yields no problems, so the trouble seems to be when > executing > the following: > > doc = minidom.parseString(test) You need to do doc = minidom.parseString(test.e

Re: error when parsing xml

2005-09-05 Thread Diez B. Roggisch
> I have found that some people refuse to stick to standards, so whenever I > parse XML files I remove any characters that fall in the range > <= 0x1f > >>= 0xf0 Now of what help shall that be? Get rid of all accented characters? Sorry, but that surely is the dumbest thing to do here - and has

Re: Warning when doubly linked list is defined gloablly

2005-09-05 Thread Peter Otten
chand wrote: > Sorry for mailing the code which does't even compile !! You probably missed that other hint where Fredrik Lunddh told you to somewhat reduce the script's size. > Please find below the code which compiles. Please let me know how to > resolve this warning message..!! > SyntaxWarning

epydoc CLI and many files

2005-09-05 Thread Laszlo Zsolt Nagy
Hello, I have a problem under Windows. I use the cli.py program included with epydoc. I wrote a small program that lists all of my modules after the cli. Something like this: cli.py --html --inheritance=grouped module1.py module2.py module3.py .. The problem is that now I have so many m

newbie Q: mouse clicks don't seem to get trapped

2005-09-05 Thread mitsura
Hi, I want to display a window containing an image and when I move the mouse over the image and click on the left Mb, I want to get the position of the mouse on the image. I listed the code to view the image below (so far so good) but for some reason the EVT_LEFT_DOWN/UP does not work. Any idea w

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Sybren Stuvel
Rick Wotnaz enlightened us with: > That is, a reference to xxx.func(), without a previous import of xxx > *could* be resolvable automatically, at least for those modules that > can be found in a standard location. -1 on that one. If I want to use a module, I'll write an import statement for it. Th

Re: Possible improvement to slice opperations.

2005-09-05 Thread Scott David Daniels
Magnus Lycka wrote: > Ron Adam wrote: >> ONES BASED NEGATIVE INDEXING I think Ron's idea is taking off from my observation that if one's complement, rather than negation, was used to specify measure-from- right, we would have a simple consistent system (although I also observed it is far too late

Re: epydoc CLI and many files

2005-09-05 Thread Sybren Stuvel
Laszlo Zsolt Nagy enlightened us with: > I wrote a small program that lists all of my modules after the > cli. Something like this: > > cli.py --html --inheritance=grouped module1.py module2.py module3.py > .. > > The problem is that now I have so many modules that the shell > (cmd.exe) can

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Rick Wotnaz <[EMAIL PROTECTED]> wrote: > Michael Hoffman <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > What would people think about adding sys to __builtins__ so that > > "import sys" is no longer necessary? This is something I must > > add to eve

Re: error when parsing xml

2005-09-05 Thread Richard Brodie
> > I have found that some people refuse to stick to standards, so whenever I > > parse XML files I remove any characters that fall in the range > > <= 0x1f > > > >>= 0xf0 > > Now of what help shall that be? Get rid of all accented characters? > Sorry, but that surely is the dumbest thing to do he

Re: simple question: $1, $2 in py ?

2005-09-05 Thread es_uomikim
Laszlo Zsolt Nagy wrote: > Also try the OptParse module. > > http://www.python.org/doc/2.4/lib/module-optparse.html > > It handles the GNU/POSIX syntax very well. > > Les > Oh thanx, that could be really helpfull : ) btw there was a great artist/photographer named: Laszlo Moholy-Nagy - sim

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Huron
> It says, "bonne maîtrise de l'anglais écrit et parlé (toute autre langue > sera un plus)" so good mastery of English written and spoken is the main > language requirement (stated, that is ;-) But "capacité de dialoguer avec > des usagers non techniques et tous les membres de l'équipe" probably m

How to use the OS's native file selector in Tkinter

2005-09-05 Thread copx
Hi, I would like to use the native file selector of the "host OS" for the "Open File" function of my Python/Tkinter app. Could anyone tell me how to do this? My primary target platform is Windows. So a Windows-only solution would be ok (IIRC Linux doesn't even have a "native file selector"). c

Re: Controlling memory allocation

2005-09-05 Thread cwoolf
Good to know that works :) Did you also do the same for free and realloc to keep up with your accounting? The more I thought about it, the more I realized that calls to other library functions could cause address space expansion if that code internally called malloc or mmap. See, I can use the O

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 5)

2005-09-05 Thread Diez B. Roggisch
QOTW: "You can lead an idiot to idioms, but you can't make him think ;-)" -- Steve Holden "A foolish consistency is the hobgoblin of little minds." -- Ralph Waldo Emerson (used by Tim Churches, and also found in http://www.python.org/peps/pep-0008.html) PyPy has come a long way - and made

Re: Magic Optimisation

2005-09-05 Thread Paul McGuire
I still think there are savings to be had by looping inside the try-except block, which avoids many setup/teardown exception handling steps. This is not so pretty in another way (repeated while on check()), but I would be interested in your timings w.r.t. your current code. def loop(self):

Re: Magic Optimisation

2005-09-05 Thread Paul McGuire
Raymond Hettinger posted this recipe to the Python Cookbook. I've not tried it myself, but it sounds like what you're looking for. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277940 -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: DrPython debugger

2005-09-05 Thread Pandiani
Thanks for repy. However, I found SimpleDebugger 0.5 from sourceforge.net as plugin for drPython but I'm getting error message because DrPython cannot load module drPythonChooser and it seems that the module is removed from latest version of drPython. Or maybe I wasn't able to figure out how to ins

Re: Has anybody tried to make a navigation like Google?

2005-09-05 Thread Will McGugan
Lad wrote: > Hi, > I would like to make in my web application a similar navigation like > Google uses, I mean at the bottom of each page there are numbers of > returned pages after you search query. > Has anyone tried that? Is there an algorithm for that? I do not want to > re-invent the wheel. >

Re: Has anybody tried to make a navigation like Google?

2005-09-05 Thread Mike C. Fletcher
Lad wrote: >Hi, >I would like to make in my web application a similar navigation like >Google uses, I mean at the bottom of each page there are numbers of >returned pages after you search query. >Has anyone tried that? Is there an algorithm for that? I do not want to >re-invent the wheel. >Thank

Re: 'isa' keyword

2005-09-05 Thread Rocco Moretti
Colin J. Williams wrote: > Rocco Moretti wrote: > >> Terry Hancock wrote: >> >>> On Thursday 01 September 2005 07:28 am, Fuzzyman wrote: >>> What's the difference between this and ``isinstance`` ? >>> >>> I must confess that an "isa" operator sounds like it would >>> have been slightly nicer

Getting the bytes or percent uploaded/downloaded through FTP?

2005-09-05 Thread Nainto
Hi, I'm just wondering if there is any way to get the number of bytes, or the percentage, that have been uploaded/downloaded when uploading/downloading a file throught ftp in Python. I have searched Google many times but could find nothing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Rick Wotnaz
"Michael J. Fromberger" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In article <[EMAIL PROTECTED]>, > Rick Wotnaz <[EMAIL PROTECTED]> wrote: > >> Michael Hoffman <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]: >> >> > What would people think about adding sys to __builtins__

Dr. Dobb's Python-URL! - weekly Python news and links (Sep 5)

2005-09-05 Thread Diez B. Roggisch
QOTW: "You can lead an idiot to idioms, but you can't make him think ;-)" -- Steve Holden "A foolish consistency is the hobgoblin of little minds." -- Ralph Waldo Emerson (used by Tim Churches, and also found in http://www.python.org/peps/pep-0008.html) PyPy has come a long way - and made

Re: Getting the bytes or percent uploaded/downloaded through FTP?

2005-09-05 Thread Benji York
[EMAIL PROTECTED] wrote: > Hi, I'm just wondering if there is any way to get the number of bytes, > or the percentage, that have been uploaded/downloaded when > uploading/downloading a file throught ftp in Python. I have searched > Google many times but could find nothing. If you're using urllib y

Re: How to use the OS's native file selector in Tkinter

2005-09-05 Thread jepler
tkFileDialog.Open is a wrapper around tk's tk_getOpenFile. tk_getOpenFile uses the native dialog on Windows, via the GetOpenFileName() win32 API call, at least in Tk versions 8.2 and newer. Jeff pgpSfgD3cQ3re.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: DrPython debugger

2005-09-05 Thread Franz Steinhaeusler
On 5 Sep 2005 07:36:18 -0700, "Pandiani" <[EMAIL PROTECTED]> wrote: >Thanks for repy. >However, I found SimpleDebugger 0.5 from sourceforge.net as plugin for >drPython but I'm getting error message because DrPython cannot load >module drPythonChooser and it seems that the module is removed from >l

Re: Getting the bytes or percent uploaded/downloaded through FTP?

2005-09-05 Thread Nainto
Thanks, Benji but I need to be able to get the bytes and/or percent of a download too. :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: 'isa' keyword

2005-09-05 Thread D H
Colin J. Williams wrote: > Could you elaborate on that please? See my earlier post in this thread, this link: http://www.canonical.org/~kragen/isinstance/ -- http://mail.python.org/mailman/listinfo/python-list

command line path

2005-09-05 Thread mclaugb
I am trying to pass the name of several files to a python script as command line arguments. When i type in python ImportFiles_test.py C:\Program Files\National Instruments\LabVIEW 7.1\project\calibration\FREQUENCY_ 13.CSV The following error results: C:\Program Traceback (most recent call la

logging into one file problem

2005-09-05 Thread Maksim Kasimov
hello in my modules, I'm using logging module, doing thus (there is a few modules): in module1.py: hdl = logging.StreamHandler() fmt = logging.Formatter("%(name)s:\t%(levelname)s:\t%(asctime)s:\t%(message)s") hdl.setFormatter(fmt) log = logging.getLogger('module1') log.addHandler(hdl) In scr

Re: command line path

2005-09-05 Thread Diez B. Roggisch
> > I debugged a little and what is happening is the space in "c:\Program Files" > and "...\National Instruments..\" is being parsed as separate arguments and > i only wish for them to be parsed as one. > > How do I get pass a path string containing spaces? Surround it with double quotes. This

Re: command line path

2005-09-05 Thread Lee Harr
On 2005-09-05, mclaugb <[EMAIL PROTECTED]> wrote: > I am trying to pass the name of several files to a python script as command > line arguments. When i type in > > > python ImportFiles_test.py C:\Program Files\National Instruments\LabVIEW > 7.1\project\calibration\FREQUENCY_ > 13.CSV > > The fo

Re: Possible improvement to slice opperations.

2005-09-05 Thread Steve Holden
Scott David Daniels wrote: > Magnus Lycka wrote: [...] >>>The '~' is the binary not symbol which when used >>>with integers returns the two's compliment. > > Actually, the ~ operator is the one's complement operator. > Actually the two are exactly the same thing. Could we argue about substantiv

improvements for the logging package

2005-09-05 Thread Rotem
Hi, while working on something in my current project I have made several improvements to the logging package in Python, two of them are worth mentioning: 1. addition of a logging record field %(function)s, which results in the name of the entity which logged the record. My version even deduces the

Re: Possible improvement to slice opperations.

2005-09-05 Thread Ron Adam
Scott David Daniels wrote: > Magnus Lycka wrote: > >> Ron Adam wrote: >> >>> ONES BASED NEGATIVE INDEXING > > > I think Ron's idea is taking off from my observation that if one's > complement, rather than negation, was used to specify measure-from- > right, we would have a simple consistent sys

xmlrcp register classes

2005-09-05 Thread Sergio Rua
Hello, I have a structured program with several classes which I would like to export using a xmlrpc server. I'm doing this Server = SimpleXMLRPCServer (('127.0.0.1',8080)) Server.register_instance(MyClass1()) Server.register_instance(MyClass2()) Server.register_instance(MyClass3()) What is seem

Re: xmlrcp register classes

2005-09-05 Thread Brian Quinlan
Sergio Rua wrote: > Server = SimpleXMLRPCServer (('127.0.0.1',8080)) > > Server.register_instance(MyClass1()) > Server.register_instance(MyClass2()) > Server.register_instance(MyClass3()) > > What is seems to happen is that only the last class I register it is the > only one being exported. How c

Re: Possible improvement to slice opperations.

2005-09-05 Thread Fredrik Lundh
Steve Holden wrote: > Yes, I've been surprised how this thread has gone on and on. it's of course a variation of "You can lead an idiot to idioms, but you can't make him think ;-)" as long as you have people that insist that their original misunderstandings are the only correct way to m

Re: Getting the bytes or percent uploaded/downloaded through FTP?

2005-09-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Thanks, Benji but I need to be able to get the bytes and/or percent of > a download too. :-( > The only way I can think of to get the size of the file you're about to download is using the FTP object's .dir() method. If you have the Tools directory (standard on Windows

Re: newbie Q: mouse clicks don't seem to get trapped

2005-09-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Hi, > > I want to display a window containing an image and when I move the > mouse over the image and click on the left Mb, I want to get the > position of the mouse on the image. > I listed the code to view the image below (so far so good) but for some > reason the EVT_

Re: Getting the bytes or percent uploaded/downloaded through FTP?

2005-09-05 Thread Fredrik Lundh
Steve Holden wrote: > The only way I can think of to get the size of the file you're about to > download is using the FTP object's .dir() method. If you have the Tools > directory (standard on Windows, with source on other platforms) you can > take a look at the ftpmirror script - a fairly recent

Re: dual processor

2005-09-05 Thread Nick Craig-Wood
Scott David Daniels <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > > Splitting the GIL introduces performance and memory penalties > > However its crystal clear now the future is SMP. Modern chips seem to > > have hit the GHz barrier, and now the easy meat for the processor > > designe

Re: Possible improvement to slice opperations.

2005-09-05 Thread Ron Adam
Szabolcs Nagy wrote: > with the current syntax L[i:i+1] returns [L[i]], with nxlist it returns > L[i+1] if i<0. > > L=range(10) > L[1:2]==[L[1]]==[1] > L[-2:-1]==[L[-2]]==[8] > > L=nxlist(range(10)) > L[1:2]==[L[1]]==[1] > L[-2:-1]==[L[-1]]==[9] # not [L[-2]] > > IMHO in this case current list

Re: Possible improvement to slice opperations.

2005-09-05 Thread Ron Adam
Magnus Lycka wrote: > Ron Adam wrote: > >> Slicing is one of the best features of Python in my opinion, but >> when you try to use negative index's and or negative step increments >> it can be tricky and lead to unexpected results. > > > Hm... Just as with positive indexes, you just need to und

Re: xmlrcp register classes

2005-09-05 Thread Sergio Rua
Hello, > class MyCombinedClass(MyClass1, MyClass2, MyClass3): > pass > > Server.register_instance(MyCombinedClass()) That was easy :) Thanks a lot. -- Sergio Rua -- http://mail.python.org/mailman/listinfo/python-list

Re: simple question: $1, $2 in py ?

2005-09-05 Thread Lee Harr
On 2005-09-05, es_uomikim <[EMAIL PROTECTED]> wrote: > Hi, > > I have one small simple question, that I didn't found answer in > google's. It's kind of begginers question because I'm a one. ; ) > > I wanned to ask how to use scripts with vars on input like this: > > $ echo "something" | ./my_scrip

Newbie: Datetime, "Prog. in Win32", and how Python thinks

2005-09-05 Thread Max Yaffe
Dear Group, First of all, thanks for all the postings about Datetime. They've helped alot. I'm a newbie to Python (albeit very experienced in programming C & OO) and trying to use "Programming in Win32" by Hammond & Robinson [H&R] to learn it. This may be a mistake since I think it refers to

Re: Possible improvement to slice opperations.

2005-09-05 Thread Ron Adam
Fredrik Lundh wrote: > Steve Holden wrote: > > >>Yes, I've been surprised how this thread has gone on and on. > > > it's of course a variation of > > "You can lead an idiot to idioms, but you can't make him > think ;-)" > > as long as you have people that insist that their original m

Re: dual processor

2005-09-05 Thread Paul Rubin
Nick Craig-Wood <[EMAIL PROTECTED]> writes: > > of is decrementing a reference count. Only one thread can be allowed to > > DECREF at any given time for fear of leaking memory, even though it will > > most often turn out the objects being DECREF'ed by distinct threads are > > themselves distin

Re: Job Offer in Paris, France : R&D Engineer (Plone)

2005-09-05 Thread Paul Rubin
Huron <[EMAIL PROTECTED]> writes: > > Since you're posting in English, is there any point in responding > > to it in English, and are non-Europeans eligible? > > I'm afraid not. The team is too small to welcome remote work at the present > time ... Working remotely hadn't occurred to me ;-). I

  1   2   >