Re: Python-Qt problem with pyuic4

2009-09-23 Thread ici
On Sep 24, 4:45 am, Xavier Lapointe wrote: > Hello, > > Let's suppose you're on Windows. > > If pyuic4 can't be found, you can specified the direct path: > C:\Python26\pyuic4.bat -o Drive:\your\Path\ui_myGUI.py -x > Drive:\your\Path\myGUI.ui > You might need to replace the Python26 with your own v

Re: Getting return code for a Python script invoked from a Linux shell script

2009-09-23 Thread volcano
On Sep 23, 8:01 pm, Donn wrote: > On Wednesday 23 September 2009 18:51:29 volcano wrote:> exit_code = !$ > > I think it's $? to get the code. > \d > -- > home:http://otherwise.relics.co.za/ > 2D vector animation :https://savannah.nongnu.org/projects/things/ > Font manager :https://savannah.nongnu.

Python-Qt problem with pyuic4

2009-09-23 Thread Threader Slash
Hi Xavier Yes. You are right, I am in WinXP - developing a client-server database for a customer. I am pretty sure that this type of problem won't be happening on Linux. Anyway, I did both way about the path. It didn't work and keep giving that same error message. Maybe it seems to be a bug .. s

Re: Single line output, updating output in place

2009-09-23 Thread Donavan Lance
Sweet, thanks for the information. Lots to learn. On Thu, Sep 24, 2009 at 12:23 AM, wrote: > On 04:11 am, tusklah...@gmail.com wrote: > >> Hello, I'm a newb and have been playing with Python trying to print a >> changing value to the screen that updates as the value changes. I have >> this >> co

Re: Single line output, updating output in place

2009-09-23 Thread exarkun
On 04:11 am, tusklah...@gmail.com wrote: Hello, I'm a newb and have been playing with Python trying to print a changing value to the screen that updates as the value changes. I have this code, which is pretty much doing what I want: #!/usr/bin/env python3 import time text = input('Please ent

Re: Single line output, updating output in place

2009-09-23 Thread Chris Rebert
On Wed, Sep 23, 2009 at 9:11 PM, Donavan Lance wrote: > Hello, I'm a newb and have been playing with Python trying to print a > changing value to the screen that updates as the value changes. I have this > code, which is pretty much doing what I want: > > #!/usr/bin/env python3 > > import time > >

Single line output, updating output in place

2009-09-23 Thread Donavan Lance
Hello, I'm a newb and have been playing with Python trying to print a changing value to the screen that updates as the value changes. I have this code, which is pretty much doing what I want: #!/usr/bin/env python3 import time text = input('Please enter something: ') for c in text: print('T

