How do I set the time in Python?
Also, is there any *direct* way to shift it?
Say, it's 09:00 now and Python makes it 11:30 *without* me having specified
"11:30" but only given Python the 2h30m interval.
Note that any "indirect" methods may need complicated ways to keep
track of the milliseconds
On Aug 20, 11:29 am, Chris Angelico wrote:
> If you're using a variable for the stop value, you just need to set it
> to an explicit None if it would fall negative:
>
> >>> a[10:None:-1]
>
That doesn't work if it's set in a loop or if it's calculated as a
formula. For example, this very simple co
On Aug 20, 1:40 pm, Steven D'Aprano wrote:
> Pardon me for breaking threading, but I don't have Max's original post.
Not sure why; I also can't see it! I'll copy it at the end just in
case.
> On Sat, Aug 20, 2011 at 7:20 PM, Max Moroz wrote:
> > Wou
[EMAIL PROTECTED] wrote:
> ok, i m going to use Linux for my Python Programs, mainly because i
> need to see what will these fork() and exec() do. So, can anyone tell
> me which flavour of linux i should use, some say that Debian is more
> programmer friendly, or shold i use fedora, or Solaris.
Jordan Rastrick wrote:
> I don't want to order the objects. I just want to be able to say if one
> is equal to the other.
>
> Here's the justification given:
>
> The == and != operators are not assumed to be each other's
> complement (e.g. IEEE 754 floating point numbers do not satisf
ad/d6c084e791a00
2f4?q=for+else&hl=en&
for a good explanation of when the else part of the loop is executed.
Basically, whenever the loop is exited normally, which is what happens
when you iterate over an empty list like the one returned by
range(1,1)
max
--
http://mail.python.org/mailman/listinfo/python-list
l/
http://www.pythonware.com/library/pil/handbook/
but also be sure to read the "Setting Capababilities" section of this
document:
http://twainmodule.sourceforge.net/docs/caps.html
max
--
http://mail.python.org/mailman/listinfo/python-list
s mathematical expressions
and is callable from python code.
max
--
http://mail.python.org/mailman/listinfo/python-list
isk of any hacking, or of this becoming an open relay?
--Max
--
http://mail.python.org/mailman/listinfo/python-list
The Windows XP version of Java
> at java.com is 16+ MB, and the .NET framework is, well, I don't know
> how big, but I doubt it's much less than 10MB.
>
AFAIR, it's closer to 50MB.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
tart->Run:
command.com on 95/98) and then either type the full path to the script
or navigate to it and execute it.
max
--
http://mail.python.org/mailman/listinfo/python-list
Yeah, I know. It's the price we pay for forsaking variable declarations.
But for java programmers like me, Py's scoping is too complicated.
Please explain what constitutes a block/namespace, and how to refer to
variables outside of it.
--
http://mail.python.org/mailman/listinfo/python-list
banana" is a song about
working on plantations in Jamaica). It may be more common in UK
English. There's an expression "tally-ho!" which had something to do
with British fox hunts, but they don't have those any more.
Has anyone _not_ heard Jeff Probst say, "I'l
Kent Johnson <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Here is a simple function that scans through an input file and
> groups the lines of the file into sections. Sections start with
> 'Name:' and end with a blank line. The function yields sections
> as they are found.
>
> def make
ating file from main thread...
Done
Creating file from sub thread...
Done
Has anyone got any ideas about this?
Thanks in advance,
Max
--
http://mail.python.org/mailman/listinfo/python-list
Not that I know of - the problem only seems to occur when using the Python C
API.
I'm trying to come up with a C programs that shows the error but it'll take
a few days to set up
the emvironment.
>"Jeff Epler" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
--
http://mail.python.or
YONE, it's Leo Breebart. This guys famous in the alternative
universe of alt.fan.pratchett.
You are the same Leo Breebart, right?
Well done, APF9 is excellent. But what did we expect.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
atural way of doing things, the textbook has to
kludge because its target audience is C++, Java and Pascal programmers.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
; happened to have written pizza first instead of last?
What meaning do you give to True**False?
>
> The fact that they can be counted shouldn't fool you into thinking they
> are numbers.
>
>
>
--Max
--
http://mail.python.org/mailman/listinfo/python-list
do - I haven't
tested it). It's not strictly accurate (from a scientific/UTC
perspective, as some minutes have 59 or 61 seconds rather than 60, but
it's probably the best you need.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
o they can be displayed.
>
>
> He can still store the repr of the string into the database, and then
> reconstruct it with eval:
>
Yes, but len(repr('\x00')) is 4, while len('\x00') is 1. So if he uses
BLOB his data will take almost a quarter of the space, compa
t;
Except that what is passed is not "ham['spam'][0].eggs()[42]" -
that's the *name of where one copy of the objects name is*. The
name is ham['spam'][0].eggs()[42].id() - usually something like
0xBEEFBABE.
When I fill in a form (say if I applied for a visa) - th
than 1 then I get the error. Is there a method call
that I need to restore the requestor object to a condition where it's
eligible to receive another response?
Thanks, Max
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> Max wrote:
>
> > If I run this with loops=1 then everything works fine. If I use a
> > number greater than 1 then I get the error. Is there a method call
> > that I need to restore the requestor object to a condition where it's
> > e
Metalone wrote:
>
> This might be a little too tricky.
> [" %d", "%d][n < 0] % n --> selects list[0] or list[1] based upon sign
> of number
>
("%+d" % 123).replace("+", " ") is slightly longer but instantly
comprehensible, alt
n this PC), so if I managed to do it, it must have
been in the apache docs or python docs (and I did manage).
--Max
--
http://mail.python.org/mailman/listinfo/python-list
arned it
because I had incentive (3 local monetary units in the computer
olympiad; I won 1). Is RoR incentive enough?
--Max
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Max a écrit :
(snip)
>
> RoR is not bad, but really over-hyped. There's no shortage of at least
> as good solutions in Python. You may want to look at Django, Turbogears,
> Pylons, web.py etc. for fullstack MVC frameworks.
That's what I tho
o you would
have an HTML form on the page, and on clicking a button, load the graph
(into an "iframe" or something perhaps [I have a feeling iframes have
been deprecated - check first]). In which case you'd want to look up
CGI, AJAX, etc.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
ccess ODBC), so if it can be done easily
in one of those, that'd be great, but if there's a module which makes it
a breeze, I'm happy to download that too.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
rray, which can be nice (actually I think it's the main advantage over
lists of lists):
print grid[colNo, rowNo]
>
> Claudio
--Max
--
http://mail.python.org/mailman/listinfo/python-list
Rene Pijlman wrote:
> Max <[EMAIL PROTECTED]>:
>
>>How can I print (as in laser printer, not the python print statement)
>>HTML from Python
>
>
> Is the printer attached to your server, or are you printing over the
> internet?
>
I'm not sure i
launch
attacks on other computers, and than attack my computer". Unless you
have some revolutionary ideas in code-security analysis. In which case
you can a lot more money than from implementing Everything2 in python.
> -Kirk McDonald
--Max
--
http://mail.python.org/mailman/listinfo/python-list
>
I wouldn't think so, as long as Klass doesn't have /other/ methods - as
long as it only has methods that are meant to be viewed externally.
Which would probably not be the way one would ordinarily write the
class, but if one knew one had to, one should be fine.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
ursive function to read the file, and pass the containing Style
object to it. It reads the props into the class, and recurses on any
"sub-styles".
After this, you'll have constructed a tree (keep a reference to root).
Now you can use an extension of a standard pre-order traversal to output it.
> - Dave
>
Hope this helps.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
me.
>
> Whether or not the difference is that significant though I am unsure. It
> may be small enough that for most applications no one cares.
I just wrote an application which retrieves values from a 300mb
database, and got a significant speedup using iterators.
--Max
--
http:/
later. I don't think this is good: list
comprehensions are, IMO, one of Python's great features, Psyco prefers
them, they're more pythonic, and map and filter seem to be going out the
window for Python 3000.
What do you think?
--Max
--
http://mail.python.org/mailman/listinfo/python-list
Felipe Almeida Lessa wrote:
> Em Sáb, 2006-02-18 às 14:38 +0200, Max escreveu:
>
> Urgh. This sucks. Did they mention generators, at least? Sometimes list
> comprehensions are even faster (I didn't check, but I think this one can
> be an example of this: [i*2+2 for i in iterat
Felipe Almeida Lessa wrote:
> Em Sáb, 2006-02-18 às 15:13 +0200, Max escreveu:
>
>>>I wonder if they need some updating.
>>>
>>
>>And so does Dive Into Python (our textbook, diveintopython.org) which
>>has the same deficiencies in its outline.
>
have tried to learn
Haskell, but - though I think I understand everything I read on it - I
can't get my programs to run.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
lso liked 99 Bottles in one line:
print '\n'.join(["%d bottles of beer on the wall." % i for i in
range(100,0,-1)])
--Max
--
http://mail.python.org/mailman/listinfo/python-list
Giovanni Bajo wrote:
> There are also other choices that can be made. For instance, wxWidgets is
> *HUGE*.
Indeed. Remember Tkinter is built-in. (I never got the hang of Tkinter
and prefer wx, but if size is important...)
--Max
--
http://mail.python.org/mailman/listinfo/python-list
that
it boils down to 2 things: The size and scope of gui and database
frameworks, and the fact that opinions differ about what is 'ideal'.
max
--
http://mail.python.org/mailman/listinfo/python-list
t corporations are considered people by the law is ridiculous.
Using a license that ends up doing the same thing with code leaves a
bad taste in my mouth.
max
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> On Mon, 06 Jun 2005 16:12:18 +, max wrote:
>
>> This is one thing that bothers me about the gpl. It essentially
>> tries to create 'code as a legal entity'. That is, it gives
&g
, trying to get Python to do something it's not made for. Any help/
feedback would be wonderful.
Thanks,
Max Martin
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 27, 6:35 pm, Wildemar Wildenburger
<[EMAIL PROTECTED]> wrote:
> Max wrote:
> > In GAs, you operate on a Population of solutions. Each Individual from
> > the Population is a potential solution to the problem you're
> > optimizing, and Individuals hav
> You can subclass this as needed, altering the crossover method as necessary.
>
> ...perhaps I didn't understand your question.
> -Steven
>
> On Jan 27, 2008 6:35 PM, Wildemar Wildenburger
>
> <[EMAIL PROTECTED]> wrote:
> > Max wrote:
> > > In
On Jan 27, 7:25 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Sun, 27 Jan 2008 15:09:52 -0800, Max wrote:
> > Hi all. I'm just getting introduced to Python (mostly through Dive Into
> > Python), and I've decided to use it for a proj
On Jan 27, 8:01 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> "Max" <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> | In GAs, you operate on a Population of solutions. Each Individual from
> | the Population is a potential sol
On Jan 27, 7:25 pm, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> Just pass the class itself. For example:
>
> # Define a class.
> class Parrot(object):
> pass
>
> x = "Parrot" # x is the NAME of the class
> y = Parrot # y is the CLASS itself
> z = Parrot() # z is an INSTAN
Is there a Python equivalent of C++'s system()?
TIA
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for the help!
--
http://mail.python.org/mailman/listinfo/python-list
just to get at that small tag data,
and i assume there's a way to do this with file() or open() or
something, i just can't get it to work.
anyone know how i can fix this? thanks in advance for any help!
best,
max
--
http://mail.python.org/mailman/listinfo/python-list
On May 15, 9:51 am, castironpi <[EMAIL PROTECTED]> wrote:
> On May 15, 8:37 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
> > On Thu, 15 May 2008 06:08:35 -0700, max wrote:
> > > i currently have locations of the mp3s in question as strings
you're right, my java implementation does indeed parse for Id3v2
(sorry for the confusion). i'm using the getrawid3v2() method of this
bitstream class (http://www.javazoom.net/javalayer/docs/docs0.4/
javazoom/jl/decoder/Bitstream.html) to return an inputstream that then
i buffer and parse. apolog
On May 15, 6:18 pm, MRAB <[EMAIL PROTECTED]> wrote:
> On May 15, 9:00 pm, max <[EMAIL PROTECTED]> wrote:
>
> > you're right, my java implementation does indeed parse for Id3v2
> > (sorry for the confusion). i'm using the getrawid3v2() method of this
>
wrote:
> > > > On Thu, 2008-05-15 at 17:11 -0600, John Krukoff wrote:
> > > > > On Thu, 2008-05-15 at 15:35 -0700, max wrote:
> > > > > > On May 15, 6:18 pm, MRAB <[EMAIL PROTECTED]> wrote:
> > > > > > > On May 15, 9:
Following the tutorial at http://personalpages.tds.net/~kent37/kk/00010.html,
I understand how to access HTTP basic authenticated pages or form-
based authenticated pages. How would I access a page protected by both
form-based authentication (using cookies) *and* HTTP basic
authentication?
--
http:
On Aug 7, 3:54 pm, Wojtek Walczak
<[EMAIL PROTECTED]> wrote:
> Dnia Thu, 7 Aug 2008 11:14:05 -0700 (PDT), Max napisa³(a):
> Use ClientCookie or even better -
> mechanize:http://pypi.python.org/pypi/mechanize/
> The docs aren't perfect, but you should easily
> find
On Aug 7, 3:54 pm, Wojtek Walczak
<[EMAIL PROTECTED]> wrote:
> Dnia Thu, 7 Aug 2008 11:14:05 -0700 (PDT), Max napisa³(a):
> Use ClientCookie or even better -
> mechanize:http://pypi.python.org/pypi/mechanize/
> The docs aren't perfect, but you should easily
> find
ds, ISOs and NTFS drives) in one hierarchy.
--Max
--
http://mail.python.org/mailman/listinfo/python-list
uot;Foo\n")
>>> buf.write("Bar\n")
>>> buf.flush()
>>> buf.readline()
''
I expected buf.readline() to return 'Foo\n'. What am I doing wrong?
--Max
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> you forgot to rewind the file:
>
Thank you.
>
>
>
--Max
--
http://mail.python.org/mailman/listinfo/python-list
; im=im.convert('1')
>>> px=im.load()
>>> px[0,0]
0
That's the numeral one in the argument to convert. The load method
returns a pixel access object.
Max
--
http://mail.python.org/mailman/listinfo/python-list
The proposed launcher works fine for me:
https://bitbucket.org/vinay.sajip/pylauncher/downloads
(I'm not sure that is the most up to date place for the launcher,
but that's the one I am using)
Max
--
http://mail.python.org/mailman/listinfo/python-list
Yeah it won't work. Recursion depth will be reached. Steven's suggestion is
much better.
--
Max Countryman
+1-917-971-8472
On Wednesday, June 29, 2011 at 2:05 PM, santosh h s wrote:
> how to end ths over a period of time
>
> On Wed, Jun 29, 2011 at 11:25 PM, Max Co
Would it be a good idea to change Python definition so that a[10, -1, -1]
referred to the elements starting with position 10, going down to the
beginning?
This would require disabling the "negative stop value means counting from
the end of the array" magic whenever the step value is negative.
The
Check out the python Requests module:
http://docs.python-requests.org/en/latest/index.html
Sent from my iPhone
On Aug 25, 2011, at 7:07, Shashwat Anand wrote:
> I want to make a PUT request.
> I need some headers of my own ( certificates etc ) and I need to mandatorily
> use a proxy.
> Also t
http://DuplicateFilesDeleter.com - find duplicates
http://DuplicateFilesDeleter.com is an innovative tool that can
recognize duplicate audio files even if they are stored in different
file formats and not marked with ID3 tags.
It will find fast all similar or exact duplicate audio files in a
fold
My school has a website for homework called pronote (no problem if you don't
know it). After logging in on parisclassenumerique.fr (works with selenium but
I cant get requests to work), I want to read one of the packets that is sent:
All the info about my day, my homework, etc. are in there a
Hello,
Thanks for you answer!
Actually my goal is not to automatically get the file once I open the page, but
more to periodically check the site and get a notification when there's new
homework or, at the morning, know when an hour is cancelled, so I don't want to
have to open the browser every
Hi,
Seems like that could be a method of doing things. Just one clarification: the
website has unselectable text, looks like it's an image strangely generated, so
if I can get the packet with it, it would be perfect. As I said (I think),
logging in with Selenium was already possible, and I could
@Curt: That is notifications for the ENT app, I want the notifications for the
app named ProNote. ENT is for e-mails and Pronote for homework, quotes, etc.
--
https://mail.python.org/mailman/listinfo/python-list
Already tried this, only works for messages and not for homework etc.
--
https://mail.python.org/mailman/listinfo/python-list
Ok,
So here's a screenshot:
https://ibb.co/2dtGr3c
1 is the website's scrollbar and 2 is Firefox's scrollbar.
Seems like it uses a strange embed thing.
The packet follows:
https://pastebin.com/2qEkhZMN
@Martin Di Paola: I sent you the pastebin password per email so that you're the
only one who can
Found this:
https://pastebin.com/fvLkSJRp
with use-select tags.
I'll try to use selenium and select the page.
But using the JSON packet that's sent will still be more practical.
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
as of right now there appears to be a lack of setsockoptions required to enable
SSM, MCAST_JOIN_SOURCE_GROUP or something a kin to that in particular. Is there
currently any effort to add those options or any other workaround to make SSM
work in python natively?
Best regards
Max
Erik Max Francis wrote:
> Tor Erik Sønvisen wrote:
>
>> I need to browse the socket-module source-code. I believe it's
>> contained in the file socketmodule.c, but I can't locate this file...
>> Where should I look?
>
> The source tarball, available on
ot net
> language?
Hehe ...
I can run my very first Python program right now in the current version
of Python. I cannot even find a platform to run my .asp code from that
same timeframe ... So much for 'safe'!
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad
ould have crashed your system. That should be an indicator:
http://www.python.org/2.4.2/NEWS.html
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
erent versions of Zope 3, and since it is
installed under a specific python version, the simplest solution would
be to install several Python versions, and install a different zope3
version under each python install.
Have I misunderstood something here?
--
hilsen/regards Max M, Denmark
http://www.m
ptions):
for key in options.keys():
if not key in FN_LEGAL_ARGS:
raise TypeError, "'%s' is an invalid keyword argument for
this function" % key
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Lasse Vågsæther Karlsen wrote:
> Max M wrote:
> So what you're saying is that instead of:
>
> def fn(*values, **options):
>
> I should use:
>
> def fn(values, cmp=cmp):
>
> in this specific case?
>
> and then instead of:
>
> fn(1, 2
e program in
> less time.
In my experience the LOC count is *far* less significant than the levels
of indirections.
Eg. how many levels of abstraction do I have to understand to follow a
traceback, or to understand what a method relly does in a complex system.
--
hilsen/regards Max M
Hello!
Please take a look at the example.
>>> a = [(x, y) for x, y in map(None, range(10), range(10))] # Just a list of
>>> tuples
>>> a
[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8,
8), (9, 9)]
Now i want to get a list of functions x*y/n, for each (x, y) in a:
>>> funcs
Thank you for explanation, Alex.
It appears that almost every beginner to Python gets in trouble with
this ...feature. :)
--
http://mail.python.org/mailman/listinfo/python-list
OK.
The thing i've got is an obscure semantic bug, occured because of my
unawareness of the following Python "features":
1. (In major)
http://mail.python.org/pipermail/python-dev/2005-September/056508.html
2. "late" bindings of the function's body
Got to know! :)
Thanks for your attention.
--
h
Valid link in my previews message is
http://mail.python.org/pipermail/python-dev/2005-September/056669.html
Sorry.
--
http://mail.python.org/mailman/listinfo/python-list
ts:
mimeMsg = MIMEMultipart()
mimeMsg.attach(msg)
for attachment in attachments:
# Add the attachment
tmp = email.message_from_string(str(attachment.headers))
filename =
guess that's normal as it's the way python works...?!?
Well you could do something like this. (Untested and unrecommended)
self.__dict__.setdefault('pkcolumns', []).append(row[0].strip())
Personally I find
pkcolumns = []
pkcolumns .append(row[0].strip())
to be nicer ;-)
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
low
> level mouse events.
My intuition(so take it with a grain of salt) says that it wouldn't
make any sense for the list control to generate an event when the drag
and drop lands on a different control.
max
--
http://mail.python.org/mailman/listinfo/python-list
42712475
None
>>>
As you can see, distance2 does not actually return the result of the
calculation to the interactive prompt...
max
--
http://mail.python.org/mailman/listinfo/python-list
Not in python.
For example, what would you call the following?
def rsum(n, m):
print n+m
return n+m
In python a method is callable attached to an object. A function is a
callable object constructed with a def statement.
max
--
http://mail.python.org/mailman/listinfo/python-list
structure is then is complete, you use the midi
library to write it to disk.
I have attached a simple example here.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
# event classes. Only used internally by notes2midi
class NoteOn:
def __init__(self, time=0, pit
ings (like newt).
http://docs.python.org/lib/module-curses.html
HTH,
Max // http://max.textdriven.com
--
http://mail.python.org/mailman/listinfo/python-list
a('default result')
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mail.python.org/mailman/listinfo/python-list
Nader Emami wrote:
Hello,
I am new in Python world, and would like to begin with
translate a csh file to a python script. Could somebody give
me an advise (documentation or web-site) where I can do that.
You are probably interrested in the os 6 os.path modules.
--
hilsen/regards Max M, Denmark
unicode string into a special
string/file format
# and you can decode a string from a special string/file format back
into unicode.
###
u'Some danish characters \xe6\xf8\xe5'
'Some danish characters \xe6\xf8\xe5'
Some danish characters æøå
range(128)
Hm, why does the 'encode' call complain about decoding?
Because it tries to print it out to your console and fail. While writing
to the console it tries to convert to ascii.
Beside, you should write:
u"ä".encode("latin-1") to get a latin-1 encoded stri
1 - 100 of 1012 matches
Mail list logo