Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
b24e3477
Kaydet (Commit)
b24e3477
authored
Eki 13, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #621891: Add askopenfile{name}s.
üst
2ec36271
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
5 deletions
+38
-5
tkFileDialog.py
Lib/lib-tk/tkFileDialog.py
+33
-1
NEWS
Misc/NEWS
+5
-4
No files found.
Lib/lib-tk/tkFileDialog.py
Dosyayı görüntüle @
b24e3477
...
...
@@ -29,12 +29,16 @@
#
# - title: dialog title
#
# - multiple: if true user may select more than one file
#
# options for the directory chooser:
#
# - initialdir, parent, title: see above
#
# - mustexist: if true, user must pick an existing directory
#
#
from
tkCommonDialog
import
Dialog
...
...
@@ -98,7 +102,18 @@ def asksaveasfilename(**options):
return
SaveAs
(
**
options
)
.
show
()
# FIXME: are the following two perhaps a bit too convenient?
def
askopenfilenames
(
**
options
):
"""Ask for multiple filenames to open
Returns a list of filenames or empty list if
cancel button selected
"""
options
[
"multiple"
]
=
1
files
=
Open
(
**
options
)
.
show
()
return
files
.
split
()
# FIXME: are the following perhaps a bit too convenient?
def
askopenfile
(
mode
=
"r"
,
**
options
):
"Ask for a filename to open, and returned the opened file"
...
...
@@ -108,6 +123,23 @@ def askopenfile(mode = "r", **options):
return
open
(
filename
,
mode
)
return
None
def
askopenfiles
(
mode
=
"r"
,
**
options
):
"""Ask for multiple filenames and return the open file
objects
returns a list of open file objects or an empty list if
cancel selected
"""
files
=
askopenfilenames
(
**
options
)
if
files
:
ofiles
=
[]
for
filename
in
files
:
ofiles
.
append
(
open
(
filename
,
mode
))
files
=
ofiles
return
files
def
asksaveasfile
(
mode
=
"w"
,
**
options
):
"Ask for a filename to save as, and returned the opened file"
...
...
Misc/NEWS
Dosyayı görüntüle @
b24e3477
...
...
@@ -348,11 +348,12 @@ Extension modules
Library
-------
-
Various
features
of
Tk
8.4
are
exposed
in
Tkinter
.
py
.
-
Various
features
of
Tk
8.4
are
exposed
in
Tkinter
.
py
.
The
multiple
option
of
tkFileDialog
is
exposed
as
function
askopenfile
{,
name
}
s
.
-
Various
configure
methods
of
Tkinter
have
been
stream
-
lined
,
so
t
hat
tag_configure
,
image_configure
,
window_configure
now
return
a
dictionary
when
invoked
with
no
argument
.
-
Various
configure
methods
of
Tkinter
have
been
stream
-
lined
,
so
that
t
ag_configure
,
image_configure
,
window_configure
now
return
a
dictionary
when
invoked
with
no
argument
.
-
Importing
the
readline
module
now
no
longer
has
the
side
effect
of
calling
setlocale
(
LC_CTYPE
,
""
).
The
initial
"C"
locale
,
or
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment