Thread View: pl.comp.lang.python
2 messages
2 total messages
Started by grizleyd
Thu, 16 Apr 2015 10:37
Definicje funkcji do modułów
Author: grizleyd
Date: Thu, 16 Apr 2015 10:37
Date: Thu, 16 Apr 2015 10:37
32 lines
1608 bytes
1608 bytes
witam
mam zbiór roznych modułów i chce z nich wyłuskać
wszystkie definicje funkcji stały klas itp
tak jak jest to w c++
czy jest jakies narzedzie do tego ??
z test.py chce otrzymac test_definicje.py
np
test.py
def foo():
print("aaa")
def foo2():
print("aaa")
def foo3():
print("aaa")
test_definicje.py
def foo()
def foo2()
def foo3()
# i tak samo dla klas , stalych
Re: Definicje funkcji do modułów
Author: Jordan Szubert
Date: Thu, 16 Apr 2015 12:44
Date: Thu, 16 Apr 2015 12:44
48 lines
1555 bytes
1555 bytes
Dnia 16-04-2015 o 12:37:20 <grizleyd@gmail.com> napisał(a):
> witam
> mam zbiór roznych modułów i chce z nich wyłuskać
> wszystkie definicje funkcji stały klas itp
>
> tak jak jest to w c++
> czy jest jakies narzedzie do tego ??
>
>
> z test.py chce otrzymac test_definicje.py
>
> np
>
> test.py
>
> def foo():
> print("aaa")
> def foo2():
> print("aaa")
> def foo3():
> print("aaa")
>
>
>
> test_definicje.py
>
>
> def foo()
> def foo2()
> def foo3()
>
>
> # i tak samo dla klas , stalych
jaki powinien byc wynik dla kodu:
import random
if random.random()<0.5:
def a(x,y):
pass
else:
class B(dict):
pass
--
Jordan Szubert
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads