python to understand your new syntax, just write a small
interpreter to translate your new language to python.
--
Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses
m just an amateur developer.
But what confuse me, is that Python require "real live" interpratation
of the code to work properly (or perhaps i also confuse on that but
Python rely on interpretation of the code to conform to its own
standard, ie variables can change type during execution...)
--
Pierre
trange the initial request.
And sure, i overinterpret or simplify thing (compiling)...
But it seems that all this talk do not interested the initial requester
(Mr Puneet) : at that time he has not answer to the thread.
--
Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/&
interpretation, byte-code compilation, JIT
compilation, AOT compilation...
So yes Python compile (bytecode).
--
Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licens
means it is most definitely
> meant to be able to be caught.
Using compile() function yes.
So yes there is a way to check "syntax error" before executing code
(using compile function and exceptions) but it was not standard, nor
widely used... It was still a hack for me, but perhaps
uested but that only a
hack and should not be used in real world.
--
Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
https://mail.python.org/mailman/listinfo/python-list
ve the page, extract data,
extract last river level and mean the 24h last levels.
<https://www.dropbox.com/sh/k5974t374zmcoj6/AACes_Xo5DrxCbE1RjSaeKXYa?dl=0>
Note : it was probably not beautiful python code, but it works for the
purpose it was written.
--
Pierre-Alain Dorange
DFS wrote:
>
> 2 lines? Love it!
>
> But apparently eval==evil.
>
> http://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html
>
> I bet you get hammered about it here on clp.
It was a software to be deploy, it was just for educational purpose.
-
env={}
env["__builtins__"] = None
u=raw_input('Enter calculation:")
print eval(u,env)
-
--
Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
https://mail.python.org/mailman/listinfo/python-list
;*':c=n1*n2
> if op=='/':c=n1/n2
> print(ui+' = '+str(c))
> ---
More reduced :
--
u=raw_input('Enter calculation:")
print eval(u)
--
works and compute :
1+2+3+4-1+4*2
2+3.0/2-0.5
Pe
;something" that perhaps will fill
the list (word.append("hello").
Then after do your job, you perhaps need to print it.
But initializing and just print, will do nothing else than initialize
and print the result...
As state before this code more or less like :
a=0
print a
--
P
something must exist first.
--
Pierre-Alain Dorange Moof <http://clarus.chez-alice.fr/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
https://mail.python.org/mailman/listinfo/python-list
Marko Rauhamaa wrote:
> Note that the "valid point of view for external observers" is the only
> valid scientific point of view.
For a scientific point of view, right. But tell this to the one that
will be close to a blackhole ;-)
--
Pierre-Alain Dorange Moof <
Steven D'Aprano wrote:
> > which infinity. There are many - some larger than others
>
> China has just announced a new supercomputer that is so fast it can run an
> infinite loop in 3.7 seconds.
Near a black hole 3.7 seconds can last an infinite time...
--
Pierre-Alain
ncy is always atan2(y,x) tend to pi/4 if you looks at lot od y and
x that will be grater and greater each time : the final frontier would
always be pi/4, even if t take a long time to reach it.
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence C
not explore
this, i just thought NSEW was also CENTERED.
Many Thanks.
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
https://mail.python.org/mailman/listinfo/python-list
pmx-bigmap>
the tkinter code is in pmx.py
the canvas class was TMap
GUI was created in main_gui.__init__()
callback function was main_gui.resize()
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons &quo
been NaN too but
i'm not a math expert, but the limit of atan2 would be 45°, so pi/4
radians (0,7854).
As x,y are coordinates, the both infinite would tend toward 45°.
x only infinite would be 0° (0 radians)
y only infinite woudl be 180° (pi/2 radians)
--
Pierre-Alain Dorange&
Steven D'Aprano wrote:
> py> math.atan2(NAN, 0)
> nan
>
> I think that the only way it will return a NAN is if passed a NAN.
yes of course if you pass an invalid argument (NAN is not a real value,
atan2 except coordinate x,y), the result would be invalid...
--
to see a different portion.
So i except the map to be resized to show a bigger portion of the whole
map : no streching.
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.
quadrant (for angle answer).
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
https://mail.python.org/mailman/listinfo/python-list
he cell where the canvas widget is put).
I think i can resize the canvas, but i can't find a way to get the
available space after resize.
Perhaps using the grid manager is not the godd idea for that ?
I except it was more understandable.
--
Pierre-Alain Dorange<http://microwar.sour
at to do from that.
Any clue or advice or tutorial ?
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
https://mail.python.org/mailman/listinfo/python-list
t;
> > numpy is very big and i doubt all is reallly needed
> >
>
> Excuse me, but what was the point? (id est, are you just saying this
> or do you wish to ask a question?;)
Sorry, it was not clear.
But i want to know if i can make the package smaller, because the total
packag
.org/library/profile.html>
--
Pierre-Alain Dorange
MicroWar 2.0 : tuez des PC
<http://microwar.sourceforge.net/>
--
http://mail.python.org/mailman/listinfo/python-list
e Python directly from Xcode but i do not understand the
right way to do this. There is project for PyObjC but a can't make
working directly simple script project, so i continue to use terminal...
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous l
?
I do a site._test() and i return my only 1.8.0 module for pygame, 1.9.0
is ignored. The same with
Any clue ?
--
Pierre-Alain Dorange
<http://microwar.sourceforge.net/>
--
http://mail.python.org/mailman/listinfo/python-list
ou invoked the ascii() builtin, the b
> >> prefix should disappear? Re-read the documentation of the
> >> ascii() builtin - it probably does something completely different
> >> from what you expect it to do.
> >
> > s = str(hexlify(urandom(8)))[2:18]
>
> And you
ust exist allready ?
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
http://mail.python.org/mailman/listinfo/python-list
le SketchUp, do want
> to get on board?
I've other real project on the run, no crusade just programming.
Google sketchup doesn't really interest me, sorry...
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creative
r wrote:
>
> Go to Google groups... it looks perfect :)
It's a usenet group here, nothing to do with google groups.
To get back to the group subject, what is your actual python projects ?
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons "by-nc-sa-2.
|--//''`\--|
> | (( +==)) |
> |--\_|_//--|
Very nice indeed, but you forget ascii art need a fixed font...
--
ft.
> At least until you profile your
> application and discover that the sign() function is the bottleneck
> keeping your program slow.
In each frame i'll have to use about 10 to 20 sign() call, so it'll not
be the bottleneck.
--
Pierre-Alain Dorange<http:/
r wrote:
> [...]
> Well that shows that even lads with tiny nads can be brave, any of the
> other trolls want to expose them selfs?
This thread is offtopic, please just keep silent and let it be closed...
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce m
III. Do you want to know my
> favorite color too?
Only if it's pythonic.
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
http://mail.python.org/mailman/listinfo/python-list
)
sign_3 : 0.498 (+33%)
It seems it don't change the relative results between the methods.
Using timeit make measure accurate and remove print/range footprints.
I also try Arnaud's proposition, it make sign_0 just a little better
(-1%)
--
Pierre-Alain Dorange<http://microwa
ge from -1000 to 0
sign_0 : 0.46"
sign_1 : 0.30" (-35%)
1000 Random from -500 to +500
sign_0 : 0.37"
sign_1 : 0.42" (+13%)
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
http://mail.python.org/mailman/listinfo/python-list
0.5244 second (+26%)
conclusions ---
1/ python is fast
2/ method (0) is the fastest
3/ cmp method (2) is the slowest
4/ the precise one (IEEE 754) is also fast (1)
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licenc
Christian Heimes wrote:
> Pierre-Alain Dorange schrieb:
> > I don't find any sign(x) function in the math library (return the sign
> > of the value).
> > I've read that math module is a wrapper to C math lib and that C math
> > lib has not sign(), so...
>
better and could be faster.
How do you implement this or is there any other module with a sign()
function ?
--
Pierre-Alain Dorange<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons
atching Time: 0.122432
(Compiled) Pattern Matching Time: 0.12012
Ratio Compiled/NotCompiled: 0.981116048092
2nd time and more
Pattern Matching Time: 0.00257
(Compiled) Pattern Matching Time: 0.000619
Ratio Compiled/NotCompiled: 0.240856031128
Config python 2.5.1 / MacOS X 10.5
--
p Bonus (give 5 super-bomb)
* adding Saucer explosion : generate Virus that can infect PC
* clean the screens handling
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
http://mail.pyt
e display module you can use pygame, pyglet or pyOpenGL, there are
fast.
For the audio analysis i thought the module must be written in C or
something very fast, because python, due to it's nature, would probably
not compute spectrum as fast as real time : 44100 samples per seconds is
a lot
i you want to loop in getAge() :
def getAge():
age=-1
while age<0:
try:
age = int(input('Please enter your age: '))
except ValueError:
print('That was not a valid number. Please try again.')
return age
I'm a begi
y iMac intel, i run my small arcade game (a spaceinvader like)
between 800-1400 fps using dirtyrect.
I can also run without modification on Windows and Unbuntu using WMWare
on the same machine.
--
Pierre-Alain Dorange
<http://microwar.sourceforge.net/>
Ce message est sous licence Creative Co
air force1 shoes <[EMAIL PROTECTED]> wrote:
>>> air force1 shoes. air force1 high shoes. air force1 light shoes
File "", line 1
air force1 shoes. air force1 high shoes. air force1 light shoes
^
SyntaxError: invalid syntax
>>>
--
Pierre-
gavino <[EMAIL PROTECTED]> wrote:
> python vs smalltalk 80
>
> which is nicer?
1st clue : Python got less letters in its name.
2nd clue : 80 is the year of the release of Alan Vega/Martin Rev album
3rd clue : Smalltalk began with an S, but Python with a P
--
Pierre-Alain Dora
None)
The same test at my office, with MacOS X 10.5 / Python 2.5.x return the
right answer ;
('fr_FR','mac-roman')
My goal is to dertermine th user language define on the running system,
any helps ?
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons &qu
on.org/moin/MacPython/py2app>
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
http://mail.python.org/mailman/listinfo/python-list
e an external program paint an image from a camera into a portion of
> the screen while pyGame is running?
Don't know...
--
Pierre-Alain Dorange
Ce message est sous licence Creative Commons "by-nc-sa-2.0"
<http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>
--
http://mail.python.org/mailman/listinfo/python-list
++ !-)
OK ;-)
I just ask myself what was the best method (according to python
phylosophy).
--
Pierre-Alain Dorange
Vidéo, DV et QuickTime <http://www.garage-video.com/>
Clarus, the DogCow<http://clarus.chez.tiscali.fr/>
--
http://mail.python.org/mailman/listinfo/python-list
me directory and perhaps i would
also faced to permissions issues...
But first is there a way to determine on which platfrom the python
script is running ?
--
Pierre-Alain Dorange
Vidéo, DV et QuickTime <http://www.garage-video.com/>
Clarus, the DogCow<http://clarus.chez.tiscali.fr/>
--
http://mail.python.org/mailman/listinfo/python-list
self):
f=open(kFileName,'w')
pickle.dump(self,f)
f.close()
return 0
def main():
p=Prefs()
p.load()
print 'test %d (after load)' % p.test
p.test+=1
print 'test %d (before save)' % p.test
p.save()
print
53 matches
Mail list logo