Re: Searching for a file

2025-05-28 Thread Roland Mueller via Python-list
ke 28.5.2025 klo 1.45 Thomas Passin (li...@tompassin.net) kirjoitti: > On 5/27/2025 10:41 AM, Roland Mueller via Python-list wrote: > > To get a list of files in a given directory one can use glob.glob and > > The OP had a different problem. He wanted to find a config file of &g

Re: Searching for a file

2025-05-27 Thread Roland Mueller via Python-list
When answering I saw only the post from Peter. Everything else was in SPAM folder. GMail was so kind to move the "junk" mails to my Inbox after pressing SENT :-) My code works in Linux but with a small change it should work in Windows too. ti 27.5.2025 klo 17.41 Roland Mueller (

Re: Searching for a file

2025-05-27 Thread Roland Mueller via Python-list
To get a list of files in a given directory one can use glob.glob and os.path.isfile >>> from os.path import isfile >>> from glob import glob >>> files_in_var_tmp = [f for f in glob('/var/tmp/*') if isfile(f) ] For several directories iterate over the dirs and add the resulting list of files. >>

Re: Chardet oddity

2024-10-24 Thread Roland Mueller via Python-list
ke 23. lokak. 2024 klo 20.11 Albert-Jan Roskam via Python-list ( python-list@python.org) kirjoitti: >Today I used chardet.detect in the repl and it returned windows-1252 >(incorrect, because it later resulted in a UnicodeDecodeError). When I > ran >chardet as a script (which uses Unive

Re: HTML extraction

2021-12-07 Thread Roland Mueller via Python-list
Hello, ti 7. jouluk. 2021 klo 20.08 Chris Angelico (ros...@gmail.com) kirjoitti: > On Wed, Dec 8, 2021 at 4:55 AM Julius Hamilton > wrote: > > > > Hey, > > > > Could anyone please comment on the purest way simply to strip HTML tags > > from the internal text they surround? > > > > I know Beautif

Re: Return

2021-12-07 Thread Roland Mueller via Python-list
Hello ti 7. jouluk. 2021 klo 19.47 vani arul (arulvan...@gmail.com) kirjoitti: > Hey There, > Can someone help to understand how a python function can return value with > using return in the code? > It is not not about explicit or implicit function call. > > Not sure whether I understood your que

Re: Free OCR package in Python and selecting appropriate widget for the GUI

2021-09-22 Thread Roland Mueller via Python-list
Hello, ti 21. syysk. 2021 klo 16.53 Mohsen Owzar (mohsen.ow...@gmail.com) kirjoitti: > Hi Guys > Long time ago I've written a program in Malab a GUI for solving Sudoku > puzzles, which worked not so bad. > Now I try to write this GUI with Python with PyQt5 or TKinter. > First question is: > Is t

Re: Change the display style of the text on the STACKLINE.

2021-09-10 Thread Roland Mueller via Python-list
pe 10. syysk. 2021 klo 17.22 Greg Ewing (greg.ew...@canterbury.ac.nz) kirjoitti: > On 10/09/21 6:11 pm, Roland Mueller wrote: > > When I call print(s) it even shows ABCD and D is underscored. But > copying > > the output to mail looses the underscore ... > > If the term

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread Roland Mueller via Python-list
pe 10. syysk. 2021 klo 8.53 hongy...@gmail.com (hongyi.z...@gmail.com) kirjoitti: > On Thursday, September 9, 2021 at 8:57:37 PM UTC+8, Roland Mueller wrote: > > Hello > > > > to 9. syysk. 2021 klo 6.53 hongy...@gmail.com (hongy...@gmail.com) > > kirjoitti: > >

Re: Change the display style of the text on the STACKLINE.

2021-09-09 Thread Roland Mueller via Python-list
Hello to 9. syysk. 2021 klo 6.53 hongy...@gmail.com (hongyi.z...@gmail.com) kirjoitti: > I'm using the following code in my forked project [1]: > > percol.view.STACKLINE = 'Fold:F1,F2,F3 Push:C-p Pop:M-p Script:M-s Dir:M-d > Dircmd:M-b' > > I would like to change the display style of the text men

Re: Flask – how to write csv file & save using prefilled value of the filename (response.headers["Content-Disposition"]="attachment; filename=xxx")

2021-08-09 Thread Roland Mueller via Python-list
pe 6. elok. 2021 klo 19.15 MRAB (pyt...@mrabarnett.plus.com) kirjoitti: > On 2021-08-06 16:50, Suretha Weweje wrote: > > I am trying to upload a CSV file with flask, read and process one line > at a > > time while iterating through all rows of the file and write the results > > back to a new CSV f

Re: Where to keep local Python modules?

2021-07-23 Thread Roland Mueller via Python-list
Hello, pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > This isn't a question about how to set PYTHONPATH so that Python code > can find imported modules, it's about what is a sensible layout for > one's home directory - i.e. where to put Python modules. > > I'm running Linu

Re: pyttsx3 installation error

2021-07-02 Thread Roland Mueller via Python-list
What's about installing? https://pypi.org/project/pyttsx3/ pe 2. heinäk. 2021 klo 23.41 Nikita Lohale (nikitalohal...@gmail.com) kirjoitti: > Traceback (most recent call last): > File "f:\Nikita\Python programming\Iron Man Jarvis AL\jarvis.py", line > 1, in > import pyttsx3 > ModuleNotFoun

Re: is not recognized as an internal or external command, operable program or batch file.

2021-03-02 Thread Roland Mueller via Python-list
Hello, this is windows setup issue related to the fact that python binary is not in execution path. For setting up you may find instructions by searching for "windows 10 put python to path". One result is following page: https://superuser.com/questions/143119/how-do-i-add-python-to-the-windows-pat

Re: Troubles with Python imports

2021-02-10 Thread Roland Mueller via Python-list
ke 10. helmik. 2021 klo 5.07 Terry Reedy (tjre...@udel.edu) kirjoitti: > On 2/9/2021 9:55 AM, Philipp Daher via Python-list wrote: > > Hello, > > > > I’ve just typed „pip install selenium“ into my command prompt on windows > 10. Although my computer told me that the requirement was already > satis

Re: Python 3.9. 1 not working

2021-02-10 Thread Roland Mueller via Python-list
Hello, Please note that this is not a kind of support service rather than a community where people help each other on voluntary base. In order to get help from here, you should provide enough information about your issue with Python 3.9 that others can figure out what happened. BR, Roland ke 10

Re: ONE CLICK REST API

2016-04-05 Thread Roland Mueller via Python-list
You may have a look at Django-based REST framework - http://www.django-rest-framework.org/ or Flask-RESTful - https://pypi.python.org/pypi/Flask-RESTful - http://flask-restful-cn.readthedocs.org/en/0.3.4/ Last not least here is some article about implementing a REST API using Flask for

Re: What's the best way to extract 2 values from a CSV file from each row systematically?

2013-09-27 Thread Roland Mueller
Hello, 2013/9/24 Alex Lee > Thanks for the help guys! I'll definitely read up on the csv module > documentation. > > Tim, that's incredibly helpful, thanks a lot! :) My CSV file doesn't have > headers, but I'm sure I can just as easily add it in manually. > a better way to provide column header

Re: round off to two decimal & return float

2013-03-30 Thread Roland Mueller
2013/3/30 Roland Mueller > Hello, > > 2013/3/30 ஆமாச்சு > >> Consider the scenario, >> >> >> a = 10 >> >> "{0:.2f}".format(a) >> '10.00' >> >> This returns a string 10.00. But what is the preferred method to

Re: round off to two decimal & return float

2013-03-30 Thread Roland Mueller
Hello, 2013/3/30 ஆமாச்சு > Consider the scenario, > > >> a = 10 > >> "{0:.2f}".format(a) > '10.00' > > This returns a string 10.00. But what is the preferred method to retain > 10.0 (float) as 10.00 (float)? > > I assume you have a numeric value a and want to have a float with 2 decimals. This c

Re: returning all matching groups with re.search()

2011-02-10 Thread Roland Mueller
Hello, On 02/07/2011 06:26 PM, Mauro Caceres wrote: >>> import re >>> help(re.findall) Help on function findall in module re: findall(pattern, string, flags=0) Return a list of all non-overlapping matches in the string. If one or more groups are present in the pattern, return a list

Re: stripping fields from xml file into a csv

2010-02-28 Thread Roland Mueller
2010/2/28 Stefan Behnel > Roland Mueller, 28.02.2010 13:01: > > The stylesheet is test.xsl and the insput data test.xml. The following > > Python code the applies the stylesheet on the input data and puts the > output > > into foo. > > > > Python code:

Re: stripping fields from xml file into a csv

2010-02-28 Thread Roland Mueller
Hello, 2010/2/28 Stefan Behnel > Hal Styli, 27.02.2010 21:50: > > I have a sed solution to the problems below but would like to rewrite > > in python... > > Note that sed (or any other line based or text based tool) is not a > sensible way to handle XML. If you want to read XML, use an XML parse

Re: can it be shorter?

2009-06-08 Thread Roland Mueller
2009/6/8 Aaron Brady > On Jun 7, 6:13 pm, Paul Rubin wrote: > > Aaron Brady writes: > > > url+= { '/': '' }.get( url[ -1 ], '/' ) > > > > > Shorter is always better. > > > > url = url.rstrip('/') + '/' > > I was joking. Sheesh. > -- > http://mail.python.org/mailma

Re: 403 error for python webpage

2009-06-08 Thread Roland Mueller
2009/6/7 Daniel > I created a page with a ".py" extension but the browser does not like > it. > Here is what I did: I edited httpd.conf file and added the line: > AddHandler cgi-script .cgi .py > Then I stopped and restarted apache. Next I created a hello world file > as on this page: > http://de