Re: new itertools functions in Python 2.6

2008-07-14 Thread Raymond Hettinger
On Jul 14, 1:26 pm, Mensanator <[EMAIL PROTECTED]> wrote: > ##  Combinations with replacement > ##  - > ##  aaa aab aac aad aae abb abc abd abe acc acd ace > ##  add ade aee bbb bbc bbd bbe bcc bcd bce bdd bde > ##  bee ccc ccd cce cdd cde cee ddd dde dee eee > ## > ##  

Re: Python pack and unpack question

2008-07-14 Thread Mark Tolonen
"joe shoemaker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] If you have the following: data = unpack('>L', sock.recv(4)) Does this line of code means that incoming data is big endian and unpack it to endianess of local machine? If local machine is little endian, then big

Re: iterator clone

2008-07-14 Thread Yosifov Pavel
On 14 июл, 23:36, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 13 juil, 12:05, Yosifov Pavel <[EMAIL PROTECTED]> wrote: > (snip) > > > defcloneiter( it ): > > """return (clonable,clone)""" > > return tee(it) > > This might as well be written as > > cloneiter = tee > > Or yet better,

Re: How to write a custom tracer/profiler?

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 23:48:20 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribi�: The main logic will issue a number of calls to the DS in order to get the data it needs and then carry out some calculations. I want to have a non-intrusive way to find out all the DS data requested by the mai

Re: iterator clone

2008-07-14 Thread Kay Schluehr
On 13 Jul., 08:53, Yosifov Pavel <[EMAIL PROTECTED]> wrote: > Whats is the way to clone "independent" iterator? I can't use tee(), > because I don't know how many "independent" iterators I need. copy and > deepcopy doesn't work... > > --pavel You can try generator_tools http://pypi.python.org/pyp

Re: how can I use exec with main module globals?

2008-07-14 Thread Gabriel Genellina
En Sat, 12 Jul 2008 16:15:36 -0300, Akathorn Greyhat <[EMAIL PROTECTED]> escribi�: Hello, this is my first message in the group. Welcome! I'm spanish so my english sometimes is really bad, sorry =( I have a problem and I hope someone has the answer. I'm trying to make an in-game python i

Re: a module.pth question

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 08:26:49 -0300, oyster <[EMAIL PROTECTED]> escribi�: My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] import sys sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') import pyglet [/code]

Re: Problems Returning an HTTP 200 Ok Message

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 17:46:12 -0300, samwyse <[EMAIL PROTECTED]> escribió: On Jul 11, 3:46 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: As Guy Davidson has already pointed out, this is a problem in the meter That would have been me, not Guy. Indeed, sorry the misattribution! -- Gabrie

Re: Converting from local -> UTC

2008-07-14 Thread Gabriel Genellina
En Mon, 14 Jul 2008 12:06:30 -0300, Keith Hughitt <[EMAIL PROTECTED]> escribió: On Jul 12, 12:52 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt   <[EMAIL PROTECTED]> escribió: > I am having a little trouble figuring out how to convert a pyt

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, > Could it be that I have to install the same python version Blender was > compiled with? I have no idea. May I suggest you ask in the blender list? HTH, -- Miki <[EMAIL PROTECTED]> http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Method behavior for user-created class instances

2008-07-14 Thread crazychimp132
On Jul 14, 9:04 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Greetings. > > > I am looking for a way to achieve method behavior for a class I > > created. That is, it has a __call__ method, so can be called like a > > function. But I also want it to be treated as a met

Re: Python ver of System.arraycopy() in Java

