Re: Please improve these comprehensions (was meaning of [ ])

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1
Thank you,
-Alex Goretoy
http://launchpad.net/~a1g


On Wed, Sep 6, 2017 at 7:22 PM, Stefan Ram  wrote:
> Rustom Mody  writes:
>>Because the abstract idea of a permutation is a list (sequence)
>
>   Traditional mathematical books (which are not influenced by
>   computer programming terminology) often use "n-tuple"
>   (or "sequence") instead of "list" IIRC.
>
>   It is important to note that - according to me - a Python
>   data structure with the same /name/ as a mathematical concept
>   does not always have to be the best way to implement that
>   mathematical concept. E.g., sometimes a Python list might be
>   the best way to implement a mathematical tuple, or a Python
>   tuple may be the best way to implement a mathematical set.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: A question on modification of a list via a function invocation

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1
Thank you,
-Alex Goretoy
http://launchpad.net/~a1g


On Wed, Sep 6, 2017 at 7:18 PM, Chris Angelico  wrote:
> On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody  wrote:
>> On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote:
>>> On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote:
>>>
>>>
>>> > Can you explain what "id" and "is" without talking of memory?
>>>
>>> Yes.
>>>
>>> id() returns an abstract ID number which is guaranteed to be an integer, and
>>> guaranteed to be distinct for all objects which exist at the same time. 
>>> When an
>>> object ceases to exist, its ID number may be re-used.
>>>
>>> `is` compares the two operands for identity. If the two operands are the 
>>> same
>>> object, `is` returns True, if they are distinct objects, `is` returns False.
>>
> a = (1,2)
> b = (1,2)
> a is b
>> False
> x = 1
> y = 1
> x is y
>> True
>>
>> a seems to be as 'same' to b as x is to y
>> Python seems to think otherwise
>>
>> Evidently your ‘same’ is not the same as mine??
>
> *facepalm*
>
> I got nothing to say to you. Have you been on this list all this time
> and still don't understand that Python sometimes optimizes immutables?
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: execfile and import not working

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1


On Wed, Sep 6, 2017 at 6:57 PM, Stefan Ram  wrote:
> Friedrich Rentsch  writes:
>>ready to go. Alas, execfile and import commands don't do my bidding, but
>>hang IDLE. All I can do is kill the process named "python" from a bash
>
>   AFAIK »exefile( 'myscr.py' )« is
>
> exec( compile( open( 'myscr.py', 'rb' ).read(), 'myscr.py', 'exec' ))
>
>   (at least, that line is reported to work in Python 3).
>   Now you can do each step in isolation (untested):
>
> a = open( 'myscr.py', 'rb' )
> b = a.read()
> c = compile( b, 'myscr.py', 'exec' )
> d = exec( c )
>
>   to find the step where it hangs. Then maybe you can do this
>   analysis recursively with this step until you have found the
>   exact elementary statement or expression where it hangs.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using __init__.py

2017-09-06 Thread nopsidy
https://www.youtube.com/watch?v=pNe1wWeaHOU&list=PLYI8318YYdkCsZ7dsYV01n6TZhXA6Wf9i&index=1
Thank you,
-Alex Goretoy
http://launchpad.net/~a1g


On Wed, Sep 6, 2017 at 6:42 PM, Steve D'Aprano
 wrote:
> On Wed, 6 Sep 2017 07:30 pm, Kryptxy wrote:
>
>> I am working on a (cross-platform) project. On linux system, the imprts work
>> fine, but in windows I get imort error (I have no idea why. I tried searching
>> everywhere, but couldn't get it to work). Anyways, the issue seem to be
>> resolved by adding project directory to sys.path().
>>
>> I wanted to know that can I use __init__.py file for adding a project
>> directory to sys.path (sys.path.insert(0, directory))?
>
> That is the wrong way to fix this problem. It might work, for a little while,
> but then something will change, or you will do something just a tiny bit
> different, and it will break again.
>
> The first step is to debug why you are getting the import error. You cannot 
> fix
> a problem until you know what it is: what you fix by accident will break by
> accident.
>
> Start by telling us the full path to your project directory, and the full
> contents of sys.path.
>
> Do not try to retype them from memory. Accuracy is essential: copy and paste 
> the
> paths so that they are accurate.
>
>
> Thank you.
>
>
>
> --
> Steve
> “Cheer up,” they said, “things could be worse.” So I cheered up, and sure
> enough, things got worse.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ANN: Docpicture 0.2

2008-11-02 Thread nopsidy

André wrote:

Docpicture 0.2 has been released.  You can download it from
http://code.google.com/p/docpicture/

Docpicture's goal is to enable embedding pictures inside Python
docstrings using some custom domain specific language (dsl).
docpicture includes a plugin architecture enabling users to extend it
by adding new dsl parsers.  Docpicture behaves as an enhanced help()
for Python.  It requires a default browser capable of displaying svg
images (e.g. Firefox 3)

===
This version of docpicture can display the following type of images:

1. turtles (!)
2. images downloaded from the web (in any format)
3. Mathematical equations  (requires matplotlib)
4. UML sequence diagrams (require a live internet connection)
5. Full matplotlib plots.

This is very much a proof-of-concept version.  Comments and
suggestions are most welcome.  Code contributions [for other types of
images] even more so. ;-)

André Roberge


I've looked thru some of the project code. It's good stuff. Thanks -nop
--
http://mail.python.org/mailman/listinfo/python-list


Re: CAD.py

2008-11-02 Thread nopsidy

r wrote:

On Nov 1, 7:13 pm, infixum <[EMAIL PROTECTED]> wrote:

[EMAIL PROTECTED] wrote:

r> I am currently looking to create a small CAD program with python.
Instead of starting from scratch how about extending PythonCAD instead:
   http://www.pythoncad.org/
Skip

ThanCAD might have a few ideas too.
Carl T.


Thanks for the replies:
I tried pythoncad but all links to source are broken
I even contacted devoloper and he gave me a link that also is
broken...hmm
I also tried thancad, did get it to download but cant run it yet...
but anyway thanks again i will keep trying.

you can use git to get the source of pythoncad

git clone git://repo.or.cz/pythoncad.git

-nop
--
http://mail.python.org/mailman/listinfo/python-list


Re: OS independent way to check if a python app is running?

2009-12-14 Thread nopsidy
one way is you can create a lock file, then when the program start you check
to see if this lock file exists.


-Alex Goretoy
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unzip File un Python 5.5

2010-07-21 Thread nopsidy
hi,

hope this helps.

http://www.google.com/search?hl=en&q=unzip+file+in+python
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: difficulty in understanding rsplit(None,1)[1]

2009-09-22 Thread nopsidy
lol
-nop nop nop
-- 
http://mail.python.org/mailman/listinfo/python-list