Re: NumPy installation won't import correctly

2009-12-01 Thread Diez B. Roggisch
Ethos wrote: > I installed NumPy for python 2.6 on my leopard macbook, using the > nifty mac installer they now provide. I have the 2.6 official python > distro installed on my computer, in addition to the 2.5 that is native > on the mac. When I went to test out the installation, with 2.6, it > ga

Re: Tracing variable scope (local vs. global)

2009-12-01 Thread Diez B. Roggisch
Manuel Graune schrieb: Hello, consider the following piece of code: a=1 b=2 def foo(c): b=3 return a + b + c In this case, when calling "foo", "a" will take the global value, "b" will take the local value and "c" will take the value assi

Re: How to set object parameters nicely?

2009-12-01 Thread Diez B. Roggisch
allen.fowler schrieb: Hello, I've got a bunch of code that looks something like: class MyOb(object): def __init__(self, p1=None, p2=None, p3=None, ...): self.p1 = p1 self.p2 = p2 self.p3 = p3 self.pN = ... ob1 = MyOb(p1="Tom", p3="New York") ob2 = MyOb(p1="Joe", p2="j...@hos

Re: How to set object parameters nicely?

2009-12-01 Thread Diez B. Roggisch
allen.fowler schrieb: Is there a better way to do this? class MyOb(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) ob1 = MyOb(p1="Tom", p3="New York") ob2 = MyOb(p1="Joe", p2="j...@host", p3="New Jersey") I've tried this, but have found two issues: 1) I can'

Re: DOM related question and problem

2009-12-01 Thread Diez B. Roggisch
bla bla schrieb: Nice post on extracting data, simple and too the point :), I use python for simple html extracting data, but for larger projects like the web, files, or documents i tried extract data which worked great, they build quick custom screen scrapers, extracting data, and data parsing

Re: can python do this?

2009-12-02 Thread Diez B. Roggisch
Rounak wrote: > I am a complete newbie. I want to know if the following can be done > using python or should I learn some other language: > (Basically, these are applescripts that I wrote while I used Mac OS) > 1.Web Page Image to Wallpaper: > A script that takes the current image in a browser and

Re: can python do this?

2009-12-02 Thread Diez B. Roggisch
Rounak wrote: > >> Python can do anything Applescript can do with the appscript module - >> see . And, >> naturally, very much more. > > wait, sorry, i forgot to mention. I am now on Linux. I want to know what > python can do in Linux. On

Re: can python do this?

2009-12-02 Thread Diez B. Roggisch
Rounak wrote: > >> >> http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-script-linux >> > the first solution in this thread requires python imaging library which > I did find here: http://www.pythonware.com/products/pil/faq.htm > But i would like to know if there are easi

Re: Noob thread lock question

2009-12-02 Thread Diez B. Roggisch
Astley Le Jasper schrieb: I have a number of threads that write to a database. I have created a thread lock, but my question is this: - If one thread hits a lock, do a) all the other threads stop, or b) just the ones that come to the same lock? Only the ones coming the the same lock. - I

Re: Manyfile Processing

2009-12-04 Thread Diez B. Roggisch
[email protected] schrieb: Hey, sorry if i bother you with a beginners question but i have an issue with processing a bunch of files. They are some arithmetic lists the processing of one file is an easy task but how do i process many files? I tried reading that files in to a list and looping

Re: question about imports in a class

2009-12-07 Thread Diez B. Roggisch
J schrieb: Just a little newbie confusion about OS imports... Why does this give me an error: class Windows: def __init__(self): ''' Constructor ''' import os self.dmidecodePath="" #final path to dmidecode binary def parseDMI(self): # Fi

Re: question about imports in a class

2009-12-07 Thread Diez B. Roggisch
nd want to import os globally for BOTH classes to use? Same thing? import os class A(): ... class B(): ... That's it. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: question about imports in a class

2009-12-07 Thread Diez B. Roggisch
J schrieb: On Mon, Dec 7, 2009 at 16:57, Diez B. Roggisch wrote: if I put the import at the beginning of the class, it just dawned on me that perhaps I still have to explicitly call the function by class: sysinfo.py class myclass(): import os def findDMIDecode(self): for r,d,f

Re: How decoupled are the Python frameworks?