2008-07-14 Thread Miki
Hello, > I could seem to find a built in function that would serve the purpose > of System.arraycopy() in java. > > I was able to accomplish it with something like this: > > def arraycopy(source, sourcepos, dest, destpos, numelem): >     dest[destpos:destpos+numelem] = source[sourcepos:sourcepos >

How to write a custom tracer/profiler?

2008-07-14 Thread [EMAIL PROTECTED]
Hi, all, Just wanna look for some suggestions on how to appoarch this problem... I have some code ("main logic") which has a dependency on a library. Let's call it DS. ("data source"). The main logic will issue a number of calls to the DS in order to get the data it needs and then carry out some

Re: a module.pth question

2008-07-14 Thread oyster
there are 2 reasons: 1. I use both py24 and py25, I don't like to install 2 copies of pyglet, which is a pure python module and can be used by py24/25 at the same time, thus I am not willing to put a module under site-packages, instead I use a separate directory(h:\pure_pylib in my case) 2. I also

Re: Determining when a file has finished copying

2008-07-14 Thread Ethan Furman
Michiel Overtoom wrote: Ethan wrote: One more option may be to attempt to rename the file -- if it's still open for copying, that will fail; success indicates the copy is done. Caveat -- this is dependent on the operating system! Windows will indeed not allow you to rename or delete a fil

Re: One step up from str.split()

2008-07-14 Thread Joel Koltner
Thanks Matt, that looks like just what I want! -- http://mail.python.org/mailman/listinfo/python-list

Re: About wmi

2008-07-14 Thread patrol
Situation (1): result = new_process.terminate() TypeError: 'int' object is not callable Situation (2): result = new_process.terminate() File "C:\Python25\lib\wmi.py", line 494, in __getattr__ handle_com_error (error_info) File "C:\Python25\lib\wmi.py", line 190, in handle_com_erro

Re: One step up from str.split()

2008-07-14 Thread Larry Bates
Joel Koltner wrote: I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp --dosomething --loadthis "my file name.fil" ...and I'd like t

Re: Need help in writing up a Python Syntax checker

2008-07-14 Thread Kinokunya
On Jul 14, 6:48 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 14 Jul., 08:22, Kinokunya <[EMAIL PROTECTED]> wrote: > > > Hi guys, > > > My group and I will be working on our final year project, the scope to > > do a program/web-based application similar areas of functionalities > > like the PyLi

Re: Is it possible to create "network conneciton" on windows system?

2008-07-14 Thread Larry Bates
Evan wrote: On Jul 15, 6:22 am, Larry Bates <[EMAIL PROTECTED]> wrote: Evan wrote: Hello, one of my PC is window system, and in "control panel ->Network Connections", I can see somenetworkconnectionssuch as PPPOE or VPN which I created by click "create a new connection". My question is, is it p

Re: One step up from str.split()

2008-07-14 Thread Timothy Grant
On Mon, Jul 14, 2008 at 6:33 PM, Joel Koltner <[EMAIL PROTECTED]> wrote: > I normally use str.split() for simple splitting of command line arguments, > but > I would like to support, e.g., long file names which-- under windows -- are > typically provided as simple quoted string. E.g., > > myapp -

Python pack and unpack question

2008-07-14 Thread joe shoemaker
If you have the following: data = unpack('>L', sock.recv(4)) Does this line of code means that incoming data is big endian and unpack it to endianess of local machine? If local machine is little endian, then big endian is automatically converted to little endian format? thank you. -- http:

urllib2 http authentication/redirection/cookie issue

2008-07-14 Thread Neuberger, Sheldon N.
I have a tricky situation here with auth/redirection/cookies and I think I am messing something up with the handler. I am trying to open a site http://foo.example.com which redirects (status 302) to https://bar.example.com/ where the dashes represent lots of subdirectories and paramete

Re: One step up from str.split()

2008-07-14 Thread Matimus
On Jul 14, 6:33 pm, "Joel Koltner" <[EMAIL PROTECTED]> wrote: > I normally use str.split() for simple splitting of command line arguments, but > I would like to support, e.g., long file names which-- under windows -- are > typically provided as simple quoted string. E.g., > > myapp --dosomething -

One step up from str.split()

2008-07-14 Thread Joel Koltner
I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp --dosomething --loadthis "my file name.fil" ...and I'd like to get back a list wher

Re: About wmi

2008-07-14 Thread patrol
Hi, > 1) I'm not sure if WMI can be forced to close down system processes, > but if it can it's probably by means of specifying one or more > privileges when you connect. Try looking in the WMI newsgroups > for a more general (non-Python) answer to this and I'll happily > explain how to apply it in

Re: Python Tiddlywiki class