Re: arrays in python

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 10:03 PM, AggieDan04 wrote: > On Sep 23, 3:02 pm, Simon Forman wrote: >> On Wed, Sep 23, 2009 at 1:14 PM, Rudolf wrote: >> > Can someone tell me how to allocate single and multidimensional arrays >> > in python. I looked online and it says to do the following x = >> > ['1

logging.handlers.SMTPHandler question

2009-09-23 Thread akonsu
hello, SMTPHAndler seems to email every single record separately. is there a way to collect all log output and then send it in a single email message? or do i have to do it manually? thanks konstantin -- http://mail.python.org/mailman/listinfo/python-list

Re: how to truncate to get the 1st 5 chars from a string

2009-09-23 Thread Grant Edwards
On 2009-09-24, MacRules wrote: > s="1234abcd" > s.range(0..4) > 1234a > > Is there a string function like this? http://www.google.com/search?q=python+tutorial -- Grant -- http://mail.python.org/mailman/listinfo/python-list

Re: how to truncate to get the 1st 5 chars from a string

2009-09-23 Thread Donn
On Thursday 24 September 2009 05:05:45 MacRules wrote: > s="1234abcd" print s[0:4] should do it. Not sure it's a function though. \d -- home: http://otherwise.relics.co.za/ 2D vector animation : https://savannah.nongnu.org/projects/things/ Font manager : https://savannah.nongnu.org/projects/fon

Re: how to truncate to get the 1st 5 chars from a string

2009-09-23 Thread Xavier Ho
On Thu, Sep 24, 2009 at 1:05 PM, MacRules wrote: > s="1234abcd" > s.range(0..4) > 1234a > > Is there a string function like this? > > Use the slice. >>> s = "1234abcd" >>> s[:5] '1234a' Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

how to truncate to get the 1st 5 chars from a string

2009-09-23 Thread MacRules
s="1234abcd" s.range(0..4) 1234a Is there a string function like this? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Good libraries for network programming (not asynchronous)

2009-09-23 Thread Tvrtko
On Sep 24, 4:36 am, Jeff McNeil wrote: > I know this probably isn't overly helpful, but Twisted allows you to > defer a blocking call to a thread using a 'deferToThread' construct. > It exists so that you can run otherwise synchronous calls in an async. > manner. I'm already using this, but the l

Re: Intercepting binding?

2009-09-23 Thread andrew cooke
for the record, googling for "f_back.f_locals" reveals a wide variety of similar hacks and also a cleaner way to access the current frame: inspect.currentframe() -- http://mail.python.org/mailman/listinfo/python-list

Re: Intercepting binding?

2009-09-23 Thread andrew cooke
On Sep 23, 10:11 pm, Dave Angel wrote: > This comes up periodically in this list, and the answer is always > something like:  you can't get there from here. Well, I'm both flexible and desperate, so this is a possible route (perhaps near enough): import sys class Foo(object): def __rlshif

Re: Good libraries for network programming (not asynchronous)

2009-09-23 Thread Jeff McNeil
On Sep 23, 8:29 pm, Tvrtko wrote: > Hello, > > Is there any good alternative to twisted for network programming which > doesn't involve asynchronous programming? I don't really like the > asynchronous model because it is hard to incorporate all other > blocking libraries that I have to use. And th

Re: Intercepting binding?

2009-09-23 Thread Dave Angel
andrew cooke wrote: This is a bit vague, I'm afraid, but is there any way for me to take code like: a = Foo() beta = Bar() and somehow attach the string "a" to the Foo instance and "beta" to the Bar instance. At some later point in the program I want to be able to look at the Bar instanc

Re: arrays in python

2009-09-23 Thread AggieDan04
On Sep 23, 3:02 pm, Simon Forman wrote: > On Wed, Sep 23, 2009 at 1:14 PM, Rudolf wrote: > > Can someone tell me how to allocate single and multidimensional arrays > > in python. I looked online and it says to do the following x = > > ['1','2','3','4'] > > > However, I want a much larger array li

Re: where is ctrl+newline handled in pywin editor?

2009-09-23 Thread Mark Hammond
On 24/09/2009 10:25 AM, C or L Smith wrote: {Sorry about the no-wrap in the first post...} I use the pywin environment on Windows for python code editing and interactive environment. I've been able to find the place in the editor files where the enter key is handled and where the whitespa

Python-Qt problem with pyuic4

2009-09-23 Thread Xavier Lapointe
Hello, Let's suppose you're on Windows. If pyuic4 can't be found, you can specified the direct path: C:\Python26\pyuic4.bat -o Drive:\your\Path\ui_myGUI.py -x Drive:\your\Path\myGUI.ui You might need to replace the Python26 with your own version if it differs... Cheers -- http://mail.pytho

Re: delete items from list by indices

2009-09-23 Thread Daniel Stutzbach
On Wed, Sep 23, 2009 at 3:48 AM, Peter Otten <__pete...@web.de> wrote: > Why's that obsession with speed? > Well, most of the solutions posted so far are O(n**2), which may be noticeably slow if the list is of considerable length. I wonder if the original poster ran in to that problem. >>> item

Re: Intercepting binding?

2009-09-23 Thread andrew cooke
On Sep 23, 8:40 pm, "Rhodri James" wrote: > eggs[42] = Foo() > beans['spam'] = Foo() > chips.spam = Foo() > spam[eggs.beans['chips']] = Foo() > spam.append(Foo()) these are valid points, but in practice the main use (for the restricted application i care about) is si,ple variables, and this is an

Re: Dynamic Form

2009-09-23 Thread BJ Swope
What is your code not doing? Are you winding up with duplicate data in the DB? Is your web browser re-submitting the form with the same data if you refresh the screen? Is your web browser pre-filling the fields of the form due to caching? I don't understand what's not working On Wed, Sep 23, 2

Re: Intercepting binding?

2009-09-23 Thread Xavier Ho
Here's a **very** hackish code I threw up together. It requires a lot of manual checking and, I don't think it's practical at all. ###input: default = set(locals()) class test(): def __init__(self): self.name = str(self) self.val = 'Mrra' a = test() user = set(locals()) - de

Re: Python-Qt problem with pyuic4

2009-09-23 Thread Threader Slash
Hello Xavier.. thanks! [?] Just tried.. pyuic4 -o C:\dev\prgr\src\ui_myGUI.py -x C:\dev\prgr\src\myGUI.ui The system cannot find the path specified. pyuic4 -o ui_myGUI.py -x myGUI.ui The system cannot find the path specified. Very strange. [?] Yep.. the ..!\Py25\Lib\site-packages\PyQt4 is incl

Re: Searching a large dictionary

2009-09-23 Thread Rhodri James
On Thu, 24 Sep 2009 01:03:26 +0100, Sean DiZazzo wrote: I like to perform what I call "objectify" on nested dictionary type stuff into classes. class TestPart(object): def __init__(self, **kwargs): for k,v in kwargs.items(): setattr(self, k, v) [snip]

Re: Intercepting binding?

2009-09-23 Thread Rhodri James
On Thu, 24 Sep 2009 01:34:35 +0100, andrew cooke wrote: For example, I assume it's possible to somehow access the dictionary for the current block, but I can't see how to do this after assignment. If I do it in the Foo constructor, for example, "a" will not yet be bound. I apologise for fai

Python-Qt problem with pyuic4

2009-09-23 Thread Xavier Lapointe
Have you tried something like so? pyuic4 -o C:\dev\prgr\src\ui_myGUI.py -x C:\dev\prgr\src\myGUI.ui (Sorry if double post occured - just changed my Mailing list account ..) -- http://mail.python.org/mailman/listinfo/python-list

Python-Qt problem with pyuic4

2009-09-23 Thread Xavier Lapointe
Have you tried something like so? pyuic4 -o App.py -x App.ui -- http://mail.python.org/mailman/listinfo/python-list

Re: Intercepting binding?

2009-09-23 Thread Rhodri James
On Thu, 24 Sep 2009 01:15:14 +0100, andrew cooke wrote: This is a bit vague, I'm afraid, but is there any way for me to take code like: a = Foo() beta = Bar() and somehow attach the string "a" to the Foo instance and "beta" to the Bar instance. At some later point in the program I wan

Re: Intercepting binding?

2009-09-23 Thread andrew cooke
For example, I assume it's possible to somehow access the dictionary for the current block, but I can't see how to do this after assignment. If I do it in the Foo constructor, for example, "a" will not yet be bound. On Sep 23, 8:15 pm, andrew cooke wrote: > This is a bit vague, I'm afraid, but

Good libraries for network programming (not asynchronous)

2009-09-23 Thread Tvrtko
Hello, Is there any good alternative to twisted for network programming which doesn't involve asynchronous programming? I don't really like the asynchronous model because it is hard to incorporate all other blocking libraries that I have to use. And the code doesn't look nice. I recently found the

Re: Searching a large dictionary

2009-09-23 Thread Martien Verbruggen
On Wed, 23 Sep 2009 14:52:56 -0700 (PDT), mike171562 wrote: > Sorry for the confusion, Simon, this is almost exactly what I need, > but i need to be able to search for a string in a given value of an > item > > Here is an example of the dict I am working with > > {'252': [{'code': '51679',

Re: where is ctrl+newline handled in pywin editor?

2009-09-23 Thread C or L Smith
{Sorry about the no-wrap in the first post...} I use the pywin environment on Windows for python code editing and interactive environment. I've been able to find the place in the editor files where the enter key is handled and where the whitespace is stripped from a line and I've been able

Intercepting binding?

2009-09-23 Thread andrew cooke
This is a bit vague, I'm afraid, but is there any way for me to take code like: a = Foo() beta = Bar() and somehow attach the string "a" to the Foo instance and "beta" to the Bar instance. At some later point in the program I want to be able to look at the Bar instance and say to the user

Re: Open file on remote linux server

2009-09-23 Thread Neil Hodgson
The Bear: > Hi I'm looking to do something like this > > f = f.openfileobj(remotefileloc, localfilelikeobj) > > my remote files are on a solaris box that i can access using ssh (could > prehap request othe protocols if necessary) You could look into GIO which is a virtual file system API used

Re: Searching a large dictionary

2009-09-23 Thread Sean DiZazzo
On Sep 23, 4:05 pm, "Rhodri James" wrote: > On Wed, 23 Sep 2009 22:52:56 +0100, mike171562   > > wrote: > > Sorry for the confusion, Simon, this is almost exactly what I need, > > but i need to be able to search for a string in a given value of an > > item > > > Here is an example of the dict I a

Re: Pipelining tar create and tar extract the "Python" way...

2009-09-23 Thread Ray Van Dolson
On Wed, Sep 23, 2009 at 03:52:11PM -0700, Ray Van Dolson wrote: > Hi all; > > In the land'o'shell, I can do something like the following: > > tar cvf - SrcDir | (cd /dest ; tar xvf -) > Bad form replying to my own post... while I'd still like to know if this is possible to do with the tarfile

Pipelining tar create and tar extract the "Python" way...

2009-09-23 Thread Ray Van Dolson
Hi all; In the land'o'shell, I can do something like the following: tar cvf - SrcDir | (cd /dest ; tar xvf -) I'd like to learn the "Python" way to reproduce the above. Obviously I could use the subprocess module and just call that exact command above, but is there a way to do this with the t

Re: Searching a large dictionary

2009-09-23 Thread Rhodri James
On Wed, 23 Sep 2009 22:52:56 +0100, mike171562 wrote: Sorry for the confusion, Simon, this is almost exactly what I need, but i need to be able to search for a string in a given value of an item Here is an example of the dict I am working with {'252': [{'code': '51679', 'date': '2009-08-01

Re: Querying for ownership of file shared by Samba fails with "MemoryError: allocating SECURITY_DESCRIPTOR"

2009-09-23 Thread Roger Upole
"Middle Fork GIS" wrote in message news:943c8e0b0909231216t1c590b14u453855718352...@mail.gmail.com... >I have just learned how to use the win32security module (within Windows, of > course) to determine file ownership. When running against local drives or > windows shares, this works fine, as sho

Re: Most "active" coroutine library project?

2009-09-23 Thread exarkun
On 10:18 pm, t...@urandom.ca wrote: On Wed, 2009-09-23 at 22:07 +, exar...@twistedmatrix.com wrote: Sure, no value judgement intended, except on the practice of taking words with well established meanings and re-using them for something else ;) I think it's the behaviour that's important,

Python-Qt problem with pyuic4

2009-09-23 Thread Threader Slash
Hello Everybody I have used Qt Designer to generate a basic GUI. The file saved from Qt Designer I named it myGUI.ui . Now, I have to generate from myGUI.ui the ui_myGUI.py. To get this done, we must run pyuic4, directly or via mkpuqt.py or Make PyQt. I tried to get it done, so went into the

Re: Most "active" coroutine library project?

2009-09-23 Thread Rhodri James
On Wed, 23 Sep 2009 23:18:26 +0100, Jason Tackaberry wrote: On Wed, 2009-09-23 at 22:07 +, exar...@twistedmatrix.com wrote: Sure, no value judgement intended, except on the practice of taking words with well established meanings and re-using them for something else ;) I think it's the

Re: Most "active" coroutine library project?

2009-09-23 Thread Jason Tackaberry
On Wed, 2009-09-23 at 22:07 +, exar...@twistedmatrix.com wrote: > Sure, no value judgement intended, except on the practice of taking > words with well established meanings and re-using them for something > else ;) I think it's the behaviour that's important, and not the specific syntax need

Re: Most "active" coroutine library project?

2009-09-23 Thread exarkun
On 10:00 pm, t...@urandom.ca wrote: On Wed, 2009-09-23 at 21:53 +, exar...@twistedmatrix.com wrote: I specifically left out all "yield" statements in my version, since that's exactly the point here. :) With "real" coroutines, they're not necessary - coroutine calls look just like any other

Re: Most "active" coroutine library project?

2009-09-23 Thread Jason Tackaberry
On Wed, 2009-09-23 at 21:53 +, exar...@twistedmatrix.com wrote: > I specifically left out all "yield" statements in my version, since > that's exactly the point here. :) With "real" coroutines, they're not > necessary - coroutine calls look just like any other call. With > Python's enhance

Re: Searching a large dictionary

2009-09-23 Thread mike171562
Sorry for the confusion, Simon, this is almost exactly what I need, but i need to be able to search for a string in a given value of an item Here is an example of the dict I am working with {'252': [{'code': '51679', 'date': '2009-08-01 11:35:38', 'userfield': '252', 'from': '9876662881', 'to': '

Re: Most "active" coroutine library project?

2009-09-23 Thread exarkun
On 09:40 pm, t...@urandom.ca wrote: On Wed, 2009-09-23 at 20:50 +, exar...@twistedmatrix.com wrote: immediately outside the generator. This means that you cannot use "enhanced generators" to implement an API like this one: def doSomeNetworkStuff(): s = corolib.socket()

Re: Open file on remote linux server

2009-09-23 Thread Diez B. Roggisch
The Bear schrieb: Hi I'm looking to do something like this f = f.openfileobj(remotefileloc, localfilelikeobj) my remote files are on a solaris box that i can access using ssh (could prehap request othe protocols if necessary) anyone got any ideas? try paramiko. Or just use subprocess to scp

Re: Searching Dictionary

2009-09-23 Thread MRAB
Support Desk wrote: Sorry for the confusion, Simon, this is almost exactly what I need, but i need to be able to search for a string in a given value of an item Here is an example of the dict I am working with {'252': [{'code': '51679', 'date': '2009-08-01 11:35:38', 'userfield': '252', 'fr

Re: Most "active" coroutine library project?

2009-09-23 Thread Jason Tackaberry
On Wed, 2009-09-23 at 20:50 +, exar...@twistedmatrix.com wrote: > immediately outside the generator. This means that you cannot use > "enhanced generators" to implement an API like this one: > > def doSomeNetworkStuff(): > s = corolib.socket() > s.connect(('google.com', 8

RE: Random module missing?

2009-09-23 Thread Brown, Rodrick
Thanks Jerry that was the problem. -Original Message- From: python-list-bounces+rodrick.brown=citi@python.org [mailto:python-list-bounces+rodrick.brown=citi@python.org] On Behalf Of Jerry Hill Sent: Wednesday, September 23, 2009 5:11 PM To: python-list@python.org Subject: Re: Ran

Re: Searching Dictionary

2009-09-23 Thread Support Desk
Sorry for the confusion, Simon, this is almost exactly what I need, but i need to be able to search for a string in a given value of an item Here is an example of the dict I am working with {'252': [{'code': '51679', 'date': '2009-08-01 11:35:38', 'userfield': '252', 'from': '9876662881', 'to': '1

Re: pycopg2 build problems

2009-09-23 Thread philip
Quoting Wolodja Wentland : On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote: I'm trying to install psycopg2 on my system. I followed the instruction in INSTALL file and gave the command python setup.py build running build running build_py running build_ext error: No such file or directory I

Re: Random module missing?

2009-09-23 Thread Robert Kern
On 2009-09-23 16:00 PM, Brown, Rodrick wrote: I seen some documentation about random.random() but my version seems to be broken? Python 2.3.4 (#1, Jul 16 2009, 07:03:37) [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. imp

Re: Random module missing?

2009-09-23 Thread Jerry Hill
On Wed, Sep 23, 2009 at 5:00 PM, Brown, Rodrick wrote: > I seen some documentation about random.random() but my version seems to be > broken? > > Python 2.3.4 (#1, Jul 16 2009, 07:03:37) > [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2 > Type "help", "copyright", "credits" or "license" for mor

Random module missing?

2009-09-23 Thread Brown, Rodrick
I seen some documentation about random.random() but my version seems to be broken? Python 2.3.4 (#1, Jul 16 2009, 07:03:37) [GCC 3.4.6 20060404 (Red Hat 3.4.6-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import random >>> dir(random) ['__builtins__', '

Re: Most "active" coroutine library project?

2009-09-23 Thread Grant Edwards
On 2009-09-23, exar...@twistedmatrix.com wrote: > On 08:16 pm, sajmik...@gmail.com wrote: >>On Wed, Sep 23, 2009 at 2:05 PM, wrote: >>[snip] >>> >>>But what some Python programmers call coroutines aren't really the >>>same as >>>what the programming community at large would call a coroutine. >>

Re: Most "active" coroutine library project?

2009-09-23 Thread exarkun
On 08:16 pm, sajmik...@gmail.com wrote: On Wed, Sep 23, 2009 at 2:05 PM, wrote: [snip] But what some Python programmers call coroutines aren't really the same as what the programming community at large would call a coroutine. Jean-Paul Really? I'm curious as to the differences. (I just

Re: pycopg2 build problems

2009-09-23 Thread Wolodja Wentland
On Wed, Sep 23, 2009 at 22:38 +0200, Wolodja Wentland wrote: > --- Debian example --- > $ apt-file search /usr/bin/pg_config > libpq-dev: /usr/bin/pg_config > --- snip --- Just wanted to note that libpq-dev is a dependency of postgresql-server-dev-8.4 on squeeze. So you *might* want to consider in

Re: Most "active" coroutine library project?

2009-09-23 Thread Grant Edwards
On 2009-09-23, Simon Forman wrote: >>> Coroutines are built into the language. ?There's a good talk >>> about them here: http://www.dabeaz.com/coroutines/ >> >> But what some Python programmers call coroutines aren't really >> the same as what the programming community at large would call >> a co

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-23 Thread Martin P. Hellwig
Tony Schmidt wrote: So do you think it would be very beneficial for me to start with an Inman or Kimball book? Or do you think it would be just leisure reading and not very practical at best - fill my head with needless jargon and inflexible dogmas, at worst? You have an unique opportunity he

Re: pycopg2 build problems

2009-09-23 Thread Wolodja Wentland
On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote: > I'm trying to install psycopg2 on my system. I followed the > instruction in INSTALL file and gave the command > python setup.py build > running build > running build_py > running build_ext > error: No such file or directory I ran into this some

Re: Searching Dictionary

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 2:31 PM, Support Desk wrote: > > i am trying to search a large Python dictionary for a matching value. The > results would need to be structured into a new dictionary with the same > structure. Thanks. > > The structure is like this > > { Key : [{'item':value,'item2':value,

Re: recommendation for webapp testing?

2009-09-23 Thread lkcl
On Sep 17, 8:19 am, Simon Brunning wrote: > 2009/9/17 Schif Schaf : > > > What's the difference between WebDriver and Selenium? > > Selenium runs in a browser, and usesJavaScriptto perform all your > automated actions. It need a browser running to work. Several are > supported, Firefox, Safari, IE

Re: Solved - Python: automate input to MySQL query

2009-09-23 Thread D'Arcy J.M. Cain
On Wed, 23 Sep 2009 11:37:07 -0700 Dennis Lee Bieber wrote: > On Wed, 23 Sep 2009 10:49:51 -0400, "D'Arcy J.M. Cain" > declaimed the following in gmane.comp.python.general: > > from pg import DB # PyGreSQL > > db = DB() # uses my default PostgeSQL database > > res = db.query(""" > > SELECT *

Re: arrays in python

2009-09-23 Thread Donn
On Wednesday 23 September 2009 22:12:24 Ethan Furman wrote: > Works great if you want 4,999,999 elements. ;-) Omit the '1' if you > want all five million. Yes. Fenceposts always get me :) And I was just reminded that one can: l=range(500) \d -- home: http://otherwise.relics.co.za/ 2D vector

Re: Searching Dictionary

2009-09-23 Thread Dave Angel
Support Desk wrote: i am trying to search a large Python dictionary for a matching value. The results would need to be structured into a new dictionary with the same structure. Thanks. The structure is like this { Key : [{'item':value,'item2':value,' item3':value,'item4':value,'item5':value','i

Re: Most "active" coroutine library project?

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 2:05 PM, wrote: > On 05:00 pm, sajmik...@gmail.com wrote: >> >> On Sun, Aug 23, 2009 at 11:02 AM, Phillip B Oldham >> wrote: >>> >>> I've been taking a look at the multitude of coroutine libraries >>> available for Python, but from the looks of the projects they all seem

Re: arrays in python

2009-09-23 Thread Ethan Furman
Donn wrote: On Wednesday 23 September 2009 19:14:20 Rudolf wrote: I want to allocate an array and then populate it using a for loop. You don't need to allocate anything, just use the list or dictionary types. l=[] #empty list for x in range(1,500): l.append(x) \d Works great if you

Re: arrays in python

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 1:22 PM, Donn wrote: > On Wednesday 23 September 2009 19:14:20 Rudolf wrote: >> I want to allocate an array and then populate it >> using a for loop. > You don't need to allocate anything, just use the list or dictionary types. > > l=[] #empty list > for x in range(1,50

Re: arrays in python

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 1:14 PM, Rudolf wrote: > Can someone tell me how to allocate single and multidimensional arrays > in python. I looked online and it says to do the following x = > ['1','2','3','4'] > > However, I want a much larger array like a 100 elements, so I cant > possibly do that. I

Re: Searching a large dictionary

2009-09-23 Thread mike171562
i am trying to search a large Python dictionary for a matching value. The results would need to be structured into a new dictionary with the same structure. Thanks. The structure is like this { Key : [{'item':value,'item2':value,' item3':value,'item4':value,'item5':value','item6':value,'item7':va

Re: Open file on remote linux server

2009-09-23 Thread Sean DiZazzo
On Sep 23, 12:04 pm, The Bear wrote: > Hi I'm looking to do something like this > > f = f.openfileobj(remotefileloc, localfilelikeobj) > > my remote files are on a solaris box that i can access using ssh (could > prehap request othe protocols if necessary) > > anyone got any ideas? > > many thanks

Re: pycopg2 build problems

2009-09-23 Thread Philip Semanchuk
On Sep 23, 2009, at 3:24 PM, devaru wrote: Hi, I'm trying to install psycopg2 on my system. I followed the instruction in INSTALL file and gave the command python setup.py build running build running build_py running build_ext error: No such file or directory Where is the file or directory mi

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-23 Thread Martin P. Hellwig
snfctech wrote: @Martin: I originally thought that there was nothing "magical" about building a data warehouse, but then I did a little research and received all sorts of feedback about how data warehouse projects have notorious failure rates, that data warehouse design IS different than normal

Re: Idiom for "last word in a string"

2009-09-23 Thread Peter Otten
akonsu wrote: > On Sep 23, 2:47 pm, Grant Edwards wrote: >> I recently ran across this construct for grabbing the last >> (whitespace delimited) word in a string: >> >> s.rsplit(None,1)[1] >> >> It was somewhat obvious from the context what it was supposed >> to do, but it took a bit of Googling

pycopg2 build problems

2009-09-23 Thread devaru
Hi, I'm trying to install psycopg2 on my system. I followed the instruction in INSTALL file and gave the command python setup.py build running build running build_py running build_ext error: No such file or directory Where is the file or directory missing. Any help is appreciated. -- http://mail

Re: pygui - showing an image

2009-09-23 Thread kyle schalm
yes, that did the trick. i was not aware of all the examples in Test, only the three Demo projects. thanks! 2009/9/22 David Robinow : > There's an example in Tests/21-image.py > See if that helps. > -- http://mail.python.org/mailman/listinfo/python-list

Re: Idiom for "last word in a string"

2009-09-23 Thread Christos Trochalakis
At Wed, 23 Sep 2009 18:47:05 + (UTC), Grant Edwards wrote: > > I recently ran across this construct for grabbing the last > (whitespace delimited) word in a string: > >s.rsplit(None,1)[1] > > It was somewhat obvious from the context what it was supposed > to do, but it took a bit of Googlin

Re: Idiom for "last word in a string"

2009-09-23 Thread Christos Trochalakis
At Wed, 23 Sep 2009 18:47:05 + (UTC), Grant Edwards wrote: > > I recently ran across this construct for grabbing the last > (whitespace delimited) word in a string: > >s.rsplit(None,1)[1] > > It was somewhat obvious from the context what it was supposed > to do, but it took a bit of Goog

Re: Idiom for "last word in a string"

2009-09-23 Thread Christos Trochalakis
At Wed, 23 Sep 2009 18:47:05 + (UTC), Grant Edwards wrote: > > I recently ran across this construct for grabbing the last > (whitespace delimited) word in a string: > >s.rsplit(None,1)[1] > > It was somewhat obvious from the context what it was supposed > to do, but it took a bit of Goog

Re: Idiom for "last word in a string"

2009-09-23 Thread Christos Trochalakis
At Wed, 23 Sep 2009 18:47:05 + (UTC), Grant Edwards wrote: > > I recently ran across this construct for grabbing the last > (whitespace delimited) word in a string: > >s.rsplit(None,1)[1] > > It was somewhat obvious from the context what it was supposed > to do, but it took a bit of Goog

Querying for ownership of file shared by Samba fails with "MemoryError: allocating SECURITY_DESCRIPTOR"

2009-09-23 Thread Middle Fork GIS
I have just learned how to use the win32security module (within Windows, of course) to determine file ownership. When running against local drives or windows shares, this works fine, as shown in the following code (Python 2.4/2.5 with PyWin extensions): import win32security file = 'c:/temp/test.t

Open file on remote linux server

2009-09-23 Thread The Bear
Hi I'm looking to do something like this f = f.openfileobj(remotefileloc, localfilelikeobj) my remote files are on a solaris box that i can access using ssh (could prehap request othe protocols if necessary) anyone got any ideas? many thanks Charlie (ps. tried this on the python-forum but di

Re: Idiom for "last word in a string"

2009-09-23 Thread akonsu
On Sep 23, 2:47 pm, Grant Edwards wrote: > I recently ran across this construct for grabbing the last > (whitespace delimited) word in a string: > >    s.rsplit(None,1)[1] > > It was somewhat obvious from the context what it was supposed > to do, but it took a bit of Googling to figure out exactly

Re: Get error message from FTPLib

2009-09-23 Thread Jeff McNeil
On Sep 23, 1:46 pm, Bakes wrote: > I am using ftplib for a project, using a try/except loop. > > I would like to find out the exception, but I am a python newbie and > do not know how. > > How, in a try/except loop would I find the ftplib exception? For a bit on exception handling in general, ch

Idiom for "last word in a string"

2009-09-23 Thread Grant Edwards
I recently ran across this construct for grabbing the last (whitespace delimited) word in a string: s.rsplit(None,1)[1] It was somewhat obvious from the context what it was supposed to do, but it took a bit of Googling to figure out exactly what was going on. When I want the last word in a st

Re: easy question, how to double a variable

2009-09-23 Thread David C Ullrich
On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > >> But you actually want to return twice the value. I don't see how to do >> that. > > What? > > Seriously? You're saying it _can_ be done in Python? They must have added

Searching Dictionary

2009-09-23 Thread Support Desk
i am trying to search a large Python dictionary for a matching value. The results would need to be structured into a new dictionary with the same structure. Thanks. The structure is like this { Key : [{'item':value,'item2':value,' item3':value,'item4':value,'item5':value','item6':value,'item7':va

Re: Solved - Python: automate input to MySQL query

2009-09-23 Thread Joe Riopel
On Wed, Sep 23, 2009 at 10:49 AM, D'Arcy J.M. Cain wrote: > Of course you can get around this by specifying every field and using > "AS" to change the names to manager_id and employee_firstname, etc. but > if you are going to do that anyway, why not just do it once in the > database instead of lit

Re: Twisted 100% event driven or hybrid?

2009-09-23 Thread exarkun
On 05:48 pm, mcfle...@vrplumber.com wrote: exar...@twistedmatrix.com wrote: On 05:55 am, jacopo.pe...@gmail.com wrote: ... results to be ready, I collect and process them. From now on I don 19t need a the system to be event drive any more, the processing should occur only on the master machin

Re: Most "active" coroutine library project?

2009-09-23 Thread exarkun
On 05:00 pm, sajmik...@gmail.com wrote: On Sun, Aug 23, 2009 at 11:02 AM, Phillip B Oldham wrote: I've been taking a look at the multitude of coroutine libraries available for Python, but from the looks of the projects they all seem to be rather "quiet". I'd like to pick one up to use on a curr

Re: [SQL] Pick random rows from SELECT?

2009-09-23 Thread Gilles Ganault
On Mon, 21 Sep 2009 21:40:02 -0700, Dennis Lee Bieber wrote: > I'd suggest either a pool of threads -- 5-10, each reading company >names from a shared QUEUE, which is populated by the main thread >(remember to commit() so that you don't block on database updates by the >threads). OR... deter

Get error message from FTPLib

2009-09-23 Thread Bakes
I am using ftplib for a project, using a try/except loop. I would like to find out the exception, but I am a python newbie and do not know how. How, in a try/except loop would I find the ftplib exception? -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted 100% event driven or hybrid?

2009-09-23 Thread Mike C. Fletcher
exar...@twistedmatrix.com wrote: > On 05:55 am, jacopo.pe...@gmail.com wrote: ... >> results to be ready, I collect and process them. From now on I don 19t >> need a the system to be event drive any more, the processing should >> occur only on the master machine, following a deterministic flow. >>

Re: arrays in python

2009-09-23 Thread Michel Claveau - MVP
Hi! See: http://docs.python.org/tutorial (section 5) @+ -- MCI -- http://mail.python.org/mailman/listinfo/python-list

Re: tool per conversione e trasformazione dati

2009-09-23 Thread Francesco Stablum
I am sorry, the previous mail was intended to be published to the italian python mailing list, but... whoops, autocomplete tricked me... I will translate it in English: Hello, I work in a company where we do intensively database conversions, data transformations from different sources, queries of

  1   2   >