Hello to all Python fiddlers and hackers!
I thought I would send a short notice on this list about my
Python training course offering.
If you or people in your company would be interested in getting
professional on-site Python training, I'm offering a 3-day
intensive course on the Python language
Serge Orlov 写道:
> Bo Yang wrote:
>
>> Hi ,
>> Recently I use python's urllib2 write a small script to login our
>> university gateway .
>> Usually , I must login into the gateway in order to surf the web . So ,
>> every time I
>> start my computer , it is my first thing to do that open a browser
Aleksandar Cikota schrieb:
> Can someone translate the VB code to Python?
>
> VB code:
>
> Dim chsr as New DriverHelper.Chooser
> chsr.DeviceType = "Telescope"
> scopeProgID = chsr.Choose(scopeProgID)
> Set scope = CreateObject(scopeProgID)
> scope.Connected = True
>
(untested; late binding):
Tim,
After a little more research, I did find that out. It is funny, but in
the tutorial "Non-Programmers Tutorial For Python", it makes no mention
of the indentation issue, at least in the beginning portions which I had
read.
This is an age old problem of learning. Once you know something,
"Ralph H. Stoos Jr." <[EMAIL PROTECTED]> wrote:
>
>I am reading a Python tutorial for complete non-programmers.
>
>The code below is so simple as to be insulting but the assignment of the
>"ready" variable gives a syntax error.
>
>The code reads letter-for-letter like the tutorial states.
Letter
Thanks for the suggestions.
The solution I liked most was to prevent the lines from appearing in
the first place!!
--
http://mail.python.org/mailman/listinfo/python-list
Welcome to Python! :-)
You may find this mailing list useful:
http://mail.python.org/mailman/listinfo/tutor
--
http://mail.python.org/mailman/listinfo/python-list
The indentation is wrong. Python cares about indentation.
print " "
print "This \"autotp\" program will create raw bitmap test pattern
images."
print " "
print "Please read the information below thoroughly:"
print " "
print "1. Graphic files MUST be TIFF images."
print "2. Images MUST have been
On 15/04/2006 12:04 PM, Ralph H. Stoos Jr. wrote:
> All,
>
> I am reading a Python tutorial for complete non-programmers.
Would you mind providing a URL for the tutorial? It's vaguely possible
that we may be able to recommend a slightly better tutorial :-)
>
> The code below is so simple as to
"Ralph H. Stoos Jr." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> HELP PLEASE: What is wrong with this?File "autotp.py", line 21
> ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ")
> ^
Probably the parenthesis you forgot to close on the preceding line ...
C
File "autotp.py", line 21
ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ")
^
--
http://mail.python.org/mailman/listinfo/python-list
All,
I am reading a Python tutorial for complete non-programmers.
The code below is so simple as to be insulting but the assignment of the
"ready" variable gives a syntax error.
The code reads letter-for-letter like the tutorial states.
Here is a dump. Can anyone tell me what is wrong?
*
On Fri, 14 Apr 2006 16:59:13 -0700, fatalserpent wrote:
> Here is the basic code (yes, I know its tiny).
>
> x = ['print "x =", x', 'for m in x: print m']
> print "x =", x
> for m in x: print m
>
> I want to modify this so it will output to a file called 1. What I want
> is to have that file dir
[EMAIL PROTECTED] wrote:
> Hi,
> I want to pass something like this to a C function via the Python C
> API.
> mytuple = (("string_one", 1.2, 1.3), ("string_two", 1.4, 1.5), ..,
> ., )
> This tuple is dynamic in size, it needs to be 3 X N dimensions. each
> tuple in the
> tuple array is of
david brochu jr wrote:
> Thanks,
>
> Unfortunately substituting os.system with os.popen results in the output
> being:
>
> http://www.google.com/>
> ', mode 'r' at 0x009C4650>
> http://www.boston.com/>
> ', mode 'r' at 0x009C4650>
> http://www.espn.com/>
> ', mode 'r' at 0x009C4650>
> http://www
Title: Message
Try
this:
import
os
pinginfo=os.popen("ping www.google.com")
#opens
file object with output of the ping to google
print
pinginfo.read(-1)
#reads
the ping information from the abuv file object
pinginfo.close()
#closes the pinginfo object, as you would do for a standard file
Steven D'Aprano wrote:
> I came across an interesting (as in the Chinese curse) problem today. I
> had to modify a piece of code using generator expressions written with
> Python 2.4 in mind to run under version 2.3, but I wanted the code to
> continue to use the generator expression if possible.
>
On Apr 14, 2006, at 8:04 PM, david brochu jr wrote:
> Thanks,
>
> Unfortunately substituting os.system with os.popen results in the
> output being:
>
> ', mode 'r' at 0x009C4650>
> ', mode 'r' at 0x009C4650>
> ', mode 'r' at 0x009C4650>
> ', mode 'r' at 0x009C4650>
>
> instead of giving me
flamesrock wrote:
> Kind of a fun but confusing problem...
>
> I have two lists. Each list contains elements of two-element lists.
> l1 = [['c1',1],['c2',2],['c3',4]]
> l2 = [['c1',1],['c2',2],['c4',4],['c3',3]]
>
> Exactly in this format, where
> superlist[0][0] is always a string
> superlist[0]
Steven Bethard wrote:
> Steven Bethard wrote:
>
>>Tim Hochberg wrote:
>>
>>>Steven Bethard wrote:
>>>
Steven Bethard wrote:
>Duncan Booth wrote:
>
>>make Element html:
>> make Element body:
>> make Element p:
>> text('But this ')
>>
Thanks,
Unfortunately substituting os.system with os.popen results in the output being:
www.google.com', mode 'r' at 0x009C4650>
www.boston.com', mode 'r' at 0x009C4650> www.espn.com', mode 'r' at 0x009C4650>
www.redsox.com', mode 'r' at 0x009C4650>
instead of giving me the ping stats "pinging
Here is the basic code (yes, I know its tiny).
x = ['print "x =", x', 'for m in x: print m']
print "x =", x
for m in x: print m
I want to modify this so it will output to a file called 1. What I want
is to have that file direct its output to a file called 2 and 2 direct
to 3 and so on. Hopefully
fyleow wrote:
> Hi guys,
>
> I'm a student/hobbyist programmer interested in creating a web project.
> It's nothing too complicated, I would like to get data from an RSS
> feed and store that into a database. I want my website to get the
> information from the database and display parts of it dep
Hi,
I want to pass something like this to a C function via the Python C
API.
mytuple = (("string_one", 1.2, 1.3), ("string_two", 1.4, 1.5), ..,
., )
This tuple is dynamic in size, it needs to be 3 X N dimensions. each
tuple in the
tuple array is of the form (string, float, float) as descri
Em Sex, 2006-04-14 às 15:43 -0700, flamesrock escreveu:
> Does anyone have a simple solution
$ python2.4
Python 2.4.3 (#2, Mar 30 2006, 21:52:26)
[GCC 4.0.3 (Debian 4.0.3-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> l1 = [['c1',1],['c2',2],['c3',4]]
"fyleow" <[EMAIL PROTECTED]> wrote :
> I realize that learning the library is part of the process, but as a
> beginner I appreciate simplicity.
> Is Python easier than C#?
Absolutely.
> Can someone show how to access an XML document on the web and have it
ready
> to be manipulated for comparis
On Apr 14, 2006, at 6:30 PM, david brochu jr wrote:
> I am trying to ping websites and output the results to a txt file:
>
> import os
>
> file = open("c:\python24\scripts\ip.txt")
> redirect = open("c:\python24\scripts\log.txt","a")
>
> for x in file:
> ping = "ping " + x
> print >> redirect,
Kind of a fun but confusing problem...
I have two lists. Each list contains elements of two-element lists.
l1 = [['c1',1],['c2',2],['c3',4]]
l2 = [['c1',1],['c2',2],['c4',4],['c3',3]]
Exactly in this format, where
superlist[0][0] is always a string
superlist[0][1] is always an integer
Now what I
>> I'll try from C: but.
Definitely do that. None of the .msi installers are working for me from
any drive except C. Been that way for months.
Here's some helpful tips from an ActiveState email of a few months
back. Note especially that you need version 2.0 or greater of the
installer:
Here
I am trying to ping websites and output the results to a txt file:
import os
file = open("c:\python24\scripts\ip.txt")redirect = open("c:\python24\scripts\log.txt","a")
for x in file: ping = "ping " + x print >> redirect, os.system(ping)
but the results seen in the log.txt file are:
Hi all,
Can someone translate the VB code to Python?
VB code:
Dim chsr as New DriverHelper.Chooser
chsr.DeviceType = "Telescope"
scopeProgID = chsr.Choose(scopeProgID)
Set scope = CreateObject(scopeProgID)
scope.Connected = True
For your prompt reply, I say thank you in advance.
Best regards
[EMAIL PROTECTED] wrote:
> Hi All,
> I'm trying to write a news retrieval client in python.
> I'm going to get the news from google's news service.
> However, when I run the following code, google gives me a 403 error.
Knowing google, they're blocking the user agent supplied by urllib2.
--
http:/
First of all, let me tell you that you can now write apps for .NET with
Python.
There's a python implementation for the .NET framework called
Ironpython (in beta 5 now).
Regarding XML, I can't tell you much but in general, python is much
easier, cleaner, concise and intuitive than all the other al
This is very helpful.
I wasn't the OP. I'm just learning, but I'm on the verge of making my
own file searching scripts. This will be a huge help. Thanks for
posting, and especially thanks for the comments in the code. Big help!
rick
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
"Thomas Bartkus" <[EMAIL PROTECTED]> wrote:
>Your function 'a' is it's own little world where functions 'b' and 'c'
>exist.
>Your code inside 'a' can call 'b' or 'c' - neat as you please.
>
>BUT 'b' and 'c' simply do not exist outside the 'a' world.
It's worth dis
I'll take a look,
thanks.
Jay Parlar wrote:
>
> On Apr 14, 2006, at 9:44 AM, Philippe Martin wrote:
>
>> Thanks,
>>
>> It's a pretty big structure: painfull to pass each item as a param.
>>
>> Regards,
>>
>> Philippe
>>
>
> Maybe this can do something for you?
>
> http://pyconstruct.source
I misslead you: it is a smart card-style ioctl ...
Philippe
"Martin v. Löwis" wrote:
> Philippe Martin wrote:
>> The call actually is an IOCtl: depending on the control code, the
>> structure has a different format.
>
> Ah. In that case, I recommend to use the ioctl module; you won't need a
>
Steven Bethard wrote:
> Tim Hochberg wrote:
>> Steven Bethard wrote:
>>> Steven Bethard wrote:
Duncan Booth wrote:
> make Element html:
>make Element body:
>make Element p:
>text('But this ')
>make Element strong:
> te
I'm trying to learn about Python and XML. I would like to be able to
add standalone="no" to my xml declaration when writing an xml file, but
I am unable to figure out how. So far, I have the following code:
import xml.dom.minidom
doc2 = xml.dom.minidom.Document()
print doc2.toxml('iso-8859-1')
Hi guys,
I'm a student/hobbyist programmer interested in creating a web project.
It's nothing too complicated, I would like to get data from an RSS
feed and store that into a database. I want my website to get the
information from the database and display parts of it depending on the
criteria I
Hi,What chunk sizes do you normally use in your code?Thank You.On 4/14/06, Amit Khemka <[EMAIL PROTECTED]
> wrote:On 4/14/06, Rajesh Sathyamoorthy <
[EMAIL PROTECTED]> wrote:> Hi,>> I wanted to know why it is more efficient to read a file in smaller chunks (> using file() or open() )? If this is no
BartlebyScrivener wrote:
> That's it. Thank you! Very instructive.
>
> Final:
>
> path = "d:/emacs files/emacsinit.txt"
> lines = open(path).readlines()
> # next two lines all on one
> starts = [i for i, line in enumerate(lines) if
> line.startswith('(defun')]
> for i, start in enumerate(starts):
Felipe Almeida Lessa schrieb:
> Em Sex, 2006-04-14 às 20:33 +0200, Diez B. Roggisch escreveu:
>> def read_lines(inFile):
>> fg = iter(inFile)
>> for line in fg:
>> if "pmos4_highv" in line:
>> fg.next()
>> else:
>> yield line
>
> Just be aware
Egon Frerich wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> What do you have in the IDLE options - General - Default source encoding?
UTF-8
>
> Egon
>
> Kent Johnson schrieb am 12.04.2006 12:40:
>
>> [EMAIL PROTECTED] wrote:
>>> Hello again, I've investigated a little bit and th
Tim Hochberg wrote:
> Steven Bethard wrote:
>> Steven Bethard wrote:
>>> Duncan Booth wrote:
make Element html:
make Element body:
make Element p:
text('But this ')
make Element strong:
text('could')
text(
Duncan Booth wrote:
> Looking in the 'obvious' place in the Tutorial, section 5.1 'More on
> Lists' I found in the immediately following section 5.2 'The del
> statement':
I read the tutorial 6 years ago, and don't read it regularly. What's in
the tutorial is not really important, what can be eas
Steven Bethard wrote:
> Steven Bethard wrote:
>
>>Duncan Booth wrote:
>>
>>>Steven Bethard wrote:
>>>
>>>
Should users of the make statement be able to determine in which dict
object the code is executed? The make statement could look for a
``__make_dict__`` attribute and call it to a
Rob Williscroft wrote:
> Steven Bethard wrote in news:[EMAIL PROTECTED]
> in comp.lang.python:
>
>> Open Issues
>> ===
>>
>> Does the ``make`` keyword break too much code? Originally, the make
>> statement used the keyword ``create`` (a suggestion due to Nick
>> Coghlan). However, inves
Hi All,
I'm trying to write a news retrieval client in python.
I'm going to get the news from google's news service.
However, when I run the following code, google gives me a 403 error.
Is it google, or urllib2? Or is it the code?
I can parse the 'contents' variable, I just need to know what is goi
Philippe Martin wrote:
> The call actually is an IOCtl: depending on the control code, the structure
> has a different format.
Ah. In that case, I recommend to use the ioctl module; you won't need a
C wrapper, then.
> Although the number of control codes/structures is finite, it would make the
>
On Apr 14, 2006, at 9:44 AM, Philippe Martin wrote:
> Thanks,
>
> It's a pretty big structure: painfull to pass each item as a param.
>
> Regards,
>
> Philippe
>
Maybe this can do something for you?
http://pyconstruct.sourceforge.net/
Jay P.
--
http://mail.python.org/mailman/listinfo/python
On Sat, Apr 15, 2006 at 04:04:44AM +1000, Steven D'Aprano wrote:
> I came across an interesting (as in the Chinese curse) problem today. I
> had to modify a piece of code using generator expressions written with
> Python 2.4 in mind to run under version 2.3, but I wanted the code to
> continue to u
Em Sex, 2006-04-14 às 13:37 -0500, Robert Kern escreveu:
> Felipe Almeida Lessa wrote:
> > Em Sex, 2006-04-14 às 13:28 -0500, Robert Kern escreveu:
> >
> >>Steven D'Aprano wrote:
> >>
> >>>I came across an interesting (as in the Chinese curse) problem today. I
> >>>had to modify a piece of code us
Em Sex, 2006-04-14 às 20:33 +0200, Diez B. Roggisch escreveu:
> def read_lines(inFile):
> fg = iter(inFile)
> for line in fg:
> if "pmos4_highv" in line:
> fg.next()
> else:
> yield line
Just be aware that the "fb.next()" line can raise an Stop
Felipe Almeida Lessa wrote:
> Em Sex, 2006-04-14 às 13:28 -0500, Robert Kern escreveu:
>
>>Steven D'Aprano wrote:
>>
>>>I came across an interesting (as in the Chinese curse) problem today. I
>>>had to modify a piece of code using generator expressions written with
>>>Python 2.4 in mind to run und
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> What techniques do others use?
I'd just write the generator with a yield statement. The generator
expression does the same thing more concisely, I think.
--
http://mail.python.org/mailman/listinfo/python-list
Em Sex, 2006-04-14 às 13:28 -0500, Robert Kern escreveu:
> Steven D'Aprano wrote:
> > I came across an interesting (as in the Chinese curse) problem today. I
> > had to modify a piece of code using generator expressions written with
> > Python 2.4 in mind to run under version 2.3, but I wanted the
Jacob Rael schrieb:
> I am new to python and I love it. I am hacking a file. I want to not
> print a line if it contains the word 'pmos4_highv'. I also don't want
> to print the next line. The following code works but it "smells bad"
> and just doesn't look right. I was reading about generators. If
Steven D'Aprano wrote:
> I came across an interesting (as in the Chinese curse) problem today. I
> had to modify a piece of code using generator expressions written with
> Python 2.4 in mind to run under version 2.3, but I wanted the code to
> continue to use the generator expression if possible.
Cool. I hope I got the bits about Kross right; I only just found out
about it from seeing your post so haven't been long learning about it
(I'm a sucker for this stuff). Hopefully some nice expert can correct
anything I may've got wrong. :)
BTW, if you're curious about how Python hooks into this s
Em Sáb, 2006-04-15 às 04:03 +1000, Steven D'Aprano escreveu:
> Sometimes you want the default to mutate each time it is used, for example
> that is a good technique for caching a result:
>
> def fact(n, _cache=[1, 1, 2]):
> "Iterative factorial with a cache."
> try:
> return _cache
Hi Arne
On 2006-04-12 18:05, Arne wrote:
> I am working on Windows XP and I want to do the following:
>
> 1. Connecting to a server using ftp
> 2. Getting the directory structure and the size of each directory in the
> root
> 3. Getting the owner of a file
>
> All these steps I want to do with
BartlebyScrivener wrote:
>>>Not sure if the .msi installers were broken before,
>>>but they are now (on this installation)
>
>
> Are you installing from c:\ ?
almost never
>
> With administrator rights?
>
pretty sure "YES"
> Check other requirements. It chokes if you are installing from anothe
I am new to python and I love it. I am hacking a file. I want to not
print a line if it contains the word 'pmos4_highv'. I also don't want
to print the next line. The following code works but it "smells bad"
and just doesn't look right. I was reading about generators. If I was
using one, I could do
I came across an interesting (as in the Chinese curse) problem today. I
had to modify a piece of code using generator expressions written with
Python 2.4 in mind to run under version 2.3, but I wanted the code to
continue to use the generator expression if possible.
My first approach was to use a
On Fri, 14 Apr 2006 13:30:49 -0300, Felipe Almeida Lessa wrote:
> Em Sex, 2006-04-14 às 09:18 -0700, wietse escreveu:
>> def __init__(self, name, collection=[]):
>
> Never, ever, use the default as a list.
Unless you want to use the default as a list.
Sometimes you want the default to mutat
This is new to me. I did not know that emacs HAD a word star mode.
I may have to look at emacs again (last time was 1995).
I am still looking for a python editor I like. Yes I used to write asm
code in
wordstar in nondocument mode. And yes all of the old dos editors used
the wordstar keys. Eve
[EMAIL PROTECTED] wrote:
> If I try to print a negative integer as a hexadecimal, I get the
> following error:
print "%X" % -1
> __main__:1: FutureWarning: %u/%o/%x/%X of negative int will return a
> signed string in Python 2.4 and up
>
>
> Does that mean that in the future it will
Well,
The call actually is an IOCtl: depending on the control code, the structure
has a different format.
Although the number of control codes/structures is finite, it would make the
wrapper function fairly large.
You seem to think that building the structure from python would be a
mistake: why
Szabolcs Berecz wrote:
> On 14 Apr 2006 04:37:54 -0700, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
>
>>def a():
>> def b():
>>print "b"
>> def c():
>>print "c"
>>
>>how can i call c() ??
>
>
> Function c() is not meant to be called from outside function a().
> That's what a nested
>> Not sure if the .msi installers were broken before,
>> but they are now (on this installation)
Are you installing from c:\ ?
With administrator rights?
Check other requirements. It chokes if you are installing from another
logical drive, e.g., d:\
http://aspn.activestate.com/ASPN/docs/Active
Philippe Martin wrote:
> It's a pretty big structure: painfull to pass each item as a param.
So how else would you like to pass them? Define the API you want,
and then just implement it. It still shouldn't require to define
the layout in Python.
Regards,
Martin
--
http://mail.python.org/mailman/
Felipe Almeida Lessa wrote:
> Em Sex, 2006-04-14 às 09:31 -0600, Steven Bethard escreveu:
>> [1] Here's the code I used to test it.
>>
>> >>> def make(callable, name, args, block_string):
>> ... try:
>> ... make_dict = callable.__make_dict__
>> ... except AttributeError:
>> ...
Paul Rubin wrote:
> [EMAIL PROTECTED] writes:
> > Here's my question: Suppose a form has more than one submit button.
> > Now the COM 'form' object has a 'submit' method that doesn't take any
> > arguments, so how do I tell it which button I want to press?
>
> What difference does it make? Don'
Steven Bethard wrote in news:[EMAIL PROTECTED]
in comp.lang.python:
> Open Issues
> ===
>
> Does the ``make`` keyword break too much code? Originally, the make
> statement used the keyword ``create`` (a suggestion due to Nick
> Coghlan). However, investigations into the standard librar
Thanks,
It's a pretty big structure: painfull to pass each item as a param.
Regards,
Philippe
"Martin v. Löwis" wrote:
> Philippe Martin wrote:
>> Is it possible to define a packed C structure in python and pass it to
>> the c module, or should the wrapper do that ?
>
> You can create a pack
Em Sex, 2006-04-14 às 13:30 -0300, Felipe Almeida Lessa escreveu:
> To solve your problem, change
> def __init__(self, name, collection=[]):
> BaseClass.__init__(self)
> self.name = name
> self.collection = collection # Will reuse the list
> to
> def __init__(self,
Em Sex, 2006-04-14 às 09:18 -0700, wietse escreveu:
> def __init__(self, name, collection=[]):
Never, ever, use the default as a list.
> self.collection = collection
This will just make a reference of self.collection to the collection
argument.
> inst.collection.append(i)
A
Some time ago I bought a newer computer with W2000 already on it so I moved my
old drive
to it as secondary( python was installed on non primary partition ).
Not sure if the .msi installers were broken before, but they are now (on this
installation)
and the reason I can't move to brand new instal
That's it. Thank you! Very instructive.
Final:
path = "d:/emacs files/emacsinit.txt"
lines = open(path).readlines()
# next two lines all on one
starts = [i for i, line in enumerate(lines) if
line.startswith('(defun')]
for i, start in enumerate(starts):
while start > 0 and lines[start-1].start
Philippe Martin wrote:
> Is it possible to define a packed C structure in python and pass it to the c
> module, or should the wrapper do that ?
You can create a packed structure using string concatenation, and with
the help of the struct module. However, this gives you a string object
in the end,
Hello,
I have written the following script to illustrate a problem in my code:
class BaseClass(object):
def __init__(self):
self.collection = []
class MyClass(BaseClass):
def __init__(self, name, collection=[]):
BaseClass.__init__(self)
self.name = name
se
Hi,
Is it possible to define a packed C structure in python and pass it to the c
module, or should the wrapper do that ?
Regards,
Philippe
--
http://mail.python.org/mailman/listinfo/python-list
Raymond, I suspect we're not seeing eye to eye on this issue, but I do
appreciate you taking the time and effort. Thank you. My comments follow.
On Thu, 13 Apr 2006
09:34:46 -0700, Raymond Hettinger wrote:
> Both the pros and cons
> were quipped with abrupt perjoratives so the bullet points could
Felipe Almeida Lessa wrote:
> Em Sex, 2006-04-14 às 09:31 -0600, Steven Bethard escreveu:
>> [1] Here's the code I used to test it.
>>
>> >>> def make(callable, name, args, block_string):
>> ... try:
>> ... make_dict = callable.__make_dict__
>> ... except AttributeError:
>>
I'm trying to learn about Python and XML. I would like to be able
to add standalone="no" to my xml declaration when writing an xml file,
but I am unable to figure out how. So far, I have the following
code:
import xml.dom.minidom
doc2 = xml.dom.minidom.Document()
print doc2.toxml('iso-8859-1')
BartlebyScrivener wrote:
> Kent,
>
> Running
>
> path = "d:/emacs files/emacsinit.txt"
> lines = open(path).readlines()
> # my defun lines are lowercase,
> # next two lines are all on one
> starts = [i for i, line in enumerate(lines) if
> line.startswith('(defun')]
> for i, start in starts:
>
Felipe Almeida Lessa napsal(a):
>Em Sex, 2006-04-14 às 17:14 +0200, Jan Prochazka escreveu:
>
>
>>Here is my module for parsing zip files:
>>
>>
>
>1) Have you checked the source of Python's zipfile module?
>
>
Nice, i thought, that zipfile is written in C, it should be possible to
solve
Em Sex, 2006-04-14 às 09:31 -0600, Steven Bethard escreveu:
> [1] Here's the code I used to test it.
>
> >>> def make(callable, name, args, block_string):
> ... try:
> ... make_dict = callable.__make_dict__
> ... except AttributeError:
> ... make_dict = dict
> ... bloc
Yes, thanks. I was just going to reinstall anyway. That usually fixes
it.
Rick
--
http://mail.python.org/mailman/listinfo/python-list
I haven't compared them, and you may be exacly right.
Paul
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
> Duncan Booth wrote:
>> Steven Bethard wrote:
>>
>>> Should users of the make statement be able to determine in which dict
>>> object the code is executed? The make statement could look for a
>>> ``__make_dict__`` attribute and call it to allow things like::
>>>
>>> mak
[EMAIL PROTECTED]
>> what's the standard way for a "for" loop with float increments?
[Dan Sommers]
> Use a while loop instead:
>
> f = initial_value
> while f <= final_value:
> process(f)
> f = f + increment
>
> Note that there is no general guarantee that f will actually b
News wrote:
> Hi everyone,
>
> My goal is to pull command switches/options from a file and then assign
> the values to select variables which would eventually be included in a
> class object.
>
> The data file looks something like this but the switches could be in any
> order and not all may be u
Em Sex, 2006-04-14 às 17:14 +0200, Jan Prochazka escreveu:
> Here is my module for parsing zip files:
1) Have you checked the source of Python's zipfile module?
> import struct, zlib
>
> class ZipHeaderEntry:
> name = ''
> offset = 0
> uncomlen = 0
> comlen = 0
2) You know that
Michael Ekstrand napsal(a):
> Jan Prochazka wrote:
>
>> Hi,
>> I need to decompress zip archive. I wrote a parser of zip file, i obtain
>> the compressed data, but when i call zlib.decompress(data) on them,
>> it throws this error:
>>
>> decbuf = decompressor.decompress(compressed_data)
>>
>> erro
Em Sex, 2006-04-14 às 07:47 -0700, BartlebyScrivener escreveu:
> starts = [i for i, line in enumerate(lines) if
> line.startswith('(defun')]
This line makes a list of integers. enumerate gives you a generator that
yields tuples consisting of (integer, object), and by "i for i, line"
you unpack the
Kent,
Running
path = "d:/emacs files/emacsinit.txt"
lines = open(path).readlines()
# my defun lines are lowercase,
# next two lines are all on one
starts = [i for i, line in enumerate(lines) if
line.startswith('(defun')]
for i, start in starts:
while start > 0 and lines[start-1].startswith(';
Jan Prochazka wrote:
> Hi,
> I need to decompress zip archive. I wrote a parser of zip file, i obtain
> the compressed data, but when i call zlib.decompress(data) on them,
> it throws this error:
>
> decbuf = decompressor.decompress(compressed_data)
>
> error: Error -3 while decompressing: unknow
Hi,
I'm trying to embed python into an chat bot I've made in c++. After
googling around and reading docs for almost a day I have a few
questions. First of all it seems like the best way to be able to run
separate scripts in different, isolated environments is to create a
sub-interpreter (by us
1 - 100 of 158 matches
Mail list logo