2008-07-14 Thread David
CracKPod wrote: Hello, I wrote a Python class to interact with the TiddlyWiki. In case you are interested you can find it on my blog: http://crackpod.bplaced.net/ CracKPod -- http://mail.python.org/mailman/listinfo/python-list Thank you :) -- Powered by Gentoo GNU/LINUX http://www.linux

Re: Method behavior for user-created class instances

2008-07-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def __call__(self,

Re: About the slot declaration decorator in PyQt4

2008-07-14 Thread Bighead
On Jul 15, 2:04 am, "Sebastian \"lunar\" Wiesner" <[EMAIL PROTECTED]> wrote: > Bighead <[EMAIL PROTECTED]>: > > > I remember when I did UI Design in PyQt4 for the first time, I found a > > manual. In it, no "connect" was used. Instead, an OO approach is > > applied, new UI classes inherit from old

Re: Is it possible to create "network conneciton" on windows system?

2008-07-14 Thread Evan
On Jul 15, 6:22 am, Larry Bates <[EMAIL PROTECTED]> wrote: > Evan wrote: > > Hello, > > > one of my PC is window system, and in "control panel ->Network > >Connections", I can see somenetworkconnectionssuch as PPPOE or VPN > > which I created by click "create a new connection". > > > My question is

Python ver of System.arraycopy() in Java

2008-07-14 Thread Jordan
I could seem to find a built in function that would serve the purpose of System.arraycopy() in java. I was able to accomplish it with something like this: def arraycopy(source, sourcepos, dest, destpos, numelem): dest[destpos:destpos+numelem] = source[sourcepos:sourcepos +numelem] is there

Re: Using Python To Launch Python

2008-07-14 Thread Derek Martin
On Mon, Jul 14, 2008 at 05:40:43PM -0400, Aquil H. Abdullah wrote: > You've hit the proverbial nail with the hammer. The problem is that my > application needs to run under both the Linux and Windows OSs, so while I > would love to use a nice sh, csh, or bash shell script. My hands are tied > beca

Method behavior for user-created class instances

2008-07-14 Thread crazychimp132
Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def __call__(self, inst): pass class bar:

Re: Why is there no GUI-tools like this for Windows?

2008-07-14 Thread name
It seems the video is showing glade, which is also available for wx under the name wxglade, I do not know whether it's available for Windows. I think it should work because it itself is written in Python. I personally prefer to code my GUI myself, so I can do looping stuff with it, but that is just

Re: Bug when using with_statement with exec

2008-07-14 Thread Jerry Hill
On Mon, Jul 14, 2008 at 6:00 PM, Matimus <[EMAIL PROTECTED]> wrote: > If I create a function by using exec on a string and _don't_ end the > string with a new-line it will work just fine unless I "from > __future__ import with_statement". [snip] > I searched python's issue database and didn't see a

Re: Using Python To Launch Python

2008-07-14 Thread Larry Bates
aha wrote: Hello All, I have a situation where I can count on a Python installation being available on a system, but I can't count on it being a version of Python needed by my application. Since my application has it's own version of Python installed with it how should I use the system Python

Re: Is it possible to create "network conneciton" on windows system?

2008-07-14 Thread Larry Bates
Evan wrote: Hello, one of my PC is window system, and in "control panel -> Network Connections", I can see some network connections such as PPPOE or VPN which I created by click "create a new connection". My question is, is it possible to create a new connection by using Python script? which me

Re: logging via SocketHandler and TCPserver

2008-07-14 Thread Larry Bates
Vinay Sajip wrote: On Jul 13, 9:25 pm, Larry Bates <[EMAIL PROTECTED]> wrote: Every time I look at theloggingmodule (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I REALLY need to be able to mon

Bug when using with_statement with exec

2008-07-14 Thread Matimus
I think I'm going to create a new issue in Pythons issue database, but I wanted to run it by the news group first. See if I can get any useful feed back. The following session demonstrates the issue: Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help"

Re: Using Python To Launch Python

2008-07-14 Thread Ivan Ven Osdel
>Hello All, > I have a situation where I can count on a Python installation being >available on a system, but I can't count on it being a version of >Python needed by my application. Since my application has it's own >version of Python installed with it how should I use the system Python >to laun

Python Tiddlywiki class

2008-07-14 Thread CracKPod
Hello, I wrote a Python class to interact with the TiddlyWiki. In case you are interested you can find it on my blog: http://crackpod.bplaced.net/ CracKPod -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Python To Launch Python

2008-07-14 Thread Mike Driscoll
On Jul 14, 4:01 pm, aha <[EMAIL PROTECTED]> wrote: > Hello All, >   I have a situation where I can count on a Python installation being > available on a system, but I can't count on it being a version of > Python needed by my application.  Since my application has it's own > version of Python insta

Re: Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-14 Thread Benjamin Kaplan
On Mon, Jul 14, 2008 at 12:02 PM, Hartmut Goebel <[EMAIL PROTECTED]> wrote: > Hi, > > has anybody used McMillan Installer, PyInstall or py2exe cross-platform? > > I have a Windows partition with Python installed there, so this would > "only" required working on a different directory and for a diff

Re: Using Python To Launch Python

2008-07-14 Thread Derek Martin
On Mon, Jul 14, 2008 at 02:01:04PM -0700, aha wrote: > Since my application has it's own version of Python installed with > it how should I use the system Python to launch the version of > Python that launches my Application. Yes, this is a convoluted > process, but not all Pythons are built the s

Using Python To Launch Python

2008-07-14 Thread aha
Hello All, I have a situation where I can count on a Python installation being available on a system, but I can't count on it being a version of Python needed by my application. Since my application has it's own version of Python installed with it how should I use the system Python to launch the

Re: Problems Returning an HTTP 200 Ok Message

2008-07-14 Thread samwyse
On Jul 11, 3:46 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > As Guy Davidson has already pointed out, this is a problem in the meter   > TCP implementation, and you should ask the vendor to fix it. That would have been me, not Guy. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems Returning an HTTP 200 Ok Message

2008-07-14 Thread samwyse
On Jul 10, 4:10 pm, Guy Davidson <[EMAIL PROTECTED]> wrote: > I try to send the following message, using the socket.send() command: > > 'HTTP/1.1 200 OK\r\nDate: Thu, 10 July 2008 14:07:50 GMT\r\nServer: > Apache/2.2.8 (Fedora)\r\nX-Powered-By: PHP/5.2.4\r\nContent-Length: 4\r > \nConnection: clos

new itertools functions in Python 2.6

2008-07-14 Thread Mensanator
With the new functions added to itertools in Python 2.6, I can finally get rid of this monstrosity: def ooloop6(a, n, perm=True, repl=True): if (not repl) and (n>len(a)): return r0 = range(n) r1 = r0[1:] if perm and repl: # ok v = ','.join(['c%s' % i for i in r

Re: while var, but var ==16 != true

2008-07-14 Thread Jeffrey Froman
Tim Roberts wrote: > Everything has a boolean value in > Python.  0, None, False, '' (empty string), [] (empty list), () (empty > tuple), and {} (empty dictionary) all have a False value.  Everything else > has a True value. Empty set objects also evaluate as false in a boolean context. Jeffrey

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread manu
On Jul 14, 8:14 pm, Miki <[EMAIL PROTECTED]> wrote: > Python is using an external library for SAX (expat IIRC). > I *guess* the Python that comes with Blender don't have this library. > I don't know... I didnt install any external libraries for sax. I think python comes with a standard sax librar

Re: Moving to functional programming

2008-07-14 Thread Terry Reedy
James Fassett wrote: ... robust and efficient than the list comprehension. I don't know the internals of how the Python interpreter treats list comprehensions and zip but it seems reasonable to assume an extra list is created for the zip approach. Minor times differences between this and t

Re: trying to use sax for a very basic first xml parser

2008-07-14 Thread Miki
Hello, > but when I copy the script into blender and run it I get: > > [code]Compiled with Python version 2.5. > Checking for installed Python... got it! > Traceback (most recent call last): >   File "Text", line 27, in >   File "H:\Python25\lib\xml\sax\__init__.py", line 93, in make_parser >    

Re: About the slot declaration decorator in PyQt4

2008-07-14 Thread Sebastian "lunar" Wiesner
Bighead <[EMAIL PROTECTED]>: > I remember when I did UI Design in PyQt4 for the first time, I found a > manual. In it, no "connect" was used. Instead, an OO approach is > applied, new UI classes inherit from old ones, and all the slot > functions are automatically connected to some signals, using

Re: subprocess module

2008-07-14 Thread Sebastian "lunar" Wiesner
Peter Otten <[EMAIL PROTECTED]>: > - communicate() waits for the subprocess to terminate. > - stdout.read() is retried if an EINTR occurs (Not sure when this would > happen). EINTR happens, if the "read" syscall is interrupted by a signal handler. For instance, if a daemon handles SIGUSR to re-r

Re: Building a Python app with Mozilla

2008-07-14 Thread Trent Mick
Brian Quinlan wrote: Most application logic in Komodo is implemented in Python, using the PyXPCOM bindings. The UI is implemented using XUL and JavaScript. The editor is Scintilla (C++). ../Komodo Edit.app/Contents/MacOS % find . -name "*.py" | xargs wc ... ... 126392 456858 4949602 total Th

Re: Unicode confusion

2008-07-14 Thread Jerry Hill
On Mon, Jul 14, 2008 at 12:40 PM, Tim Cook <[EMAIL PROTECTED]> wrote: > if I say units=unicode("°"). I get > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: > ordinal not in range(128) > > If I try x=unicode.decode(x,'utf-8'). I get > TypeError: descriptor 'decode' requires

Re: subprocess module

2008-07-14 Thread John Mechaniks
On Jul 14, 7:44 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > John Mechaniks wrote: > > On Jul 14, 12:34 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > >> John Mechaniks wrote: > >> > from subprocess import call > >> > call(['ls', '-l']) > > >> > How do I get the result (not the exit status of the com

Re: while var, but var ==16 != true

2008-07-14 Thread [EMAIL PROTECTED]
On 14 juil, 07:32, Tim Roberts <[EMAIL PROTECTED]> wrote: (snip) > Everything has a boolean value in > Python. 0, None, False, '' (empty string), [] (empty list), () (empty > tuple), and {} (empty dictionary) all have a False value. Everything else > has a True value. Unless the author of the cl

Unicode confusion

2008-07-14 Thread Tim Cook
Hi All, I'm not clear on how to use the unicode module. I need to be able to use certain characters such as the degree symbol and the mu symbol, i.e.: units = <"°"> if I say units=unicode("°")

Re: iterator clone

2008-07-14 Thread [EMAIL PROTECTED]
On 13 juil, 12:05, Yosifov Pavel <[EMAIL PROTECTED]> wrote: (snip) > def cloneiter( it ): > """return (clonable,clone)""" > return tee(it) This might as well be written as cloneiter = tee Or yet better, just remove the above code and s/cloneiter/tee/g in the remaining... -- http://mai

RE: How to package a logging.config file?

2008-07-14 Thread Younger Wang
I had the similar question and my solution is: default_config = os.path.join(os.getcwd(), "log.config") def get_logger(name, config_file=None): if config_file: logging.config.fileConfig(config_file) else: logging.basicConfig(level=logging.INFO,

Re: Moving to functional programming

2008-07-14 Thread [EMAIL PROTECTED]
On 14 juil, 11:51, James Fassett <[EMAIL PROTECTED]> wrote: > On Jul 12, 12:18 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > It relies on positional arguments, tuple unpacking and > > the signature of zip(), > > It moreso relies on the fact that: > > >>> t1 = (0,1,2,3) > >>> t2 = (7,6,5,4) > >

Re: Determining when a file has finished copying

2008-07-14 Thread Michiel Overtoom
Ethan wrote: > One more option may be to attempt to rename > the file -- if it's still open for copying, that will fail; > success indicates the copy is done. Caveat -- this is dependent on the operating system! Windows will indeed not allow you to rename or delete a file that's still open f

Re: Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-14 Thread Grant Edwards
On 2008-07-14, Hartmut Goebel <[EMAIL PROTECTED]> wrote: > has anybody used McMillan Installer, PyInstall or py2exe cross-platform? I know that py2exe doesn't work "cross-platform". I'd be very surprised if the the others do. > I have a Windows partition with Python installed there, so > this w

Re: Determining when a file has finished copying

2008-07-14 Thread Ethan Furman
Sean DiZazzo wrote: On Jul 9, 5:34 pm, keith <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control ov

Re: screencapture with PIL question

2008-07-14 Thread Casey
On Jul 14, 11:11 am, greg <[EMAIL PROTECTED]> wrote: > I am able to use the PIL module to capture a screen or specific > window.  My problem is when capturing a window (on windows XP) I can > only capture the "visible" portion of the window.  Is there any way to > capture the entire window?  specif

Using McMillan Installer, PyInstall or py2exe cross-platform?

2008-07-14 Thread Hartmut Goebel
Hi, has anybody used McMillan Installer, PyInstall or py2exe cross-platform? I have a Windows partition with Python installed there, so this would "only" required working on a different directory and for a different OS. Since I'm working on Linux, it's awful to boot Windows each time I want to

About the slot declaration decorator in PyQt4

2008-07-14 Thread Bighead
I remember when I did UI Design in PyQt4 for the first time, I found a manual. In it, no "connect" was used. Instead, an OO approach is applied, new UI classes inherit from old ones, and all the slot functions are automatically connected to some signals, using a decorator. In the __init__ function

Re: subprocess module

2008-07-14 Thread Peter Otten
John Mechaniks wrote: > On Jul 14, 12:34 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> John Mechaniks wrote: >> > from subprocess import call >> > call(['ls', '-l']) >> >> > How do I get the result (not the exit status of the command) of "ls - >> > l" into a variable? >> >> output = subprocess.Pop

Re: Python beginner, unicode encode/decode Q

2008-07-14 Thread MRAB
On Jul 14, 1:51 pm, anonymous <[EMAIL PROTECTED]> wrote: > 1 Objective to write little programs to help me learn German.  See code > after numbered comments. //Thanks in advance for any direction or > suggestions. > > tk > > 2  Want keyboard answer input, for example:   > > answer_str  = raw_input(

Re: Do we have perl's Data::Dumper equivalent in Python??

2008-07-14 Thread oj
On Jul 14, 11:41 am, srinivasan srinivas <[EMAIL PROTECTED]> wrote: > Thanks, > Srini > >       Bollywood, fun, friendship, sports and more. You name it, we have it > onhttp://in.promos.yahoo.com/groups/bestofyahoo/ You might have more luck asking for help if you explained what Perl's Data::Dumpe

Re: screencapture with PIL question

2008-07-14 Thread Matimus
On Jul 14, 8:11 am, greg <[EMAIL PROTECTED]> wrote: > Is there any way to capture the entire window?  specifically > the scrolled portion of a window that is _not_visible_on_the_screen_. I don't think there is. That is why it is called a _screen_ capture. Matt -- http://mail.python.org/mailman/

Is it possible to create "network conneciton" on windows system?

2008-07-14 Thread Evan
Hello, one of my PC is window system, and in "control panel -> Network Connections", I can see some network connections such as PPPOE or VPN which I created by click "create a new connection". My question is, is it possible to create a new connection by using Python script? which means I do not w

screencapture with PIL question

2008-07-14 Thread greg
I am able to use the PIL module to capture a screen or specific window. My problem is when capturing a window (on windows XP) I can only capture the "visible" portion of the window. Is there any way to capture the entire window? specifically the scrolled portion of a window that is not visible o

Re: Converting from local -> UTC

2008-07-14 Thread Keith Hughitt
On Jul 12, 12:52 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 11 Jul 2008 15:42:37 -0300, Keith Hughitt   > <[EMAIL PROTECTED]> escribi�: > > > I am having a little trouble figuring out how to convert a python > > datetime to UTC. I have a UTC date (e.g. 2008-07-11 00:00:00). I woul

new python podcast

2008-07-14 Thread [EMAIL PROTECTED]
http://www.podango.com/tag/python I just started to play with this and I wanted to know if there is any interest in this sort of thing now that the last (maybe I should say most proliffic) python podcaster has stopped being active.. I would also be intrested in knowing if there is a particular bi

Re: Beginner Question : Iterators and zip

2008-07-14 Thread moogyd
On 13 Jul, 19:49, Terry Reedy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > What is this *lis operation called? I am having trouble finding any > > reference to it in the python docs or the book learning python. > > One might call this argument unpacking, but > Language Manual / Express

Re: Dictionary bidirectional

2008-07-14 Thread Gerry
If keys and values are unique, maybe just store both in the same dictionary: mydict[a] = b mydict[b] = a ... Gerry On Jul 14, 8:31 am, Impotent Verse <[EMAIL PROTECTED]> wrote: > If keys and values are unique you could do this... > > -- > > #         Left      : Right >

Re: Dictionary bidirectional

2008-07-14 Thread Akathorn Greyhat
This is a better version of the class that I sen't you, now it raises a KeyError when you try to insert a value that is already in class MyCoolDictionary(dict): def __init__(self, *args, **kargs): dict.__init__(self, *args, **kargs) def __setitem__(sel

Re: logging via SocketHandler and TCPserver

2008-07-14 Thread Vinay Sajip
On Jul 13, 9:25 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Every time I look at theloggingmodule (up until now) I've given up and > continue to use my home-grown logger that I've been using for years. I'm not > giving up this time ;-) > > I find that I REALLY need to be able to monitor LOTS of

trying to use sax for a very basic first xml parser

2008-07-14 Thread manu
Hi, I need to parse xml files for the Blender Game Engine. ATM I am trying to get this script running in the BGE. This is my first script and I dont have much experience programming... import xml.sax class PnmlHandler(xml.sax.ContentHandler): def __init__(self): self.inPlace=0 d

Turbogear installing error.

2008-07-14 Thread CL (Ciu Loeng) Lam
HI,there: I get the errors below when installing the Turebogear,could anyone help me ? Thanks in advance. error: Not a recognized archive type: c:\docume~1\admini~1\locals~1\ temp\easy_in stall-y2znne\PasteScript-1.6.3.tar.gz -- http://mail.python.org/mailman/listinfo/python-list

Re: How to package a logging.config file?

2008-07-14 Thread Vinay Sajip
On Jul 14, 1:21 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I'm working on a package that uses the standard libraryloggingmodule > along with a .cfg file. > > In my code, I uselogging.config.fileConfig('/home/matt/mypackage/matt.cfg') > to load in > theloggingconfig file. > > However, it seems

Re: a module.pth question

2008-07-14 Thread Mike Driscoll
On Jul 14, 6:26 am, oyster <[EMAIL PROTECTED]> wrote: > My py24 is installed in h:\python24 > I installed pyglet(http://pyglet.org/) in > H:\pure_pylib\Multimedia\pyglet-1.0\, if I do > [code]>>> import sys > >>> sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') > >>> import pyglet > > [/code

BootCampArama Final Reminder

2008-07-14 Thread Chris Calloway
Final reminder, we're in the last two weeks of open registration for PyCamp, Plone Boot Camp, and Advanced Plone Boot Camp: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp: Customizing Plone, July 28 - August 1 Advanced

Python beginner, unicode encode/decode Q

2008-07-14 Thread anonymous
1 Objective to write little programs to help me learn German. See code after numbered comments. //Thanks in advance for any direction or suggestions. tk 2 Want keyboard answer input, for example: answer_str = raw_input(' Enter answer > ') Herr Üü [ I keyboard in the following characters

Re: Dictionary bidirectional

2008-07-14 Thread Impotent Verse
If keys and values are unique you could do this... -- # Left : Right roman = { "One" : "I", "Two" : "II", "Three" : "III", "Four": "IV", "Five": "V", "Six" : "VI", "Seven" : "VII",

Re: Dictionary bidirectional

2008-07-14 Thread Kless
Akathorn Greyhat sent me by email the next solution, which althought isn't generic it works well: - You could make your own class for that, maybe something like # class MyCoolDictionary(dict): def __init__(self, *args, **kargs): dict.__init__(self, *args, **kargs

Re: Dictionary bidirectional

2008-07-14 Thread bearophileHUGS
Larry Bates: > The only case where it would be faster would be if most of the keys were NOT > in > the dictionary (rather odd use case). Otherwise I believe you will find the > first way quicker as the exceptions are infrequent. I have written a small benchmark: from random import shuffle def

a module.pth question

2008-07-14 Thread oyster
My py24 is installed in h:\python24 I installed pyglet(http://pyglet.org/) in H:\pure_pylib\Multimedia\pyglet-1.0\, if I do [code] >>> import sys >>> sys.path.append(r'H:\pure_pylib\Multimedia\pyglet-1.0') >>> import pyglet [/code] it is ok. but if I created h:\pure_pylib\pyglet.pth file, which co

Re: About wmi

2008-07-14 Thread Tim Golden
Larry Bates wrote: patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate "scrcons.exe" and "FNPLicensingService.exe",which are system processes. Problem2:After a while, this program

Re: importing from .pyd

2008-07-14 Thread Kay Schluehr
On 14 Jul., 06:03, moijes12 <[EMAIL PROTECTED]> wrote: > hi > > there is a .pyd file present in the same folder as the script abc.py > by the name foo.pyd .I don't have foo.py .In the script abc.py I try > > import foo > > Error i get is > ImportError: DLL load failed: The specified module could no

Re: Need help in writing up a Python Syntax checker

2008-07-14 Thread Kay Schluehr
On 14 Jul., 08:22, Kinokunya <[EMAIL PROTECTED]> wrote: > Hi guys, > > My group and I will be working on our final year project, the scope to > do a program/web-based application similar areas of functionalities > like the PyLint and PyChecker; a Python syntax checker. We have no > Python backgroun

Do we have perl's Data::Dumper equivalent in Python??

2008-07-14 Thread srinivasan srinivas
Thanks, Srini Bollywood, fun, friendship, sports and more. You name it, we have it on http://in.promos.yahoo.com/groups/bestofyahoo/ -- http://mail.python.org/mailman/listinfo/python-list

RPC Client acts like a server

2008-07-14 Thread Utku Altinkaya
Hello, I need a client that connects to the server and answers remote calls. Is there a way to dot that using sandart xmlrpclib ? Currently I am using Remote Python Call library, but looking for alternative solutions as well. regards -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Image Cropper

2008-07-14 Thread Victor Noagbodji
>Hi, > >I am designing a simple image cropper which simply takes an image and use PIL > to do the cropping.Now in order to do the cropping I simply draw a rectangle > on > the image by dragging the mouse over the image.I then use button press and > button release events to find the mouse postition

Re: subprocess module

2008-07-14 Thread John Mechaniks
On Jul 14, 12:34 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > John Mechaniks wrote: > > from subprocess import call > > call(['ls', '-l']) > > > How do I get the result (not the exit status of the command) of "ls - > > l" into a variable? > > output = subprocess.Popen(["ls", "-l"], stdout=subproces

Re: Moving to functional programming

2008-07-14 Thread James Fassett
On Jul 12, 12:18 am, George Sakkis <[EMAIL PROTECTED]> wrote: > It relies on positional arguments, tuple unpacking and > the signature of zip(), It moreso relies on the fact that: >>> t1 = (0,1,2,3) >>> t2 = (7,6,5,4) >>> [t1, t2] == zip(*zip(t1, t2)) True This is mathematically true given the d

Re: subprocess module

2008-07-14 Thread sukkopera
On 14 Lug, 10:34, Peter Otten <[EMAIL PROTECTED]> wrote: > John Mechaniks wrote: > > from subprocess import call > > call(['ls', '-l']) > > > How do I get the result (not the exit status of the command) of "ls - > > l" into a variable? > > output = subprocess.Popen(["ls", "-l"], stdout=subprocess.P

Re: Does omniORBpy 3.2 supports DII?

2008-07-14 Thread Duncan Grisby
In article <[EMAIL PROTECTED]>, Ilan <[EMAIL PROTECTED]> wrote: >My apologies if this is not the correct forum for thses quiestions, by >I'm rather new to python+CORBA > >Has anyone used omniORBpy as CORBA implementation? are there any >drawbacks? As omniORBpy's author, I'm biased, so I'll let o

  1   2   >