If I had to choose one feature, I would like to see better support for
nested lexical scopes. However, I imagine this is no easy "trick" to
add to the language.
> I'm curious -- what is everyone's favorite trick from a non-python
> language? And -- why isn't it in Python?
--
http://mail.python.
The documentation gives an excellent example on how to do this, see
http://docs.python.org/lib/socket-example.html
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
What I want to do is create a module that offers a generic set of
functions (send, recieve, etc...) and reffers the request to the
correct module (rs-232, tcp/ip, etc..).
I want all this to be unseen by the script that calls this module.
I want the script to specify the communication type, and
you could always just remove those special characters (\n \t ..),
remove spaces, read both files and compare string. I don't this is the
best way of doing this... but maybe a combination of this way and yours
will be efficient enough - remove all problematic characters and then
compare line by line
>>> import wmi
>>> c = wmi.WMI()
>>> for printdriver in c.Win32_PrinterDriver():
... pd = printdriver.Name
>>> print pd
AGFA-AccuSet v52.3,3,Windows NT x86
>>> pd[1] # type(pd) == str
u'G'
>>> pd.split(',')
# split returns a new list, and you do not save it
[u'AGFA-AccuSet v52.3', u'3', u'Wi
Hi,
I am using pexpect to spawn an interactive program and wait for
particular string in its output. It works fine but once I get this
required information, I really don't care about the child process
anymore. I would effectively want to "detach" from it. Is there any way
to do such thing in pexpe
db-api specifies a .callproc() method on a cursor object
(http://www.python.org/peps/pep-0249.html), cx_Oracle implements it
(http://starship.python.net/crew/atuining/cx_Oracle/html/cursorobj.html).
for me it works.
--
http://mail.python.org/mailman/listinfo/python-list
Christopher Kang wrote:
> I had a question about python and mysql, but I want to first thank
> those who taught me about the factory method, it was exactly what I
> needed.
>
> Anyway, I have a problem where I am pulling floating point values out
> of mysql and into python using the MYSQLdb modul
If you are looking for a small and simple text editor that moonlights
as an IDE, my suggestion would be
SciTE(http://scintilla.org/SciTE.html). It has reasonable syntax
highlighting and can run Python scripts if you press F5.
--
http://mail.python.org/mailman/listinfo/python-list
If you're looking for a leight weight web development enviroment acting
as a front end for a database take a look at http://www.cherrypy.org
--
http://mail.python.org/mailman/listinfo/python-list
Guido gave a nice "Python Regrets" Power Point talk at OSCON few years
ago.
I was wondering if the plan is to ever implement these ideas.
e.g. Guido said he'd prefer 'print' to be a *function* with perhaps a
'println' version IIRC.
He also had a ton of stuff he'd rather see become iterato
Thanks! Even the fact that these ideas
have been organized into a PEP is
exciting to methere is hope that
they may *someday* be implemented. Maybe sooner than people think.
Another reason to love Python like no other.
Chris
--
http://mail.python.org/mailman/listinfo/python-list
start reading here: http://www.python.org/idle/doc/idlemain.html,
although it is not up to date most of the information still holds up
--
http://mail.python.org/mailman/listinfo/python-list
see the answer on your previous post (
http://groups-beta.google.com/group/comp.lang.python/browse_frm/thread/8e132d9c734907b/87fd1f579a362e71?q=&rnum=2&hl=en#87fd1f579a362e71),
to get an interactive session open a command window and type ' python'
--
http://mail.python.org/mailman/listinfo/pytho
You can catch the content of an url like this:
http://www.python.org/doc/current/lib/node478.html, from here you can
parse it, and the store the result e.g. in dictionary, you will have a
very well performing solution like this.
--
http://mail.python.org/mailman/listinfo/python-list
anthonyberet wrote:
> My question isn't as all-encompassing as the subject would suggest...
>
> I am almost a Python newbie, but I have discovered that I don't get
> along with IDLE, as i can't work out how to run and rerun a routine
> without undue messing about.
>
> What I would really like is
amit wrote:
> Is there any kind of performance differences to the different ways of
> embedding python?
> PyEval_EvalCode()
> PyRun_SimpleFile()
> PyObject_CallObject()
>
AFAIK, these are only different wrappers, while you're generally
getting at the same functionality. I assume
shablool wrote:
> Could someone please explain why stdscr.getxy() always raise an
> exception:
[code here]
the method is named getyx(), this is old unix heritage.
see http://www.python.org/doc/2.0.1/lib/curses-window-objects.html
--
http://mail.python.org/mailman/listinfo/python-list
Hi !
I want to get the WMI infos from Windows machines.
I use Py from HU (iso-8859-2) charset.
Then I wrote some utility for it, because I want to write it to an XML file.
def ToHU(s,NoneStr='-'):
if s==None: s=NoneStr
if not (type(s) in [type(''),type(u'')]):
s=str(s)
if type
Hi !
I have been finished my WMI information getter simple application, but
the exe is not working as like the py modules before compilation.
The problem that when I started the program from CMD, the sys.argv is
show the good path (in my machine the c:\dev\...) from Dialog1.py.
But when I c
Peter Hansen wrote:
> post the exception traceback here[...], we can show you how to analyze it to
> determine for yourself exactly what the problem is
true, remember that for the future. and that goes to everybody asking
questions here. thing is, I've done enough curses programming (in both
Pytho
I am relatively new to Python ...
I have a script that uses urllib2 to open another XML file off of the
same server the PY file is living on.
urllib2.urlopen(url).read()
I changed a bit of it to use:
open(filename, 'r').read()
to open the file locally rather than making an HTTP call however the
Hi,
I actually replied saying that the process dies when close(wait=0) is
done (the reply doesn't show up yet). It is not correct. The process
actually runs but ends up in zombie status (defunct).
Raghu.
--
http://mail.python.org/mailman/listinfo/python-list
I am a new learner of Python Programming Language.
Now. I am reading a book.
In the section relating to module, I see an example.
the directory tree looks like below:
root\
system1\
__init__.py
utilities.py
main.py
other.py
system2\
__init__.py
Hi !
1. Thanx for your answer in the theme of Unicode, and other things.
2. The problem:
I need to create an application that not need Python libs to install.
Py2Exe is good for that, but I need to copy the "dist" to the network
drive what mapped readonly.
This is a protection.
So: in this time
Hi !
I wrote some mails to wxPy, and this list about "wxPython and global
exception handling" theme.
I need to port my Delphi apps to wxPy, and I want to use same exception
mechanism like Delphi use.
When any exception get unhandled, the app's main cycle get it, and show
in a dialog (and I can
Hi,
While I continue to look at the problem, I thought I would post more
details. In a sense, this is more of a UNIX issue.
I have a python script that uses pexpect to spawn a child process (p1).
The python script then goes ahead and does a "tail --pid=p1". Assuming
that I do close(wait=0), P1 c
l.
>>> r = mpq(345,756)
>>> # Convert rational to floating point with 300 bits precision.
>>> # GMPY default precision is based on the nature of the rational
>>> # but can be specified. Note that prcision is in bits, not digits.
>>> f = mpf(r,300)
>>> print f
0.4563492063492063492063492063492063492063492063492063492063492063492063
I've been reading the beloved Paul Graham's "Hackers and Painters".
He claims he developed a web app at light speed using Lisp and lots
of macros.
It got me curious if Lisp
is inherently faster to develop complex apps in. It would seem if you
could create your own language in Lisp using macros th
> Well, his Viaweb company was founded in about '95, right? So he probably just
> used Lisp because Python wasn't as well known yet. ;-)
David
That is what I thought too. It makes sense but I wasn't sure. Still
ain't.
The problem is that questions like 'What lang is fastest to develop
in?'
are
the actual.
So if possible, I want to "protect users from this effect".
Is anyone can help me ?
Thanx for it: ft
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
ht
t I don't know it is working or not
Thanx: ft
>
> Tárgy:
> Re: Python exception hook simple example needed
> Feladó:
> Benji York <[EMAIL PROTECTED]>
> Dátum:
> Tue, 05 Jul 2005 10:34:23 -0400
> Címzett:
> python-list@python.org
>
> Címzett:
> python
Raymond Hettinger wrote:
> [Terry Hancock]
> > > Needless to say, the conventional floating point numbers in Python
> > > are actually stored as *binary*, which is why there is a "decimal"
> > > module (which is new).
> > >
> > > If you're going to be converting between bases anyway, it probably
You can calculate the offset of where you are like this:
[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.
py> impo
t be
using p=22?
>
> The number 17 does not just pop-out of a simple logarithm.
It most certainly does
>>> print floor(math.log10(10247448370872319)) + 1
17.0
> How many
> internal digits of precision do you need for convert(math.pi, b=16,
> p=5)?
I think I would need 7
Hello,
How do i print values returned by Py_BuildValue in Linux?
PyObject *obj = Py_BuildValue("{s:i}", "Status", status);
I need to print the Status value here
-Thanks,
Ashton
--
http://mail.python.org/mailman/listinfo/python-list
> In the past I have created .bat wrapper files that just call the python
> interpreter, but it is a bit tedious to have to create a matching .bat
> file for every script. So I came up with the following approach...
>
I frequently use a batch file wrapper. Typically it has a long
friendly name
I used to use Snakespell from scriptfoundry to do spellchecking on my
website (www.peterbe.com/search?q=pyton) but now that I've moved server
and wiped the old machine I forgot to take with me the Snakespell code.
www.scriptfoundry.com where it used to live seems to have expired.
Does anybody kno
Tried that. They don't store the .tar.gz file. It becomes a blank page.
--
http://mail.python.org/mailman/listinfo/python-list
>
> Where I work, we receive large quantities of data which is currently
> all printed on large, obsolete, dot matrix printers. This is a problem
> because the replacement parts will not be available for much longer.
>
> So I'm trying to create a program which will capture the fixed width
> text
My shot would be to test it like this on your platform like this:
#!/usr/bin/env python
import datetime, time
t1 = datetime.datetime.now()
for i in [str(x) for x in range(100)]:
if int(i) == i:
i + 1
t2 = datetime.datetime.now()
print t2 - t1
for i in [str(x) for x in range
These methods are documanted here:
http://docs.python.org/ref/customization.html
--
http://mail.python.org/mailman/listinfo/python-list
"Use the source, Luke"
dict_richcompare:
http://fisheye.cenqua.com/viewrep/python/python/dist/src/Objects/dictobject.c?r=2.165#l1510
dict_compare:
http://fisheye.cenqua.com/viewrep/python/python/dist/src/Objects/dictobject.c?r=2.165#l1425
/Simon
--
http://mail.python.org/mailman/listinfo/pytho
I am using this function to parse data I have stored in an array.
This is what the array looks like:
[['Memory', '0', 'Summary', '0'], ['Memory', '0', 'Speed',
'PC3200U-30330'], ['Memory', '0', 'Type', 'DDR SDRAM'], ['Memory', '0',
'Size', '512'], ['Memory', '0', 'Slot', 'DIMM0/J11'], ['Memory',
Hi,
I'm a beginner, and what I want to accomplish is this:
1. For all files under several folders, do some processing (using an
existing program). The program will output one line of text for each
file.
2. Store the output of all files in one file.
It would be great if someone can give me a cr
Hi Pythonistas,
Here's my problem: I'm using a version of MOOX Firefox
(http://moox.ws/tech/mozilla/) that's been modified to run completely
from a USB Stick. It works fine, except when I install or uninstall an
extension, in which case I then have to physically edit the compreg.dat
file in my pro
Hi,
I'm trying to make a decent .pycheckrc for our project and have
stumbled on a few issues. (the pychecker-list would have seemed like
the appropriate place, but the S/N ratio seemed very low with all the
spam)
- for various reasons we decided to add an attribute to a module in the
stdlib, lets
Thanks for all the help, I'm not sure what approach I'm going to try
but I think I'll try all of your suggestions and see which one fits
best.
The variable "i" held the following array:
[['Memory', '0', 'Summary', '0'], ['Memory', '0', 'Speed',
'PC3200U-30330'], ['Memory', '0', 'Type', 'DDR SDRAM
Hi,
I want to append one (huge) file to another (huge) file. The current
way I'm doing it is to do something like:
infile = open (infilename, 'r')
filestr = infile.read()
outfile = open(outfilename, 'a')
outfile.write(filestr)
I wonder if there is a more efficient way doing this?
Thanks.
--
h
Hi all,
I am trying to write a small program to view VLSI mask layouts.
I am trying to display polygons with different *transparent* patterns.
How can I do this in wxPython. Can you please give me some pointers if
some application has already done this.
Look at the images in these web pages. I
Hi,
I want to accept the user's answer yes or no.
If I do this:
answer = input('y or n?')
and type y on the keyboard, python complains
Traceback (most recent call last):
File "", line 1, in ?
File "", line 0, in ?
NameError: name 'y' is not defined
It seems like input only accepts numerals
Thanks for the nice suggestions!
As a side question, you mentioned opening files in binary mode, in case
the code needs to run under Windows or cross-platform. What would
happen otherwise? Is it an issue of big little endian or some other
issue?
--
http://mail.python.org/mailman/listinfo/pytho
Hello,
First I'm not so clear about your problem, but you can do the following
steps:
1. Transform your file into list (list1)
2. Use regex to capture 'robert' in every member of list1 and add to
list2
3. Transform your list2 into a file
pujo
--
http://mail.python.org/mailman/listinfo/python-
thanks for the comments + help.
i think i got it working, although it's not pretty:
##
import os
import re
theRegEx = '.*abs:.*\.*.'
p = re.compile(theRegEx, re.IGNORECASE)
fileToSearch = 'compreg.dat'
print "File to perform search-and-replace on: " + fileToSea
Steven D'Aprano wrote:
> hex() of an int appears to return lowercase hex digits, and hex() of a
> long uppercase.
>
> >>> hex(75)
> '0x4b'
> >>> hex(75*256**4)
> '0x4BL'
>
> By accident or design? Apart from the aesthetic value that lowercase hex
> digits are ugly, should we care?
No, ju
I ended up using this code to solve my problem.
> for a, b, c, d in s:
> if not query.has_key((a,b)): query[(a,b)] = []
>query[(a,b)].append("%s=%s" % (c, d))
> for (a,b), v in query.items():
>print a, b, ", ".join(v)
I'm relatively new to python/programming in general. I usually writ
Can anybody provide a mirror for this module? The original URL seems to
be down. I have been looking for over an hour, and every single
resource that uses it links to the timo-tasi.org site to download it.
Thanks!
Scott Kilpatrick
--
http://mail.python.org/mailman/listinfo/python-list
rbt wrote:
> Say I have a list that has 3 letters in it:
>
> ['a', 'b', 'c']
>
> I want to print all the possible 4 digit combinations of those 3
> letters:
>
> 4^3 = 64
Should be 3**4 = 81.
>
>
> abaa
> aaba
> aaab
> acaa
> aaca
> aaac
> ...
>
> What is the most efficient way to do this?
Unfortunately I am stuck with Python 2.2 (I don't think the sysadmins
like me), so that's not an option. Thanks though.
Scott
--
http://mail.python.org/mailman/listinfo/python-list
Wow that is pretty stupid of me. Yeah I was searching "python
timeoutsocket.py" and that doesn't give any good results :P Thanks
guys!
Scott
--
http://mail.python.org/mailman/listinfo/python-list
Walter Brunswick wrote:
> Is there any way to [efficiently] iterate through a sequence of characters to
> find N [or more] consecutive equivalent characters?
>
> So, for example, the string "taaypiqee88adbbba" would return 1 if the number
> (of consequtive characters) supplied in the parameters
i remember freezing a python console app i wrote some time ago using
the mcmillan installer (kinda like py2exe) and was surprised to
discover that binaries dragged and dropped onto the .exe file were
handled properly as args...making a kind of no-gui drag and drop...
how about a no-gui drag and dr
>jay graves wrote:
>> see StringIO or cStringIO in the standard library.
> Just as with files, iterating over them returns whole lines, which is
> unfortunately not what I want.
Then why not subclass it and alter the iteration scheme to do a read(1)
or something?
from StringIO import StringIO
Here is a cStringIO based version:
class FrankenString:
def __init__(self,string=None):
self.str = StringIO(string)
self.atEnd = False
self.lastidx = 0
self.seek = self.str.seek
self.tell = self.str.tell
well that appears to have been munged up ...
that tell() belongs immediately after self.str. making it
self.str.tell()
class FrankenString:
def __init__(self,string=None):
self.str = StringIO(string)
self.atEnd = False
self.lastidx = 0
self.seek = self.str.seek
My Python script is basically glue for a lot of batch files and
whatnot, so it uses os.system liberally. However, there is a strange
problem where the scripts called by os.system do not function correctly
in the Python code, but work fine when I simply copy and paste the
command into the shell myse
I've seen both documentation for using timeit as simply a timer to
measure preformance, but also a random page here and there that looked
to me as if they were using it as a simple timer. HOwever, if there is
a wxwidget timer I'll gladly hit that up. Thanks for the info
--
http://mail.python.or
Oops, yeah I should have mentioned some of that. It's a Linux
environment, and it's running Python 2.2. To my knowledge, the batch
files my program calls run a few processes on some data and generate a
few temporary files. I believe those files are not correctly being
generated. There is an error m
I've noticed that the listings in help don't take you to correct topic.
anyone else have this problem? Is there a fix?
--
http://mail.python.org/mailman/listinfo/python-list
I have a script that I cycle through nodes connect to them and run
uptime to get some information. I run the script as root so it doesn't
require a password on the rest of the nodes. It does however barf on
the nodes that are having trouble and require a different password. Is
there an easy way
urllib2.urlopen()
--
http://mail.python.org/mailman/listinfo/python-list
In general, it is good idea to use expect kind of tool to deal with
interactive programs like ssh. You may try using pexpect
(http://pexpect.sourceforge.net).
--
http://mail.python.org/mailman/listinfo/python-list
Hi, everyone,
I'm a newbie in python.
Does someone have experience about how to install python on IRIX ? I
have tried several times but without success.
"./configure" and "make" are both ok, but got errors when I run "make
test".
Thanks in advance.
--
http://mail.python.org/mailman/listinf
I want to have the python equivalent function of this
(that checks email format)
function CheckEmail($Email = "") {
if (ereg("[[:alnum:[EMAIL PROTECTED]:alnum:]]+\.[[:alnum:]]+",
$Email)) {
return true;
} els
try to check your definition of your function, self is usually used
inside a class.
pujo
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the help, this gives me a few options. I think the best way
to do it is using the public/private key authentication.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the help, this gives me a few options. I think the best way
to do it is using the public/private key authentication.
thanks
--
http://mail.python.org/mailman/listinfo/python-list
does it matter? Have it key off both "\x96" and "-".
--
http://mail.python.org/mailman/listinfo/python-list
A lot of people swear by WingIDE and as an IDE I think it's the best
one there is. (Personally I prefer jed or xjed but that's because I
like to work that way)
--
http://mail.python.org/mailman/listinfo/python-list
In a text that contains references to numbers like this: #583 I want to
find them with a regular expression but I'm having problems with the
hash. Hopefully this code explains where I'm stuck:
>>> import re
>>> re.compile(r'\b(\d\d\d)\b').findall('#123 x (#234) or:#456 #6789')
['123', '234', '456'
Thank you! That solved my problem.
--
http://mail.python.org/mailman/listinfo/python-list
Hi !
Is anyone know about a DB form generator unit under wxPython ?
What that's means ?
I add information about a Query, or a ListOfDict, I set some other infos
(Lookups, others), and it is generate a Form with edit boxes, listboxes,
etc.
Then I can fill up the form with a record's datas. User
Hello All,
I thought it would make sense to write up some of my experiences with
python based web frameworks:
http://www.personal.psu.edu/staff/i/u/iua1/python_reviews.html
best,
Istvan.
--
http://mail.python.org/mailman/listinfo/python-list
I haven't had a change to check it out, but www.guruishcool.com has a
python certificate.
--
http://mail.python.org/mailman/listinfo/python-list
I have not used Nevow but I have seen a few examples of how it works
and I kept track of it over the years.
It used to be very similar to how Cheetah or ZPT does its job. You had
a template, and you filled it with data to produce an output. It seems
that it has now more features such a form submis
> It seems to me that you really never tracked Nevow, your information is
> very incomplete. I think you should complete it before talking about Nevow
I think you should take what you posted above and put it up on your
main site, because right now there is no way to find any information
like this
> don't see why this would have problems 'scaling' or would be
> more difficult to visualise than a the equivalent tag soup html.
I think the difficulties will arise from the inability to visually
track closing tags.
]]] versus
> Templating engines like ZPT prefer to put some code in the templat
I think the lesson there is 'dont depend on getopt, write your own
command line parser'. I always write my own, as it's so easy to do.
--
http://mail.python.org/mailman/listinfo/python-list
rewrite the server to bake a /lastmsg/ folder with the last message in
it. otherwise, my only suggestion is to use another protocol instead of
http.
--
http://mail.python.org/mailman/listinfo/python-list
Chris, How would a wireless router show a signal to noise ratio?
Especially if it's providing the signal?
--
http://mail.python.org/mailman/listinfo/python-list
hi
i bassically need it cuz i am appyling to colleges this year and
i know this kind of stuff really helps.
besides since i am learning python i thought i might get some credit
for it as well.
its bassically for a mention in my resume/bio-data/appliccation
i am willing to spend about $50-100 but an
Dieter Raber wrote:
> Hi there,
>
> I am wondering if there is a mod_python for the above configuration. I
> downloaded mod_python-3.1.3.win32-py2.3.exe, which of course as the
> name implies keeps on asking me for a python 2.3 installation. I
> imagine one could cheat a little bit with a fake regi
Hi,
I want to use octave to read a file and do some matrix operation. My
question is, how do I do it inside my python script? Also, can I write
octave line by line in python without having to write the octave code
in another script and then call it in the python script?
Thanks in advance
--
yup. that's exactly what i did, on win2k...
somehow, i was surprised that it would work - the filepath + file name
from the binary i'd dragged and dropped onto the .exe file was properly
passed to the frozen python script as an arg...
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Can someone tell me the difference between single quote and double
quote?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
yeah
i figured that since i can't get a certificate i'll make a program and
put it on source forge.
thanks for all your input.
btw. your right i have absolutly no idea what i was getting into but
then again thats whats these groups are for...to ask right???
--
http://mail.python.org/mailman/lis
Jan Danielsson wrote:
> Hello all,
>
>I have written a simple whiteboard application. In my application, I
> want to be able to set draw attributes. This part works. I have a
> dictionary object which contains stuff like:
> self.attr['Pen.Color'] = ...
> self.attr['Pen.Thickness'] = ...
>
>
Hi, I have a question for the experts of Python for series60!
When I use the ".connect" method of the socket, a list with all
connection available pop-up, and, after selecting one, the soft go on.
My question is that: Can i use the ".connect" method passing connection
name, resulting in a connect
I don't think there is direct method. On Linux you can inspect file
/proc/cpuinfo to determine the installed cpus.
--
http://mail.python.org/mailman/listinfo/python-list
Yeah i have already asked it, but, i think i can set before the
.connect method, a connection as default, and, when connected, resore
default connection!
Peter Hansen ha scritto:
> [EMAIL PROTECTED] wrote:
> > Hi, I have a question for the experts of Python for series60!
> >
>
601 - 700 of 4915 matches
Mail list logo