2009-12-08 Thread Diez B. Roggisch
shocks wrote: > Hi > > I'm getting back into Python after a long break. I've been developing > large enterprise apps solely with Adobe Flex (ActionScript) for the > past couple years. During that time I've used a number of 'MVC' > frameworks to glue the bits together - among them Cairngorm, a >

Re: no module named error

2009-12-08 Thread Diez B. Roggisch
Joe wrote: > I am trying to write/run a python script which imports from another > script which is located in my /usr/lib64/python2.6/site-packages/ dir, > but getting the following error. > > $ python ./mytest.py > Traceback (most recent call last): > File "./mytest.py", line 45, in > f

Re: no module named error

2009-12-08 Thread Diez B. Roggisch
Joe wrote: >> But it's searching for _moda.*, most probably a binary extension. Does >> that exist, and if yes, has it the proper architecture or is it maybe 32 >> bit? > > I'm just going by an example script. moda is a package I was given that > is written in C and has some python bindings and d

Re: no module named error

2009-12-08 Thread Diez B. Roggisch
Joe wrote: > Diez B. Roggisch wrote: >> Joe wrote: >> >>>> But it's searching for _moda.*, most probably a binary extension. Does >>>> that exist, and if yes, has it the proper architecture or is it maybe >>>> 32 bit? >>> I'

Re: no module named error

2009-12-08 Thread Diez B. Roggisch
Joe wrote: > Just to clarify, I have "_moda.la" sitting in another directory which is > included in my LD_LIBRARY_PATH. And it is built for the 64bit arch. No, the import-mechanism of python doesn't take LD_LIBRARY_PATH into account, and even if it did - _moda.la is a simple archive-file, not a s

Re: Question about 'remote objects'

2009-12-09 Thread Diez B. Roggisch
> I am writing a multi-user business/accounting application. It is getting > rather complex and I am looking at how to, not exactly simplify it, but > find a way to manage the complexity. > > I have realised that it is logically made up of a number of services - > database service with connect

Re: "file" does not work with the "with" statement!

2009-12-10 Thread Diez B. Roggisch
Michele Simionato wrote: > I have just discovered that the syntax > > with file(name, 'w') as f: >do_something(f) > > does not close the file at the end of the with statement! On the > contrary > > with open(name, 'w') as f: >do_something(f) > > works fine. The docs say "When opening a

Re: "file" does not work with the "with" statement!

2009-12-10 Thread Diez B. Roggisch
Michele Simionato wrote: > On Dec 10, 11:04 am, "Diez B. Roggisch" wrote: >> Are you sure? For me on python2.5, it works as advertised: >> >> from __future__ import with_statement >> >> def test(outf): >> with outf: >> outf.write("te

Re: Generating diagrams from PostgreSQL with Python (Re: postgresql_autodoc in Python?)

2009-12-10 Thread Diez B. Roggisch
Wolfgang Keller wrote: > Hello, > > I will re-precise my question: > > Has anyone ever implemented a script in Python that generates > documentation (especially diagrams, in a format such as e.g. Dia, Inkscape > SVG or Tikz) for a PostgreSQL database either from an SQL script or by > connecting

Re: accessing local variables from the pdb debugger

2009-12-10 Thread Diez B. Roggisch
Jean-Michel Pichavant wrote: > Guys, > > I have some problem changing method locals with pdb: > > import pdb > > def test(): > foo = 'foo' > pdb.set_trace() > > test() > --Return-- > > /home/jeanmichel/trunk/tnt/test.py(5)test()->None > -> pdb.set_trace() > (Pdb) print foo > foo > (Pd

Re: no module named error

2009-12-10 Thread Diez B. Roggisch
Joe wrote: >> No, the import-mechanism of python doesn't take LD_LIBRARY_PATH into >> account, and even if it did - _moda.la is a simple archive-file, not a >> shared library. It can't be dynamically loaded. Something in your >> build-process is not working. > > So how should my stuff find these

Re: no module named error

2009-12-11 Thread Diez B. Roggisch
Joe schrieb: Your installation process is botched (no idea why, you don't show us setup.py or anything else I asked for). Sorry, but I do know how it's currently installed is exactly the way I need it to be installed. It is? It wasn't working until you fiddled with sys.path - which you neede

Re: Moving from PHP to Python. Is it Possible

2009-12-13 Thread Diez B. Roggisch
1) PHP does some really nasty things in how it treats globals, and you will have to break yourself of those sorts of habits -- Python offers much cleaner alternatives, like grouping similar functionality into modules which can be imported; the import functionality in python is pretty flexible. Pyt

Re: Moving from PHP to Python. Is it Possible

2009-12-14 Thread Diez B. Roggisch
Yes, I understood. And I'm using large Global dictionary (or Array) to replicate those objects. State of the thing will store in there. But it wasn't an object. Just Assocative array. Staying in global space, Because. In web programming we do not store anything except session. Every object w

Re: Moving from PHP to Python. Part Two

2009-12-14 Thread Diez B. Roggisch
Sancar Saran wrote: > Hello Again. > > I hope, I don't bug too much. > > First of all. I want to Thank to everyone who respond my messages. > > I was able to do some of my needs and stuck some others. > > So ? I need help again. > > And here my progress.. > > Following was my globalized regi

Re: OS independent way to check if a python app is running?

2009-12-14 Thread Diez B. Roggisch
MRAB schrieb: [email protected] wrote: Is there an os independent way to check if a python app is running? Goal: I have a server program based on cherrypy that I only want to have running once. If a system administrator accidentally attempts to run this program more than once, I would like

Re: basic grammer error..

2009-12-16 Thread Diez B. Roggisch
codefly wrote: > class codefly: > > def WaitFreecatz(self, hours): > hours = self.hours > i = 1 > while i < hours: > print 'i wait %s hours' %(i) > i = i+1 > if i == hours: > print '\nhe never comes' > > > run er

Re: i re-write it

2009-12-16 Thread Diez B. Roggisch
codefly wrote: > error message is here.. > when i type import code2 > > Traceback (most recent call last): > File "", line 1, in > File "code2.py", line 11 > ~ >^ > SyntaxError: invalid syntax > > > and source code is here No, it isn't. The above error says "li

Re: i re-write it

2009-12-16 Thread Diez B. Roggisch
codefly wrote: > On Dec 17, 12:43 am, "Diez B. Roggisch" wrote: >> codefly wrote: >> > error message is here.. >> > when i type import code2 >> >> > Traceback (most recent call last): >> > File "", line 1, in >&

Re: problem with cheetah

2009-12-20 Thread Diez B. Roggisch
mlowicki schrieb: Hi!, i get such error when I try to install cheetah: sudo easy_install cheetah Searching for cheetah Reading http://pypi.python.org/simple/cheetah/ Reading http://www.CheetahTemplate.org/ Reading http://sourceforge.net/project/showfiles.php?group_id=28961 Reading http://www.che

Re: Python3.1: gzip encoding with UTF-8 fails

2009-12-20 Thread Diez B. Roggisch
Johannes Bauer schrieb: Hello group, with this following program: #!/usr/bin/python3 import gzip x = gzip.open("testdatei", "wb") x.write("ä") x.close() I get a broken .gzip file when decompressing: $ cat testdatei |gunzip ä gzip: stdin: invalid compressed data--length error As it only happe

Re: Mechanize - Click a table row to navigate to detail page

2009-12-25 Thread Diez B. Roggisch
Brian D schrieb: A search form returns a list of records embedded in a table. The user has to click on a table row to call a Javascript call that opens up the detail page. It's the detail page, of course, that really contains the useful information. How can I use Mechanize to click a row? Yo

Re: What should I use for testing a web service?

2009-12-27 Thread Diez B. Roggisch
Fencer schrieb: Hello, I need to write a test program for a web service. The web service publishes its method through a wsdl-file. I recall using SOAPpy in the past and as a I remember it, it was very easy to "load" the WSDL-file and call web service methods. But is SOAPpy really maintained any

Re: DB Table Processor?

2009-12-27 Thread Diez B. Roggisch
Shawn Milochik schrieb: It sounds like you're looking for SQLAlchemy. http://www.sqlalchemy.org/ I'd rather say he looks for Django Admin or SPROX. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: how to register with pypi - no such setup.py

2009-12-27 Thread Diez B. Roggisch
Phlip schrieb: I have no alternative, to fix bugs in PyPi, _not_ in "that file", but to continue burning up version numbers that nobody cares about. The message is condescending because I am aware of the reason we version packages, and the message is _not_ helping me apply that reason! Aaand I

Re: adding python engine into c++ application

2009-12-29 Thread Diez B. Roggisch
griwes schrieb: Hello, I am going to write an application in C++, application which should be easy to extend by scripts. I chose python for script language in this application. I'd like to have own API for python. And here the question arises: how do I implement a python engine within an applicat

Re: Author of a Python Success Story Needs a Job!

2009-12-29 Thread Diez B. Roggisch
Please, if there is anyone out there who needs a highly creative and highly skilled software designer for new and completely original work, then for the love of God I implore you to contact me. You don't write if you are willing to relocate, and if yes, if outside the USA is an option. We hir

Re: Instantiate an object based on a variable name

2009-12-31 Thread Diez B. Roggisch
Wells schrieb: Sorry, this is totally basic, but my Google-fu is failing: I have a variable foo. I want to instantiate a class based on its value- how can I do this? class Foo(object): pass ze_class = Foo f = ze_class() Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Safe file I/O to shared file (or SQLite) from multi-threaded web server

2010-01-01 Thread Diez B. Roggisch
[email protected] schrieb: I'm looking for the best practice way for a multi-threaded python web server application to read/write to a shared file or a SQLite database. What do I need to do (if anything) to make sure my writes to a regular file on disk or to a SQLite database are atomic in natu

Re: Trying to run a sudo command from script

2010-01-01 Thread Diez B. Roggisch
Kent Tenney schrieb: Howdy, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc = subprocess.Popen('sudo touch /etc/foo'.split(), stdin=subprocess.PIPE) proc.communicate(inp

Re: Exception as the primary error handling mechanism?

2010-01-02 Thread Diez B. Roggisch
Peng Yu schrieb: On Thu, Dec 31, 2009 at 11:24 PM, Chris Rebert wrote: On Thu, Dec 31, 2009 at 8:47 PM, Peng Yu wrote: I observe that python library primarily use exception for error handling rather than use error code. In the article API Design Matters by Michi Henning Communications of th

Re: Safe file I/O to shared file (or SQLite) from multi-threaded web server

2010-01-04 Thread Diez B. Roggisch
Lawrence D'Oliveiro schrieb: In message , Steve Holden wrote: Yes, but not to MySQL, please. Particularly since there is a sword of Damocles hanging over its head while the Oracle takeover of Sun is pending. Ah, I see the FUDsters are crawling out of the woodwork here, as well. I’ve got new

Re: embedded python on mac - linking problem

2010-01-06 Thread Diez B. Roggisch
Krzysztof Kobus schrieb: Hi, I have a problem with linking python module with my application on mac in order to make the module available in "embedded python". My python module is contained in j3kmodule.cxx file and module initialization function is exported in j3kmodule.h j3kmodule.h:

Python tk Listbox: -listvariable

2010-01-06 Thread Looney, James B
Yesterday, I searched all over trying to figure out how to properly use the "listvariable" argument with tk's Listbox class. Unfortunately, no amount of searching (online) could come up with anything more useful than telling me the variable needed to be a list, and nothing built-in exists. I f

Re: GUI for multiplatform multimedia project

2010-01-07 Thread Diez B. Roggisch
[email protected] schrieb: Hi everyone, I posted that question on a python-forum, but got answer, so I ask here. I'm working on an artistic project and I'm looking for the best cross-platform GUI solution. The problem is that it's gonna be a tool that will have to be double-click ins

Re: PyQt QThreadPool error

2010-01-07 Thread Diez B. Roggisch
h0uk schrieb: Hello. I have the following code: #workers = {} QtCore.QThreadPool.globalInstance().setExpiryTimeout (30) QtCore.QThreadPool.globalInstance().setMaxThreadCount(1) for i in range(1, int(userscnt) + 1): work = wk.Wo

Re: PyQt QThreadPool error

2010-01-07 Thread Diez B. Roggisch
h0uk schrieb: On 8 янв, 01:02, "Diez B. Roggisch" wrote: h0uk schrieb: Hello. I have the following code: #workers = {} QtCore.QThreadPool.globalInstance().setExpiryTimeout (30) QtCore.QThreadPool.globalInstance().setMaxThreadCount(1)

Re: Standardized interpreter speed evaluation tool

2010-01-08 Thread Diez B. Roggisch
alexru schrieb: Is there any standardized interpreter speed evaluation tool? Say I made few changes in interpreter code and want to know if those changes made python any better, which test should I use? Pybench I guess. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Caching objects in a C extension

2010-01-08 Thread Diez B. Roggisch
casevh schrieb: I'm working with a C extension that needs to rapidly create and delete objects. I came up with an approach to cache objects that are being deleted and resurrect them instead of creating new objects. It appears to work well but I'm afraid I may be missing something (besides heeding

Re: restructuredText editor ?

2010-01-08 Thread Diez B. Roggisch
Peter schrieb: What editor do people out there use to edit .rst files for sphinx-python documentation ? Emacs has a RST-mode (which unfortunately has some runtime-issues, the longer the text & the edit, the slower it gets), and together with flymake & rst2xml, you get nice error-notification

Re: Caching objects in a C extension

2010-01-08 Thread Diez B. Roggisch
casevh schrieb: On Jan 8, 2:59 am, "Diez B. Roggisch" wrote: casevh schrieb: I'm working with a C extension that needs to rapidly create and delete objects. I came up with an approach to cache objects that are being deleted and resurrect them instead of creating new obje

Re: What is built-in method sub

2010-01-11 Thread Diez B. Roggisch
Jeremy schrieb: On Jan 11, 12:54 pm, Carl Banks wrote: On Jan 11, 11:20 am, Jeremy wrote: I just profiled one of my Python scripts and discovered that >99% of the time was spent in {built-in method sub} What is this function and is there a way to optimize it? I'm guessing this is re.sub (or

Re: What is built-in method sub

2010-01-11 Thread Diez B. Roggisch
Philip Semanchuk schrieb: On Jan 11, 2010, at 3:30 PM, Jeremy wrote: On Jan 11, 1:15 pm, "Diez B. Roggisch" wrote: Jeremy schrieb: On Jan 11, 12:54 pm, Carl Banks wrote: On Jan 11, 11:20 am, Jeremy wrote: I just profiled one of my Python scripts and discovered that >99

Python tk Listbox: -listvariable class (on win XP)

2010-01-11 Thread Looney, James B
I mentioned that I figured out how to use a variable with a Python TK Listbox in my post (http://www.mail-archive.com/[email protected]/msg271288.html). Now, I'm trying to make a class, ListVar, that allows me to operate on a Listbox's listvariable as if it were a list. The problem is, it

Re: Dynamic HTML controls

2010-01-12 Thread Diez B. Roggisch
within a table, it would look like this: table_form = TableForm("table_form", fields=[SingleSelectField("foo", options=["A", "B", "C"]), action="/some/action", method="GET") table_form.render(dict(foo="B")) Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: remote evaluation of Python code typed in html webpage frame

2010-01-15 Thread Diez B. Roggisch
Am 15.01.10 15:16, schrieb dmitrey: hi all, what's the simplest way to create a webpage with a frame for Python code to be typed in (as a plain text, or, better, as a highlighted text or something like scite or any other easy python IDE, capable of automatic indentations), and then pressing a but

Re: Problems with collision response

2010-01-17 Thread Diez B. Roggisch
Am 17.01.10 15:14, schrieb Joabos: I'm doing a project, and I need to insert collision detection and response on it. Here's the code. What am I doing wrong? Not telling us what's happening, and what *should* happen, for starters. What do you expect? The code you gave us isn't stand-alone, you

Re: Problems with collision response

2010-01-17 Thread Diez B. Roggisch
Am 17.01.10 15:14, schrieb Joabos: I'm doing a project, and I need to insert collision detection and response on it. Here's the code. What am I doing wrong? Not telling us what's happening, and what *should* happen, for starters. What do you expect? The code you gave us isn't stand-alone, you

Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Diez B. Roggisch
Am 18.01.10 01:07, schrieb Jive Dadson: (My apologies if this question shows up twice. I posted it quite a while ago, and it's yet to show up.) This is no doubt a beginner's question, but I've searched for the answer for quite a while, to no avail. I'm running Python 2.6 under Windows XP. Ho

Re: How to install local module other than in "site-packages"?

2010-01-17 Thread Diez B. Roggisch
Am 18.01.10 01:33, schrieb Jive Dadson: Diez B. Roggisch wrote: Am 18.01.10 01:07, schrieb Jive Dadson: (My apologies if this question shows up twice. I posted it quite a while ago, and it's yet to show up.) This is no doubt a beginner's question, but I've searched for the ans

Re: More version woes

2010-01-18 Thread Diez B. Roggisch
Yep. They want $295, and I cannot justify that for personal use. I'll be looking for a cheaper one. There are bazillion discussions in this NG about IDEs and editors. GIYF. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Symbols as parameters?

2010-01-21 Thread Diez B. Roggisch
e function call Short answer is, you can't do it. On the contrary, it's not difficult to do. I provided an example in my answer to the OP (first reply in the thread). Erm, no, you didn't. You showed a) how to pass a string constant into a function and b) how to pass a value from

Re: Symbols as parameters?

2010-01-21 Thread Diez B. Roggisch
Am 21.01.10 19:48, schrieb Alf P. Steinbach: * Diez B. Roggisch: Am 21.01.10 12:58, schrieb Alf P. Steinbach: * Stefan Behnel: Alf P. Steinbach, 21.01.2010 11:38: * Carl Banks: On Jan 20, 11:43 pm, Martin Drautzburg [snip] What I am really looking for is a way - to be able to call move

Re: Symbols as parameters?

2010-01-21 Thread Diez B. Roggisch
Am 21.01.10 20:01, schrieb Alf P. Steinbach: * Diez B. Roggisch: Am 21.01.10 19:48, schrieb Alf P. Steinbach: * Diez B. Roggisch: Am 21.01.10 12:58, schrieb Alf P. Steinbach: * Stefan Behnel: Alf P. Steinbach, 21.01.2010 11:38: * Carl Banks: On Jan 20, 11:43 pm, Martin Drautzburg [snip

Re: Symbols as parameters?

2010-01-21 Thread Diez B. Roggisch
Am 21.01.10 22:51, schrieb Martin Drautzburg: Thanks for all the answers. Let me summarize (1) I fail to see the relevance of >>> def move( direction ): ... print( "move " + str( direction ) ) ... >>> move( "up" ) move up not only in the context of my question. And I don't see an abuse

Re: enumerated while loop

2010-01-23 Thread Diez B. Roggisch
Am 23.01.10 15:44, schrieb Roald de Vries: Dear all, I sometimes want to use an infinite while loop with access to the loop index, like this: def naturals(): i = 0 while True: yield i y += 1 for i in naturals(): print(i) I assume a function like 'naturals' already exists, or a similar constru

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Am 25.01.10 20:05, schrieb Alexander Moibenko: I have a simple question to which I could not find an answer. What is the total maximal size of list including size of its elements? I do not like to look into python source. But it would answer that question pretty fast. Because then you'd see th

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Am 25.01.10 20:05, schrieb Alexander Moibenko: I have a simple question to which I could not find an answer. What is the total maximal size of list including size of its elements? I do not like to look into python source. But it would answer that question pretty fast. Because then you'd see th

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Am 25.01.10 20:39, schrieb AlexM: On Jan 25, 1:23 pm, "Diez B. Roggisch" wrote: Am 25.01.10 20:05, schrieb Alexander Moibenko: I have a simple question to which I could not find an answer. What is the total maximal size of list including size of its elements? I do not like to

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Am 25.01.10 21:15, schrieb AlexM: On Jan 25, 2:03 pm, "Diez B. Roggisch" wrote: Am 25.01.10 20:39, schrieb AlexM: On Jan 25, 1:23 pm, "Diez B. Roggisch"wrote: Am 25.01.10 20:05, schrieb Alexander Moibenko: I have a simple question to which I could not find an

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Am 25.01.10 21:49, schrieb AlexM: On Jan 25, 2:37 pm, "Alf P. Steinbach" wrote: * AlexM: On Jan 25, 2:07 pm, Terry Reedy wrote: On 1/25/2010 2:05 PM, Alexander Moibenko wrote: I have a simple question to which I could not find an answer. Because it has no finite answer What is the

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Am 25.01.10 22:22, schrieb AlexM: On Jan 25, 2:42 pm, "Diez B. Roggisch" wrote: Am 25.01.10 21:15, schrieb AlexM: On Jan 25, 2:03 pm, "Diez B. Roggisch"wrote: Am 25.01.10 20:39, schrieb AlexM: On Jan 25, 1:23 pm, "Diez B. Roggisch" wrote: Am 25.

Re: Total maximal size of data

2010-01-25 Thread Diez B. Roggisch
Well, there actually is a way of building programs that may use more than 4GB of memory on 32 machines for Linux with higmem kernels, but I guess this would not work for python. As I said, it's essentially paging: http://kerneltrap.org/node/2450 And it's not something you can just compile in

Re: mix statically typed with dynamically typed

2010-01-28 Thread Diez B. Roggisch
Am 28.01.10 22:12, schrieb Yingjie Lan: We all know that Python is dynamically typed, and dynamically typed languages are generally slower than statically typed ones. I wonder if it is possible at all for Python to mix statically-typed-ness with dynamically-typed-ness to boost up its speed a l

GetPaid module that supports "deferred" payments?

2009-09-28 Thread Phillip B Oldham
Are any of the GetPaid modules able to handle "deferred" payments? As in, the money to be taken is placed "on hold" in the customer's account and can be "released" to the vendor at a later date. -- http://mail.python.org/mailman/listinfo/python-list

Re: some site login problem help plz..

2009-10-05 Thread Diez B. Roggisch
james27 wrote: > > hello.. > im new to python. > i have some problem with mechanize. > before i was used mechanize with no problem. > but i couldn't success login with some site. > for several days i was looked for solution but failed. > my problem is , login is no probelm but can't retrieve html

Re: SAX: Short tag's ...

2009-10-05 Thread Diez B. Roggisch
Thomas Lehmann wrote: > Hi! > > Is there a way to recognize short tags in a XML? > I'm implementing a SAX handler... > > Problem: storing the XML code I would need this information > in the startElement ... > > How can I handle this? > > > any text I don't think there is a (standard) way, an

Re: Object Relational Mappers are evil (a meditation)

2009-10-05 Thread Diez B. Roggisch
Aaron Watters schrieb: This is a bit off topic except that many Python programmers seem to be allergic to typing SQL. RESOLVED: Using ORMs leads lazy programmers to make bad database designs. It's better to carefully design your database with no invisible means of support and there is no reaso

Re: Creating class instance from module and class name

2009-10-06 Thread Diez B. Roggisch
Steven D'Aprano schrieb: On Mon, 05 Oct 2009 23:32:27 -0700, gentlestone wrote: Suppose I've saved the class name and (don't know how) I've also saved the Class's module (package path or I don't know what's the name for XYZ "from X.Y.Z import ...). How can I construct a new class according to s

Re: package import dangers

2009-10-06 Thread Diez B. Roggisch
Ethan Furman wrote: > Greetings! > > I'm working on a package with multiple modules (and possibly packages), > and I would like to do it correctly. :) > > I have read of references to possible issues regarding a module being > imported (and run) more than once, but I haven't been able to find >

Re: bug with itertools.groupby?

2009-10-06 Thread Diez B. Roggisch
Kitlbast schrieb: Hi there, the code below on Python 2.5.2: from itertools import groupby info_list = [ {'profile': 'http://somesite.com/profile1', 'account': 61L}, {'profile': 'http://somesite.com/profile2', 'account': 64L}, {'profile': 'http://somesite.com/profile3', 'account': 6

Re: cpython compilation parameter

2009-10-08 Thread Diez B. Roggisch
cEd wrote: > Hello, > > I'm wondering how to compile python to get good performance. > Because when I compare this ugly code which find prime number: > > # prime_number.py > start=3 > for is_first in range(start): > found = 0 > is_first+=1 > for i in range (2, is_first): > if not (is_fi

Re: Reading hex to int from a binary string

2009-10-08 Thread Diez B. Roggisch
bytes from the stream "as is", with python resorting to printing these out (in the interpreter!!!) as "\xXX". Python does that so that binary data will always have a "pretty" output when being inspected on the REPL. But they are bytes, and to convert them to an

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Diez B. Roggisch
NiklasRTZ schrieb: Hello, my basic question is which recommendation is after slight restructuring datetime.datetime to datetime Both works but only one should be chosen probably adjust my package to comply to dependencies. Spec integrated code where datetime.datetime.now() refactored to datetime.

Re: datetime.datetime. or datetime. ?

2009-10-08 Thread Diez B. Roggisch
niklasr schrieb: On Oct 8, 5:25 pm, "Diez B. Roggisch" wrote: NiklasRTZ schrieb: Hello, my basic question is which recommendation is after slight restructuring datetime.datetime to datetime Both works but only one should be chosen probably adjust my package to comply to dependen

Re: Reading hex to int from a binary string

2009-10-09 Thread Diez B. Roggisch
Luc schrieb: On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: Luc schrieb: Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", instead of 0x05. I am looking for a clean way to add these two values a

Re: Python CherryPy TurboGears 2 project support needed [in Belgium]

2009-10-09 Thread Diez B. Roggisch
b...@creue-consulting schrieb: Dear comp.lang.python users, Firstly, this a is a Job post for a on-site Freelance Python Job in Belgium, I know this is frowned upon by some, so I am very sorry if it is not well received, but as it is such a great job, I have been encouraged to post this to the

Re: Python CherryPy TurboGears 2 project support needed [in Belgium]

2009-10-09 Thread b...@creue-consulting
Diez, Thanks for pointing this out. It maybe that we are talking about TG 1.1 in that case. I will double check with the TA. Sorry for any confusion! - I'll let you know. Thanks again. Cheers, Ben On Oct 9, 3:36 pm, "Diez B. Roggisch" wrote: > b...@creue-consulting s

Re: Reading hex to int from a binary string

2009-10-09 Thread Diez B. Roggisch
Luc schrieb: On Oct 9, 10:45 am, "Diez B. Roggisch" wrote: Luc schrieb: On Oct 8, 11:13 pm, "Diez B. Roggisch" wrote: Luc schrieb: Hi all, I read data from a binary stream, so I get hex values as characters (in a string) with escaped x, like "\x05\x88", ins

Re: Best way to handle changing list of class imports

2009-10-10 Thread Diez B. Roggisch
Scott Grant schrieb: Hi there, I'd like to set up a framework in which I can add or remove new classes of a given expected subclass to my package, and have the system load that set at runtime and be able to use them. In essence, if I have a class X, and subclasses A, B, and C that derive

Re: Script to complete web form fields

2009-10-11 Thread Diez B. Roggisch
Feyo schrieb: How can I use Python to complete web form fields automatically? My work web-based email time-out is like 15 seconds. Every time I need to access my calendar, address book, or email, I have to type in my username and password. I'm just tired of it. I found the ClientForm module and

Python CherryPy TurboGears 2 project support needed [in Belgium]

2009-10-12 Thread b...@creue-consulting
Dear comp.lang.python users, Firstly, this a is a Job post for a on-site Freelance Python Job in Belgium, I know this is frowned upon by some, so I am very sorry if it is not well received, but as it is such a great job, I have been encouraged to post this to the list. So, apology done, and hopef

RE: a=[1,2,3,4].reverse() - why "a" is None?

2009-10-12 Thread Diez B. Roggisch
Nadav Chernin wrote: > > Chris Withers wrote: > > ...becauase you were looking for: > > reversed([1,2,3,4]) > > OK, but my question is generic. Why when I use object's function that > changed values of the object, I can't to get value of it on the fly > without writing additional code? >

Re: POST value related question

2009-10-12 Thread Diez B. Roggisch
james27 wrote: > > hello > im using mechanize . > i want to send some post value by use mechanize. > but problem is one of POST value in html source is > looks like below. > > post.category.categoryNo=[*1] > > anyway so i was tried several method but all failed. > > here is source . > . > . >

Re: Work around metaclass programming

2009-10-13 Thread Diez B. Roggisch
Zac Burns schrieb: I have a class called Signal which is a descriptor. It is a descriptor so that it can create BoundSignals, much like the way methods work. What I would like to do is to have the class be a descriptor when instantiated in what will be the locals of the class, but not a descripto

Re: Unexpected exit of Python script

2009-10-14 Thread Diez B. Roggisch
vicky wrote: > Hello All, > > I am a new Python user and don't know much about it. > > I just want to know that, due to any reason if a script exits, is > their some way to release all the resources acquired by the script > during execution ? > > Actually In my system I want to execute some pie

Re: Unexpected exit of Python script

2009-10-14 Thread Diez B. Roggisch
vicky wrote: > On Oct 14, 5:52 pm, "Diez B. Roggisch" wrote: >> vicky wrote: >> > Hello All, >> >> > I am a new Python user and don't know much about it. >> >> > I just want to know that, due to any reason if a script exits, is &

<    34   35   36   37   38   39   40   41   42   43   >