ps://github.com/python/cpython/blob/master/Lib/encodings/aliases.py>,
or equivalently, the set of filenames in /Lib/encodings/
<https://github.com/python/cpython/blob/master/Lib/encodings/>, but again
I'm not sure.)
-Daniel
--
https://mail.python.org/mailman/listinfo/python-list
I am also wondering about this behavior. Thank you Chris A for providing the
explanation.
On Jun 16, 2018, at 5:45 PM, Chris Angelico
mailto:ros...@gmail.com>> wrote:
On Sun, Jun 17, 2018 at 2:38 AM, mailto:ip.b...@gmail.com>>
wrote:
Hi everyone,
I'm intrigued by the output of the following
Hi there everyone, my name is Daniel Perry and I'm a totally blind new Python
user. I've only just recently started picking up python and playing with it and
I intend on building some unique audio computer games for the blind. Such
things mostly as simulation games like farming, bui
Hello, I'm relatively new to python.
Recently I have been receiving errors every time I attempt to open python
files. When try open them, it sends me directly to the 'Modify Setup' window.
Clicking on repair or modify does not fix the problem, it simply goes through
the repair or modify process
ity
> >
> > System crashed while using PyCharm / Python3.
> > Booting takes forever and stuck at the purple screen with
> > the Ubuntu logo and the five dots cycling.
> > How to fix?
> >
>
> Searching for this thread in a browser lead to
> the code.actives
#x27;,
> 'SERVER_PORT': '8000',
> 'SERVER_PROTOCOL': 'HTTP/1.0',
> 'SERVER_SOFTWARE': 'gevent/1.0 Python/2.7',
> 'wsgi.errors': ', mode 'w' at 0x7f4c299bc1e0>,
> 'wsgi.input': ,
>
A couple of things you can try:
* Generate a directory rather than onefile, on the directory you can apply du
-hs * | sort -h -r (or treesize if you are using windows
https://www.jam-software.com/treesize_free) to see which folders / files
are taking up a lot of space. Then once you see what is ta
Hello group. I started learning Python about a week ago. I have a few years of
experience with other languages, mostly Pascal and C#, and I've always
programmed for desktop, so I'm a bit clueless when it comes to web programming.
So I was able to pull off my first working app with Python using A
Thanks again for putting me on track.
On Tuesday, April 9, 2019 at 3:05:22 PM UTC-3, Chris Angelico wrote:
> On Wed, Apr 10, 2019 at 2:46 AM Daniel Tkach wrote:
> > What I want to do now is ... I want the Kajabi product be activated for
> > that user as soon as he checks out
Hello Neil,
thanks for the detailed answer.
Question: are there other people/factors who/which should be regarded
as more important than the linter's opinion?
Yes. Mine.
I was just puzzled at the linter's output (took me a while to figure out
what it actually meant), and that got me started
Am 10.12.2019 22:29 schrieb Chris Angelico:
And once again, you are maintaining your assumptions despite being
very clearly shown that they are wrong. "del instance" does not
directly call __del__ any more than "instance = 1" does. You HAVE been
shown.
Much of the confusion in this thread come
Am 27.01.2020 15:23 schrieb Chris Angelico:
The way execution works in Python, you first evaluate the object, then
assign it to the target. The new object HAS to exist before the old
one is replaced. There's no such thing as "atomic reassignment" that
simultaneously destroys the old object and a
a solution to this,
because there still could be objects create from the old module.
Maybe you should just check the type yourself by comparing the class
names buried in the PyType. You could cache one or two type pointers to
speed this up.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh a écrit :
> [EMAIL PROTECTED] wrote:
>
>
>>These 3 intermediate variables used to improve readability
>>can introduce bugs : you have to check that b, c and d are
>>not used anywhere else in the code.
>
>
> if you have a fear of introducing new local variables, you have problems
>
to your reply.
I tried with two different providers to get the messages, but with the
same result.
Is it possible that this msg could have been throwned away by moderators
of this list ?? But in this case, you wouldn't have been able to read it...
Daniel delay
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch a écrit :
> Apart from that, I don't think your proposal does any good - it is ugly
> (or at least not less ugly than the things you want to fix) and confuses
> the reader because of the colliding use of . for attribute access.
There is no ambiguity ( in one case "." is followe
Paul DiRezze wrote:
> I'm spending the next two weeks off and I'm looking to take a crack at
> learning how to program in Python. Here's a list of the places I've
> bookmarked:
>
> http://www.python.org/doc/ and more specifically
> http://wiki.python.org/moin/
> http://wiki.python.org/moin/Begi
I have two one-dimensional Numeric arrays, and I need to know the
indices in the second array of elements from the first.
so if i had:
a=array([2,4,6])
b=array([2,3,4,5,6])
i want a function match that does this:
>>> match(a,b)
array([0,2,4])
i have something that works, but it involves conver
Thanks a lot. It was this equal.outer idea that I was missing.
--
http://mail.python.org/mailman/listinfo/python-list
ture?
specially I am interested in all A blocks
just now, I am trying to solve it with re,
pattern = re.compile(r"^\s*A\s*{.*}\s*", re.MULTILINE | re.DOTALL)
A_blocks = pattern.findall( file("myFile").read() )
but since there might be subblocks it will fail finding the closing &q
> pattern = re.compile(r"^\s*A\s*{.*}\s*", re.MULTILINE | re.DOTALL)
correction
pattern = re.compile(r"^\s*A\s*{.*?}\s*", re.MULTILINE | re.DOTALL)
I forgot to make it non gready :)
--
http://mail.python.org/mailman/listinfo/python-list
maybe you should look at subprocess module
I have one expamle, this is Linux though
>>> import subprocess as sp
>>> p1 = sp.Popen(["ls", "-l"], stdout = sp.PIPE)
>>> p2 = sp.Popen(["wc", "-c"], stdin = p1.stdout, stdout = s
gt;> f.start()
>>> not there
not there
not there
not there
not there
not there
not there
not there
not there
not there
not there
not there
>>>
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
dawenliu wrote:
> Hi, I have a file with this content:
> xxx xx x xxx
> 1
> 0
> 0
> 0
> 1
> 1
> 0
> (many more 1's and 0's to follow)
> y yy yyy yy y yyy
>
> The x's and y's are FIXED and known words which I will ignore, such as
> "This is the start of the file"
_point#Problems_with_floating-point,
especially 'Rounding'. Or google for "gloating point precision" if you
need more details.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
According to the documentation the xml.parsers.expat module provides the exception ExpatError and
this exception has 3 attributes, lineno, offset and code. I would like to use lineno, but can't.
ExpatError itself works, for example if I do
import sys
from xml.dom import minidom
from xml.parsers.e
ro (this does not include a string
representation of a floating point number!) When converting a string, use
the optional base. It is an error to supply a base when converting a
non-string. If the argument is outside the integer range a long object
will be returned instead.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
kill him in a certain moment.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
.threads/browse_thread/thread/37fe7e050b44c329/217660515af867ea?tvc=2#217660515af867ea
Cheers
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi to all,
How can I install an exe file as a service through Python?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
w shell
> scripts that die on their own accord, and make sure they get
> restarted, so it doesn't rely on twisted being used in the
> processes it controls.
Ok. I'll take a look. Thank you very much! :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
: 5, 'z': 'Hallo'}
>>> for key, value in x.__dict__.items():
... print key
... print value
...
y
6
x
5
z
Hallo
>>>
Consider using iteritems() instead of items() when you have a loop.
Hope that helps :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
you write
the first proposition, like if that can be a normal thinking of how to
do the second proposition :-S
Well, I hope that newcomers to Python don't confuse himselves :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi
> >>> os.spawnl(os.P_NOWAIT, "c:/windows/notepad.exe")
> 1944
I don't get the correct PID.
When I do os.spawnl(os.P_NOWAIT, "c:/windows/notepad.exe")
I get 168 (for example), while in the tasklist appears notepad.exe with
the 2476 PID.
Why?
Th
it doesn't unlink. I mean, if I close my main app, so does
the launched program. With startfile() it does the job, but I then I
have to find what pid is through win32all module, etc.
it would be very good if I can use spawnl
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Is there a built-in method for transforming (1,None,"Hello!") to
1,None,"Hello!"?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
> not sure, but the return value looks like a PID, so maybe you're seeing the
> PID for the cmd.exe instance used to run the program. or something.
No. There wasn't a 196 PID for any of the processes.
--
http://mail.python.org/mailman/listinfo/python-list
kid in friends])
for kid in friends:
print kid,
if kid is friends.Kenny:
print "dead"
else:
print "alive"
---
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
start searching there.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
it a py2exe option in the setup file?
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
.
Right, works just fine. I'm not used to types, meanwhile I replaced
Type(str) by a simple class Type, works as well.
Thanks a lot, I was starting to integrate this solution in my code, now I
can fix it before it's even used :)
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
27; to the iterator.
2. It violates the Zen of Python 'Explicit is better than implicit'
(although the definition of 'explict' varies wildly in the Python community)
3. For specific collections like lists and dictionaries, you could write
a wrapper so that it is possible
'getsampwidth', 'initfp', 'readframes', 'rewind', 'setpos', 'tell']
>>> wav.getnchannels()
2
>>>
and so on, this is what google gave me
http://scipy.mit.edu/tutorials/wave.pdf
I did some wave ploting with matplotlib module, so I think
it's feasible to cut and write wave files too
as for mp3, I don't know of any modules
I think mainly because of license issue
you could decode mp3 to wav and process whatever you want to process
but to encode them back into mp3 is a problem
maybe you could use lame or bladeenc as a command line tool
or use ogg instead
http://www.andrewchatham.com/pyogg/
there are de/encoders freely available
this may also be interessting to you
http://pymedia.org/
hth, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ge 0 .. 59
for time in times:
t = time.split(":")
assert 0 <= int(t[0]) <= 23
assert 0 <= int(t[1]) <= 59
hth, Daniel
ps: all code untested
--
http://mail.python.org/mailman/listinfo/python-list
in98. Also, I tried to
install the kill.exe and a dont-remember-dll (from the Win98 Resource
Kit), but it doesn't work.
So my solution (need help on this) is that I have been thinking on
letting the monitor listen for socket connection. Through this, the
main app can tell him to c
in98. Also, I tried to
install the kill.exe and a dont-remember-dll (from the Win98 Resource
Kit), but it doesn't work.
So my solution (need help on this) is that I have been thinking on
letting the monitor listen for socket connection. Through this, the
main app can tell him to c
']]
>
> This does what I want:
>
> >>> b = [[] for _ in range(6)]
> >>> b[3].append('X')
> >>> b
> [[], [], [], ['X'], [], []]
>
> The first is clear and wrong. The second is hairy and right.
> Is there a way to do i
Ok. Thanks for your answer :-)
I have implemented this and works correctly.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ray('c',
> '\x00=http://groups.google.com/intl/en/googlegroups/tour/index.html'))
>
> Thanks in advance,
>
> regards,
> purna.
>
i am not sure i understand your question right
if not just ignore
import array
x = array.array("c", "test&quo
You're maybe searching for epydoc: http://epydoc.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
I prefer wxPython www.wxpython.org
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hi!
I would like to know how can I do the PHP ternary operator/statement
(... ? ... : ...) in Python...
I want to something like:
a = {'Huge': (quantity>90) ? True : False}
Any suggestions?
Thanks
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Hello to all,
How can I do
new_variable = (variable) ? True : False;
in Python in one line?
I want to do something like this:
dic = {'item1': (variable) ? True-part : False-part}
Any suggestions?
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Oh... Well, thanks for that information.
I'll do this then:
def TernaryOperation(condition,true_part,false_part):
if condition:
return True-part
else:
return False-part
a = {'Huge': TernaryOperation(quantity>90,True,False)}
Thank you
--
http://mail.python.org/mailman/l
Hi Peter,
Expand your mind.
a = {'whatever': TernaryOperation(quantity>90,"It is very huge","The
value is correct")}
;-)
thanks for your advice anyway
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
grep) allows for a certain amount of errors and there
exist Python bindings (http://www.bio.cam.ac.uk/~mw263/pyagrep.html)
Or google for "agrep python".
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
most recent call last):
> File "", line 1, in ?
> TypeError: iterable argument required
>>> a
[[1, 2], [1, 2], [2, 3]]
>>> c=[]
>>> for x in a:
... if x not in c: c.append(x)
...
>>> c
[[1, 2], [2, 3]]
or (Python 2.4)
>>> a
[[1,
, [3, 2]]
>>>
>>>
>>> lst.sort(cmp = lambda x,y: cmp(x[1], y[1]))
>>> lst
[[3, 2], [1, 4], [2, 5], [3, 9]]
>>>
works for Python 2.4
in earlier Pythons just let cmp = .. away
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
5], [3, 9]]
>> >>>
>>
>>works for Python 2.4
>>in earlier Pythons just let cmp = .. away
>>
>>Regards, Daniel
>
> what does let cmp = .. away mean?
it means
lst.sort(lambda x,y: cmp(x[1], y[1]))
I can offer you some more brain food to digest ;)
ma
ds['CONTACT'] the value of dOldDataFields['FIRSTCONTACT']
or the value of dOldDataFields['SECONDCONTACT'] depending on
dOldDataFields['CONTACTTYPE']. How you do this in a practic way without
the use of one-line code? It is needed! You can't avoid it! Eve
u can use it to see how many referenced does a object
like 1 have .. or check the current recusrion depth .. or
see the encoding of stdin, stdout
only such things
os module is operating system related
it provides many lowlevel functions .. os.open etc
I dont know of a module which provides thin
some differences between databases, but I think adodb
can care about it :)
http://adodb.sourceforge.net/
http://stickpeople.com/projects/python/win-psycopg/
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
SPE - Stani's Python Editor wrote:
> I know that this code is nonsense, but why does this print 'Why?'
>
> a = 1
> if a >2:
> try:
> 5/0
> except:
> raise
> else:
> print 'why?'
>
because 1 is not greater than 2 I suppose :)
--
http://mail.python.org/mailman/listinf
;> lst
[4, 16, 256, 65536]
I think this loses compared with
i=2
lst=[i**=2 while i<1000]
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
gt; i**2
lst=[i**2 for i in range(1000)]
you will get a list with 1000 items
[0,1,4,9 ... ]
is not the same as
i,lst=2,[]
while i<1000:
i**=2
lst.append(i)
here you get [4,16,256,65536]
only 4 items
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
ts the boolean expression first then decides whether to execute
the body or not, in particular no next-iterator is involved(??)
as it would be in
lst=range(5)
for i in lst:
del lst[0]
Regards, Daniel
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> A paper finding that OOP can lead to more buggy software is at
> http://www.leshatton.org/IEEE_Soft_98a.html
Sure, OOP *can* lead to more buggy software, that doesn't mean it always
does.
> Les Hatton "Does OO sync with the way we think?", IEEE Software, 15(3),
> p.4
"H. S. Lahman" <[EMAIL PROTECTED]> wrote:
> > Les Hatton "Does OO sync with the way we think?", IEEE Software, 15(3),
> > p.46-54
> > "This paper argues from real data that OO based systems written in C++
> > appear to increase the cost of fixing defects significantly when
> > compared with system
icle: http://help.blogger.com/bin/answer.py?answer=135
Daniel Bickett
On Sat, 01 Jan 2005 13:14:23 +, Mark Carter <[EMAIL PROTECTED]> wrote:
> I currently use python to automatically summarise a certain newsgroup
> daily, and post the findings that it makes. Someone has suggested
import os
# windows
os.system("cls")
# bash ( mac, linux )
os.system("clear")
That's all I can account for.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
While I have no solution for the recipe you cited, it seems like alot
of trouble could be avoided by simply importing the os module and
running the following command using os.system:
shutdown -s
Daniel Bickett
On 2 Jan 2005 20:13:35 -0800, EW <[EMAIL PROTECTED]> wrote:
> I have a pro
Batista, Facundo wrote:
[John Roth]
#- I would like to contribute some documentation to Python.
#- I've got the time, I write quite a bit, etc. I've got fairly
#- strong opinions about some things that need to be documented,
#- (such as all the new style class descriptor stuff from 2.2)
#- and I ha
Batista, Facundo wrote:
[Daniel Bowett]
#- Contribute to where on Sourceforge??? Which domentation are
#- we talking
#- about in general?
Suppose you're reading Python documentation. Don't know, for example,
os.remove(). There you find that a particular parragraph is difficult
to under
at pastes its path
(in quotes) into the command line, and you can just hit enter. I
wouldn't recommend this, though, because the cwd wouldn't be that of
the script, and it could cause instability for some apps that use
relative paths.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
ceptions)?
Thank you for your time,
Daniel Bickett
P.S. I know I said I didn't need to post code, but I will anyway. You
never know :)
http://rafb.net/paste/results/FcwlEw86.html
--
http://mail.python.org/mailman/listinfo/python-list
Oh, I'm sorry, that was my mistake. The example contained that error,
but my code does not.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
y referenced as variables, so this
is clearly not a matter of escape sequences.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
MD5 and SHA are by their very nature one way encryption. You cannot
decrypt them.
A quick google for other encrytion methods found this:
http://www.amk.ca/python/code/crypto.html
What you will need to do is find an encryption methos that uses a key
which you use to encrypt and decrypt the data
ontains more than an
expression, then it's complex enough to require a name
how to get unnamed function with statements?
You can't. See various threads about Smalltalk/Ruby-like blocks and the
recent one about the 'where' keyword for proposals to change this
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Is anyone reading this list through thunderbird as news? If so - how did
you set it up?
--
http://mail.python.org/mailman/listinfo/python-list
OK, ask a stupid question I wasn't aware I needed a Usenet account.
It's simple when you know how.
Peter Hansen wrote:
Robert Kern wrote:
Robert Kern wrote:
Daniel Bowett wrote:
Is anyone reading this list through thunderbird as news? If so - how
did you set it up?
I sub
http://www.twistedmatrix.com/
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
ame)
except AttributeError:
raise AttributeError, attrname
value = method ()
setattr (self, attrname, value)
return value
And probably also through metaclasses. And decorators.
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
Hello everybody
I'm thinking about improving my web site scripts
and would like to use Python instead of PHP/Perl.
Does anyone know of mod_python friendly ISPs in
europe? With prices around 10€ ?
Thanks in advance,
Paulo
I would doubt you will find any commercial python ISP
I only use Windows and I only ever use Textpad. It gives nice syntax
highlighting, indentation and you can run your script with it too.
andy wrote:
Anybody like to comment on which editor they use for python web app
development - for both discrete and mixed python and html code, and why?
I'm c
names
and files with .c extensions. So, discouraged, I gave up on yaml.
Elementtree, on the other hand, is wonderful :)
Irmen de Jong wrote:
> +1 QOTW
I second that, as well.
here's-to-appreciating-the-end-without-having-to-be-interested-in-the-means-ly
y'rs
Daniel Bickett
--
http://mai
know about you, but I
have no trouble whatsoever reading and writing XML. But alas, I don't
need to. Long live elementtree (once again) :-)
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
Doug Holton wrote:
> You might like programming in XML then: http://www.meta-language.net/
> :)
http://www.meta-language.net/sample.html#class-metal
I'm not so sure ;-)
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
less clouded than ours, so only *you* are in the position to write the
proper replacement.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
ly read an article in the linux magazine,) but I hope this
helps.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
python and delivered as binary form.
>
> How does these binary code get generated by python compiler?
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.pi
3.1415926535897931
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
not a question).
Is there a reason that Google Groups isn't mirroring python-list
exactly like it used to, or is it simply a conspiracy I'm not in on?
perfectly-capable-of-conspiring-ly y'rs,
Daniel Bickett
NOTES:
[1] http://mail.python.org/pipermail/python-list/2005-January/261966.htm
John Lenton wrote:
> > On Sun, Jan 23, 2005 at 01:53:52PM -0500, Daniel Bickett wrote:
> > >
> > > Is there a reason that Google Groups isn't mirroring python-list
> > > exactly like it used to, or is it simply a conspiracy I'm not in on?
> >
Lucas Raab wrote:
> Daniel Bickett wrote:
> >>Most texts in computing are written by authors to defend and showcase
> >>their existence against their peers.
> >
> >
> > When you aren't busy `showcasing' your ignorance, this is *all* i see
> >
t's painfully obvious that it is all for the sole purpose of negative
attention.
You guys are just begging for a YHBT ;-)
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Bickett wrote:
> [snip]
> You guys are just begging for a YHBT ;-)
I apologize, that should have been "we" -- I was criticizing him too.
no-one-wants-to-be-a-hypocrite-ly y'rs,
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
going to do is link him to this thread once it has accumulated
any answers)
Thank you all for your help :)
Wishing-to-be-liberated-from-the-clutches-of-PHP-ly y'rs,
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
I have just started playing around with MySQLdb for a project I am planning.
As a test I have written a script that executes 3000 insert statements
on a table. The table contains 10 fields with a mix of text and numbers
- its a product table for a website eg UPC, ProductName, Price etc.
The prob
Swaroop C H wrote:
On Tue, 25 Jan 2005 20:43:54 +, Daniel Bowett
<[EMAIL PROTECTED]> wrote:
I have just started playing around with MySQLdb for a project I am planning.
As a test I have written a script that executes 3000 insert statements
on a table. The table contains 10 fields with
301 - 400 of 1788 matches
Mail list logo