>> I'm not an expert on python internals, and it is possible that they have
>> a way of checking for cases like this. I think the deepcopy method
>> catches this, but I don't *think* basic garbage collection look for this
>> sort of thing.
>
> deepcopy has nothing to do with garbage collection.
>
Bennie Tilma wrote:
> I'm having trouble with opening the python IDLE-program. When I try to start
> it, it gives an errormessage wich states that it can not make a connection,
> possibly because of a firewall. However, adding it to firewalls exeptions or
> even disabeling the firewall has no effe
[EMAIL PROTECTED] wrote:
> My abuser has been using the medical device to harass me the last 4-5
> years. I have no idea what type of a device is being used on me. I
> believe the device is only available to licensed pharmacist(s). I am
> not very familiar with the intend usage o
Grant Edwards wrote:
> On 2006-02-13, John Salerno <[EMAIL PROTECTED]> wrote:
>
> > I know it comes from the suffix -tuple, which makes me think
> > it's pronounced as 'toople', but I've seen (at m-w.com) that
> > the first pronunciation option
John Salerno wrote:
> I know it comes from the suffix -tuple, which makes me think it's
> pronounced as 'toople', but I've seen (at m-w.com) that the first
> pronunciation option is 'tuhple'
I went to university in Pittsburgh and work in Washington, DC. I've
only ever heard it as toople.
If I he
I'm working on writing a web robot (for searching web pages) in Python
so I've been browsing around the web looking for data about building
web robots.
I'm surprised to find that I didn't find much data. Seems like robots
would be kind of a common thing to build. I know there is this: "The
Web Rob
Or just do the message box.
>>> import CLR.System.Windows.Forms as Forms
>>> Forms.MessageBox.Show("message goes here", "Window title goes here")
http://www.zope.org/Members/Brian/PythonNet/
In theory this will also work on a linux system with Mono installed
--
http://mail.python.org/mailman/l
[EMAIL PROTECTED]:~$ python
Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
They are in one of the directories listed in sys.path, for me this is:
[GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] on linux2
Type "help", "copyright", "credits" or "license&qu
hy...
if you dont know how to help people here... dont say "google it".
groups.google was made to help! not to say google it!
i really dont not what kind of professional you are to say "google it!"
you are smart boy!
i think your mom has much pride of you!
google it to learn more than say "go
Magnus Lycka wrote:
> [EMAIL PROTECTED] wrote:
> > But it turns out he actually had one, which he graciously provided
> > in response to my observation. If I had kept my trap shut, I wouldn't
> > have it, would I?
>
> I completely agree, but you could put
Dave wrote:
> This should be simple, but I can't get it:
>
> How do you loop backwards through a list?
>
> For example, in, say, Javascript:
>
> for (var i = list.length - 1; i >=0; i--) {
> do_stuff()
> }
>
> I mean, I could reverse the list, but I don't want to. I want it to
> stay exactly
[EMAIL PROTECTED] wrote:
> Hi,
> Is it true that that "Python 3000" is dead ?
> Honestly I think that e.g. changing 5/2 to be 2.5 (instead of 2) would
> just break to much code :-(
> On the otherhand I'm using Python as "Matlab replacement" and would
>
If I un-comment any line in this program below the line where I
commented " all OK up to this point " This program locks up my
computer.
Windows task manager will show "Not Responding" for Python in the
Applications tab and in the Performance tabe the CPU usage will be
locked at %100.
I've experi
I'm writing a program in python that creates tar files of a certain
maximum size (to fit onto CD/DVD). One of the problems I'm running
into is that when using compression, it's pretty much impossible to
determine if a file, once added to an archive, will cause the archive
size to exceed the maximu
Why can't I import gtk (pygtk) module? It appears gtk module want X
perms?
>>> import gtk
Traceback (most recent call last):
File "", line 1, in ?
File "/usr/lib/python2.3/site-packages/gtk-2.0/gtk/__init__.py", line
37, in ?from _gtk import *
RuntimeError: could not open display
--
ht
Big help guys, thanks. There does seem to be a problem with Pythons
IDLE. If I run my oridgional program from a dos shell I can hit Ctrl-C
and free up the procesor, But running it in IDLE just locks up the
computer. Bad Windows. Thanks for the help with a more efficent
algorythm.
David KG2LI
[EMAIL PROTECTED] wrote:
> Why can't I import gtk (pygtk) module? It appears gtk module want X
> perms?
>
>
> >>> import gtk
> Traceback (most recent call last):
> File "", line 1, in ?
> File "/usr/lib/python2.3/site-packages/gtk-2.0/
Ok, so here is my situation:
Let's assume I have a function that makes good use of the kwargs
parameter. It requires that there is a certain "format" for the kwargs
keywords. (I am using Django, btw). The format is like such:
"SOMEVAL__exact", etc., where SOMEVAL is some value that it parses from
Well, I knew about the apply() function, but totally forgot to use it.
It worked.
Example:
apply(function_call, (), {keyword: "Tom"})
--
http://mail.python.org/mailman/listinfo/python-list
Thanks. That also worked. I will use that, since apply() is deprecated
as of 2.3.
Thanks!
-Tom
--
http://mail.python.org/mailman/listinfo/python-list
No comments?
I found a small bug in TarFile.snapshot() / restore() - they need to
save and restore self.inodes as well.
--
http://mail.python.org/mailman/listinfo/python-list
As suggested by Alex the datetime module makes this easy:
py> import datetime
py> epoch = datetime.datetime.utcfromtimestamp(0)
py> print epoch
1970-01-01 00:00:00
py> today = datetime.datetime.today()
py> d = today - epoch
py> print d
13196 days, 9:50:44.266200
py> print d.days # timedelta object
[EMAIL PROTECTED] wrote:
> hi,
>
> I'm not sure why this hasn't come up yet, but this seems to beg for
> list comprehensions, if not generator expressions. All of the
> following run in under 2 seconds on my old laptop:
>
> >>> alph = 'abcdefghij
I rarely do GUIs, and reminded myself today why that is the case
(simply, it's not fun).
I implemented a simple TreeCtrl, and had to implement my own 'children'
method, of all things!
Here it is:
def children(self,node):
c = []
nc,cookie = self.GetFirstChild(node)
whi
Ben Finney wrote:
> The web content is a bit sparse; fortunately the code has seen more
> love than the web pages. Wax was the focus of a couple of Google
> "Summer of Code" projects, and new life seems to have been gained as a
> result.
I'm glad to hear that, however, I just took a look at the m
snoe wrote:
> Take a look at dabo, II think they're doing exactly what you're
> describing.
> http://blog.dabodev.com/
Dabo appear to be doing way more than what I want, with database access
etc.
My ideal module, when implemented, would be extremely small as far as
the size of code goes. I'm usi
Fuzzyman wrote:
> The code is relatively simple - so it would be easy to maintain the
> parts you use if that was necessary. Certainly easier than duplicating
> it yourself from scratch. :-)
Sounds convincing, I'll give it a shot after all.
--
http://mail.python.org/mailman/listinfo/python-list
Did you try this: http://www.amk.ca/python/code/crypto ?
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Fuzzyman wrote:
>
> > The code is relatively simple - so it would be easy to maintain the
> > parts you use if that was necessary. Certainly easier than duplicating
> > it yourself from scratch. :-)
>
> Sounds convincing, I'll give it
This might be all you need:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/473878
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I'm not sure I understand precisely your question but maybe you can try
a readline and a flushinput like that:
import serial
port= 0 # or the port where you're device is connected
baudrate=9600 # or the baudrate of your device
s = serial.Serial(port, baudrate) # Open the port
for i in r
>
> Where can I find how to send a .ps directly to the printer?
>
Have you seen this?
http://tgolden.sc.sabren.com/python/win32_how_do_i/print.html
In particular, the section on using win32print directly.
Brian.
--
http://mail.python.org/mailman/listinfo/python-list
You can play around with Pil, http://effbot.org/imagingbook/
I found this as being the date for a picture
>>> import Image
>>> i = Image.open('/media/hda8/Pictures/Elvis/dscn0178.jpg')
>>> i._getexif()[36867]
'2006:02:18 14:07:55'
>>>
--
http://mail.python.org/mailman/listinfo/python-list
This is a beginner question. I am using a Mac running OS X. I have
TclTkAqua installed. If I type:
import Tkinter
r = Tkinter.Tk()
c = Tkinter.Canvas(r)
c.pack()
c.create_line(0,0,100,0)
the line is not visible. If I type:
c.create_line(3,4,100,4)
the line is visiable. There appears to be
How do I make a tab character in code to split a line read with tabs in
it?
Thanks.
Tom
--
http://mail.python.org/mailman/listinfo/python-list
anthonyberet wrote:
> Tim Chase wrote:
> >> I want to work on a sudoku brute-forcer, just for fun.
> >
> >
> > Well, as everybody seems to be doing these (self included...), the
> > sudoku solver may become the "hello world" of the new world :)
> >
> >> What is the equivalent way to store data in
take a look at the time module.
--
http://mail.python.org/mailman/listinfo/python-list
Hmm, I know this is something fundamental about how Python implements
predicate dispatch, but for some reason I believed that this would
work:
class delegate_dict(dict):
def __init__(self, orig, deleg):
dict.__init__(self, orig)
self.deleg = deleg
def __getitem__(self, nam
I think this is what you want:
file = open(r'c:/test.txt','r')
c = file.read(3)
while c:
print c
c = file.read(3)
file.close();
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
> "kpp9c" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Numeric, Numarray, & Numpy... some one stick a screwdriver in my
> > forehead and end the madness that Numeric has become.
>
> > For crying all night! Nu
Mladen Adamovic wrote:
> Mladen Adamovic wrote:
> > I wonder which editor or IDE you can recommend me for writing Python
> > programs. I tried with jEdit but it isn't perfect.
>
> I've got a lot of replies on this message.
> In jEdit auto ident don't work OK.
>
> Answers like vi, emacs and gedit I
Sure. There's probably a thousand ways to do this.
--
http://mail.python.org/mailman/listinfo/python-list
I think something that may be even more important to consider than just
the pure speed of your program, would be ease of design as well as the
overall stability of your code.
My opinion would be that writing in Python would have many benefits
over the speed gains of using C. For instance, you craw
It looks like untrustedinterpreter has at least two major obstacles to
executing reasonably complex code:
augmented assignment is not supported:
a.b = 'foo'
is translated into
__getattr__(a,b) = 'foo'
Second, this is mysterious, but nevertheless...
"""This form of restricted Python assume
heya,
i need this video capture modules which i can use in linux, u know the
similar one used in windows, Now Windows is not my type and it would be
really helpful if someone helps me out...i tried libfg but its not
useful in my case (BTW its a great library)...
regards
Sudharshan S
--
http://m
well wht can i say it simply refuses to compile...i m getting make
errors. i think the culprit is the gcc-4.0..secondly i havent had a
chance to really try it out..aneways does libfg manipulate inputs from
webcams..like VideoCapture modules ..also i think libfg is mainly for C
although a module for
ok..i'll check with that...but wait libfg binaries arent available in
any software repos..and Diez, I would like to mention that there is a
VideoCapture lib exclusively for python..(only that its for win32)..
>So - that _is_ a
>C-domain.
So can i kinda embed that code into C using the libraries th
Hi,
I'm trying to open a Netcdf file using NetcdfFile but I always get an
import error DLL failed
even though I've tried using all these:
import Numeric
from Scientific.IO.NetCDF import NetCDFFile
from Scientific.IO import NetCDF
from Scientific import *
from Scientific.IO.NetCDF import *
I've go
Carl Friedrich Bolz wrote:
> Chris Mellon wrote:
> > I've encountered a C scripting environment that works by using GCC to
> > compile each line as it is encountered, doing some magic to keep a
> > working compilation environment around.
> >
> > Interpreted? Compiled?
> >
>
> There is also the wond
I tried this code and it worked fine:
while 1:
var1 = raw_input("Enter a number: ")
print "You entered:",var1
var1 = int(var1) + 1
print var1
--
http://mail.python.org/mailman/listinfo/python-list
Does anyone know how to call for the root prompt before launching your
app?
Kinda like synaptic or the superuser file manager does?
Thanks,
Tom
--
http://mail.python.org/mailman/listinfo/python-list
I was thinking you can do a shell call or something and pass the info
for root access.
--
http://mail.python.org/mailman/listinfo/python-list
Then you have root access in that shell only, and not in the 'mother'
python process. I guess Harlins suggestion is the nest: run with sudo
--
http://mail.python.org/mailman/listinfo/python-list
did you download the rpm from http://www.python.org/2.4/rpms.html? The
it runs as /usr/bin/python2.4 - see Q&A section on this page
--
http://mail.python.org/mailman/listinfo/python-list
I have an XML string coming in from one system that I'd like to tidy up
and return in a very particular format. I'm picky!
If the input is
Then the output must be
The file might have comments and namespaces and all of this should be
preserved as it was when it came in.
I was hoping to use Ele
Hi.
I have a Python program that parses a file and inserts records into a
database with MySQLdb. I recently upgraded to MySQL 5.0.8, and now my
parser runs *really* slow. Writing out to CSV files is fine, but when I
try to insert the same records in a MySQL5 database, it slows to a
crawl. Using My
Gerhard Häring wrote:
>
> Maybe you're running in autocommit mode. I. e. an implicit COMMIT is
> done for each insert. This slows any database down.
>
> Or are you calling commit() yourself too often?
>
> -- Gerhard
I'm not calling COMMIT at all. I'm using MyISAM tables. I'll check on
autocommit.
rtilley wrote:
> # Spaces are present before and after the XXX
> filename = ' XXX '
>
> new_filename = filename.strip()
>
> if new_filename != filename:
> print filename
>
> Macs allow these spaces in file and folder names. Which is OK. The
> problem arises when the file or folder is copied to
Yes I am but, I'm using a DOM Serializer in Firefox which for some
reason turns myCamelNames into MYCAMELNAMES for the nodenames. I'll
therefore need to control the case-spelling of these things as I'm
formatting the XML string.
--
http://mail.python.org/mailman/listinfo/python-list
Another way to do it is to use ksystraycmd which is included with your
KDE. Some usage info is covered in my tutorial:
http://xmelegance.org/customising-window-behaviour/html/customising-window-behaviour.html
Rich.
--
http://mail.python.org/mailman/listinfo/python-list
Or:
py> print hex(ord('a'))
0x61
py> print int(ord('a'))
97
--
http://mail.python.org/mailman/listinfo/python-list
GEB perhaps?
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I have a python script that pickles and unpickles a give object. It
works without any problems on windows (the data was pickled on windows
first). But when I try to run the script on Linux, I get the following
error:
mydbinfo = pickle.Unpickler(f).load()
File "/usr/lib/python2.3/pickle.
Dear all,
My lab has been using a Movable Type blog for internal communication
and announcement for a couple of years, but we've now seen the light
and I've set up a MoinMoin wiki. Everything's installed beautifully, so
I'm writing scripts to export all our Movable Type blog posts to wiki
pages. S
As far as i know, gedit is the weak link, this is because of the way it
handles its whitespaces, had that trouble myself though not this
*severe*
--
http://mail.python.org/mailman/listinfo/python-list
It is indeed the problem. Thanks.
May be, this fact could have been mentioned in the documentation. I
have suggested the change using bug tracker.
Raghu.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm trying to debug QMTest from Code Sourcery with PDB from inside
Emacs.
My problem is that without PDB, I have no problem, but when I'm using
PDB,
I get exceptions thrown.
Has anyone else tried using PDB on QMTest?
My python is 2.2, and QMTest is 2.0.3.
Thanks / Claes
--
http://mail.pytho
rtilley wrote:
> Roel Schroeven wrote:
> > rtilley schreef:
> >
> >> This will at least allow me to ID folders that start with
> >> whitespace... from within Windows too :) yet I still cannot rename the
> >> folders after stripping the whitespace... attempting to gives an
> >> [Errno 2] No such fi
SamFeltus wrote:
> I aint a professional coder, but a gardener. However, the
> Flash->JSON->Python technique works. It is poorly coded, but it is IMO
> a very simple way to integrate Flash and Python compared to the methods
> normally suggested on the net.
>
> The HTML is just some junk thrown up
Ben Finney wrote:
> PEP 354: Enumerations in Python has been accepted as a draft PEP. The
> current version can be viewed online:
-1 on the proposal as a builtin, -0 on including any kind of
enumeration in the standard library unless I can see a compelling use
case; Carl Banks' approach seems more
>>Is there any simple way round this situation in general?
It might be safer to use composition instead of inheritance in this
case. Assuming that XMLWriter has a write method to write what you
want, you could hold a reference to an XMLWriter within your class and
pass along write command like:
w
I not only want to compare class *instances* but also the classes
themselves. Something like:
class T(object):
@classmethod
def __cmp__(cls, other):
return cmp(cls.__name__, other.__name__)
@instancemethod
def __cmp__(self, other):
return cmp(self.x, other.x)
class
This (unabashed plug) might help. Most of the tutorial is about
networking, but just skip that stuff. Hopefully the architecture
section helps. But it sounds like you're pretty much on your way
already. Just read through your first paragraph, circle every noun,
and determine whether that noun
As allternative you might want to try the commands.getstatusoutput()
method, it returns a tuple with the exit code and output of the command
you run, see http://docs.python.org/lib/module-commands.html
--
http://mail.python.org/mailman/listinfo/python-list
Awesome! Perfect!
Thanks
Janto
--
http://mail.python.org/mailman/listinfo/python-list
Hi John.
Design patterns aren't tied to any specific implementation so they
should apply to any language. You might find that they can even apply
to solution domains outside of computer science.
Implementation details will usually differ between languages. But the
implementation can also be dif
Hi,
I have a fairly sizable body of python code that I'm in the process of
modernizing.
One of the modernization steps is converting to use new-style classes,
and this is leading to problems with pickle. What's happening is that
part of the test suite for this code includes pickled instances of t
John M. Gabriele wrote:
> -- GTK+ is what most Gnome apps use. The Python binding is PyGTK.
> http://www.pygtk.org/
[snip]
> -- wxWindows is a lot like MS Windows MFC if I recall correctly.
> The Python binding to wxWindows is called wxPython.
> http://www.wxpython.org/
Note that wxWin
Grant Edwards wrote:
> On 2006-03-02, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Note that wxWindows wraps native widgets,
>
> Not on Linux/KDE systems. ;)
Right, I followed that with a clarification of supported systems. You
can use wxwindows with gtk-qt to get
Is there a way to hide a python instance from the Task Manager process
list?
--
http://mail.python.org/mailman/listinfo/python-list
I'm really trying to figure out the overall extent with which python
can interact with the windows system (curious person ;D). I can't seem
to find documentation on it, so if anyone could point me to that... i
know python can kill processes and return what processes are running,
so i was just wonde
Use IRC (mIRC is best in my opinion), has a trial that lasts forever.
Connect to the Rizon.net server and search for mp3 chatroom. Ask for
help using xdcc if you need it.
--
http://mail.python.org/mailman/listinfo/python-list
Might want to check out the SO_REUSEADDR bit in sockets. I believe it
helps with a problem of a program not notifying the OS that it's done
with the port.
Piece of a script (duh):
host = ""
port = 51423 #random for this example
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(s
Another option would be FarPy GUIE: http://farpy.holev.com
--
http://mail.python.org/mailman/listinfo/python-list
Skip answered why, but not how to make it work right:
>>> x = [[0]*2 for x in range(2)]
>>> x
[[0, 0], [0, 0]]
>>> x[0][1]=1
>>> x
[[0, 1], [0, 0]]
Cheers,
n
--
http://mail.python.org/mailman/listinfo/python-list
Francois wrote:
> I discovered Python a few months ago and soon decided to invest time in
> learning it well. While surfing the net for Python, I also saw the hype
> over Ruby and tried to find out more about it, before I definitely
> embarked on studying and practicing Python. I recently found tw
i have a result tuple from a MySQLdb call that would like to change in
place..
i would like to copy it to a list, so i can modify it in place, but i
cannot figure out how to do it.
the result typle is
dataResults
and i thought i could do something like
dataList = []
dataList = dataResults
b
i am SURE i am using the wrong terminology...
but what i would like to do is something like this:
pageContent='''
{toc}
h1. Header Section
h2. Date:
{metadata:date}'''+date+'''{metatdata}
h2. Author:
{metadata:author}Len Sweet{metadata}
h1. Exegesis
{metadata:exegesis}'''+exegesis+'''{me
ah!
this looks like what i am looking for..
i will try these both out..
thanks!
--
http://mail.python.org/mailman/listinfo/python-list
I can't understand why name a graph library 'nework' :)
--
http://mail.python.org/mailman/listinfo/python-list
Cameron Laird wrote:
> In article <[EMAIL PROTECTED]>,
> Engineer <[EMAIL PROTECTED]> wrote:
> .
> .
> .
> >The security 'droids have decided that since the MS Office Suite is
a
> >"
Ok, I was sloppy - I meant the regular kill, not the -9 version...
--
http://mail.python.org/mailman/listinfo/python-list
Any hints on level 6 ?
There is "zip" in the page source, "ZIp" in the
image data, but have no clue what to do with them
- tried many things :).
Thanks,
Maciek
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I following an example on how to zip files from the www.devshed.com
site.
I can create a zip package, however I am not getting any compression.
120M file stays 120M within the zip package.
I need to know how to set or activate the compression values.
here is the code I'm using:
>import zip
[Skip Montanaro]
> > def serve_forever(self):
> > while self.serving:
> > r,w,e = select.select([self.socket], [], [],
self.pause)
> > if r:
> > self.handle_request()
> >
> > and set self.pause to something short-ish. The select call times
out an
Caro Michele:
Non parlo italiano, ma parlo espagnol. I can read your website, and
your library looks interesting. Would you like me to provide an
english translation of your webpage so that you can provide a version
for english speakers?
I am a WordPress user and a Python programmer so I will b
Isn't it a better idea to manipulate the import statement with use of
of the 'imp' module to get a restriction on the import statement?
--
http://mail.python.org/mailman/listinfo/python-list
print cls.dog
-c = C()
-c.printDog(c)
-c.changeDog()
-c.printDog(c)
[EMAIL PROTECTED]:~$ ./test.py
fluffy
spike
[EMAIL PROTECTED]:~$
--
http://mail.python.org/mailman/listinfo/python-list
uzzup?"
-
-
-abob = bob(sayyoudo=doit)
-
-abob.sayyoudo()
outpu is now:
[EMAIL PROTECTED]:~$ ./test.py
{'sayyoudo': }
wuzzup?
[EMAIL PROTECTED]:~$
so property sayyoudo points to method doit
--
http://mail.python.org/mailman/listinfo/python-list
what about :
[EMAIL PROTECTED]:~$ python
Python 2.4.1 (#2, Mar 30 2005, 21:51:10)
[GCC 3.3.5 (Debian 1:3.3.5-8ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> print glob.glo
2301 - 2400 of 4908 matches
Mail list logo