Re: Best practice for config files?

2025-05-23 Thread c . buhtz
Hello Michael, thank you for your important question. On GNU/Linux (and maybe for POSIX?) systems there is a standard about it. Look for $XDG_CONFIG_HOME. To drive it further, you might distinguish between config data (related and

Re: [pygettext] --package-name and --package-version unknown

2023-05-05 Thread c . buhtz
Thanks for the answer. Am 05.05.2023 03:24 schrieb aapost: pygettext is deprecated since xgettext supports python now, so using xgettext is recommended. If this is the official case then it should be mentioned in the python docs. The 3.11 docs still tell about pygettext and xgettext and don't

[pygettext] --package-name and --package-version unknown

2023-05-04 Thread c . buhtz
Hello, am I right to assume that "pygettext" is part of the official Python3 "package"? So it is OK to aks here? I do use pygettext to handle po and pot files. In the manpage I'm not able to find help about this. I would like to modify the header that pygettext does create in each po-file.

Re: subprocess equivalent for "os.execvp()"?

2023-01-09 Thread c . buhtz
Dear Eryk, Am 08.01.2023 17:22 schrieb Eryk Sun: Avoid using any of the `os.exec*` functions on Windows. There's no support for replacing a Windows process image, so the `exec*()` functions simply spawn a child process and terminate the current one. Thanks for bringing this up. On Python for

Re: What should go to stdout/stderr and why Python logging write everything to stderr?

2023-01-03 Thread c . buhtz
Am 03.01.2023 17:51 schrieb r...@zedat.fu-berlin.de: logging.getLogger().addHandler( logging.StreamHandler( sys.stdout )) But I don't want to make all log levels go to stdout. Just DEBUG and INFO. But this would be a workaround. The main question here is why does Python deciecded to make all

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-19 Thread c . buhtz
Dear Chris, thanks for asking back and my apologize for being to broad in my way of asking (in a foreign language). Am 19.12.2022 07:40 schrieb Chris Angelico: Hmm, then I'm not sure what you're *losing* here. The problem, as I understand it, is that the scripts are getting installed into /usr

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Dear Barry, thanks for reply and asking back. Am 18.12.2022 22:33 schrieb Barry: Why are asking on this list and discuss.python.org? To be exact I'm asking in the "Packaging" section of "discuss.python.org". To my knowledge that section is the official channel of "pypa/pip" project pointed t

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Am 18.12.2022 22:37 schrieb Mats Wichmann: the which command uses your PATH, so I'm not sure you're buying anything new there I'm using which before entering pkexec. ;) I'll show a demonstrator project later. -- https://mail.python.org/mailman/listinfo/python-list

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Dear Chris, thank you for your reply. Am 18.12.2022 20:27 schrieb Chris Angelico: Does it have to be in path? Can't you say /usr/local/bin/entrypointname? Not sure what constitutes an elegant solution here. I asked that myself. My current solution do determine the full path of the entrypoint

Re: pip/setuptools: Entry points not visible from pkexec-root-environment

2022-12-18 Thread c . buhtz
Dear Gerard, thank you for your reply. Am 18.12.2022 19:45 schrieb Weatherby,Gerard: "sudo python3 -m pip install -e ." You’ve already started down a problematic road. I recommend installing root level Python packages through your system package manager. (apt for debian, or whatever RedHat is u

How to get the current set LOG_MASK in Python's syslog module?

2022-09-22 Thread c . buhtz
X-Post: https://stackoverflow.com/q/73814924/4865723 Hello, I'm aware that there is a `logging` package that is more _modern_ then [`syslog`](https://docs.python.org/3/library/syslog.html). But I have old code here to deal with that does use `syslog`. So that question is specific to `syslog`

Re: Which architectures to support in a CI like Travis?

2022-09-19 Thread c . buhtz
Dear Mats, thanks for the reply. Am 19.09.2022 16:10 schrieb Mats Wichmann: Kind of unrelated to the actual question, but if you start doing anything serious under Travis you'll run out of free minutes rather quickly. My project had to just give up on it after they changed their licensing mode

venv and packages with entry points

2022-09-06 Thread c . buhtz
Hello, I try to get it onto my head how virtual environments (via venv) works when I have packages with "entry points". I can define such entry points in the setup.cfg like this (full example [1]): [options.entry_points] console_scripts = hyperorg = hyperorg.__main__:main When I instal

PEP about recommended project folder layout

2022-07-26 Thread c . buhtz
Hello, I am not sure if I looked into the correct sources. I was looking in "PEP 609 – Python Packaging Authority (PyPA) Governance" [1] and the "PyPA specifications" [2]. My question in short: Is there an official document (e.g. a PEP) about a recommended layout for project folders. Looki

Standarize TOML?

2021-05-16 Thread Jason C. McDonald
eason not to adopt pyproject.toml...and the topic thus became weirdly political. I understand that Brett Cannon intends to bring this up at the next language summit, but, ah, might as well put the community two-cents in now, hey? I, for one, feel like this is obvious. -- Jason C. McDonald (CodeMo

Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-09 Thread Jason C. McDonald
e the aforementioned on further inspection. (But I don't know all cases either.) > I do agree asking people to simply not be stupid doesn't seem to work > these days for whatever reason. I hadn't noticed. ;) -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-08 Thread Jason C. McDonald
SS > person is ever called for any possibly disrespecting words or > behavior. A fluffy cloud echo chamber where everybody just accepts > and respects you for what you are. Does the concept sound familiar? > > > P.S.: *NOT* among the core symptoms of (the high-functioning levels) > of ASS is the inability to learn. Mind that! (And that includes > social norms.) -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: Bloody rubbish

2021-05-08 Thread Jason C. McDonald
s open > source on github. > > Claim #2, "he invented smartphones": > > Yes, he did (as part of a team) create the first smartphone, > the Ericsson R380: > > https://en.wikipedia.org/wiki/Ericsson_R380 > > /Toaster -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: for the installation of pycharm

2021-05-08 Thread Jason C. McDonald
t; > > > >Sent from [1]Mail for Windows 10 > > > > References > >Visible links > 1. https://go.microsoft.com/fwlink/?LinkId=550986 -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: Bloody rubbish

2021-05-08 Thread Jason C. McDonald
on turns out to >> be something other than python? > > And it's bizarre that the OP, since he despises Python so much, and > finds its syntax absurd, would even bother to make any sort of > implementation of it. > -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
Hey Avi, I am a long time R user now using Python. So, this is my attempt to master the language. The problem for me is that I often have an idea about how things are done in R, but not sure to what functions are available in Python. I hope that clears up some confusion. Cheer! On Sun, Feb 21,

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
I got it to work! I defined a separate function, and put it into df['col_1'].apply(). Not the most elegant, but it worked. I'm also curious how people on this mailing list would do it. Cheers! On Sun, Feb 21, 2021 at 9:21 AM C W wrote: > I do want to follow up, if I may.

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
y(), df['col_1'].apply(lambda:a int("".join(map(lambda x: str((int(x)-3)%10) ,list(str(a)) Thanks! On Sun, Feb 21, 2021 at 9:12 AM C W wrote: > Thanks so much everyone, I appreciate it! > > Ming, your solution is awesome. More importantly, very clear explanations &

Re: Is there a way to subtract 3 from every digit of a number?

2021-02-21 Thread C W
Thanks so much everyone, I appreciate it! Ming, your solution is awesome. More importantly, very clear explanations on how and why. So, I appreciate that. Thanks again, cheers! Mike On Sun, Feb 21, 2021 at 12:08 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2021-02-20 at 20:49:15 -0800,

Is there a way to subtract 3 from every digit of a number?

2021-02-20 Thread C W
Hello everyone, I'm curious if there is a way take number and back each digit by 3 ? 2342 becomes 9019 8475 becomes 5142 5873 becomes 2540 The tricky part is that 2 becomes 9, not -1. Here's my toy example and what I attempted, > test_series = pd.Series(list(['2342', '8475', '5873'])) > test_se

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Great tutorial Irv, very simple with if-else example, gets the point across. My main takeaway from the discussion so far is that: you can't troubleshoot Python without some kind of breakpoint or debugger. I suppose I can't take the functional programming debugger style like C, Matlab,

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I meant bottom right corner, not left. opps! On Wed, Jan 27, 2021 at 3:36 PM C W wrote: > I don't know exactly, but it shows as inspection on the bottom left corner. > > I believe it's indexing in the background. > > On Wed, Jan 27, 2021 at 3:25 PM Grant Edwards >

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I don't know exactly, but it shows as inspection on the bottom left corner. I believe it's indexing in the background. On Wed, Jan 27, 2021 at 3:25 PM Grant Edwards wrote: > On 2021-01-27, C W wrote: > > I'm not expert in Python, but I sure tried many IDEs to kick of

Re: IDE tools to debug in Python?

2021-01-27 Thread C W
I'm not expert in Python, but I sure tried many IDEs to kick off Python programming. I started with PyCharm, but I had a problem with it constantly scanning the background, even after I turned that feature off. My favorite (I'm using now) is VS Code with Python extension, it's very light. Recentl

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
ts on here are approaching and debugging this. Bonus if no debugger or breakpoint. Just the good ol' run the function and evaluate/print output for problems. Thanks so much, Mike On Wed, Jan 27, 2021 at 10:53 AM Michael Torrie wrote: > On 1/26/21 10:19 PM, C W wrote: > > Tr

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-27 Thread C W
Hi Cameron, Yes, you are correct in all above. There's a mistake in my copy paste. Thanks for pointing that out! On Wed, Jan 27, 2021 at 12:58 AM Cameron Simpson wrote: > On 27Jan2021 00:19, C W wrote: > >Here's the code again, class should be called PERSONDatabase, >

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
27;created_at'], KeyError: 'created_at' Thank you very much! On Wed, Jan 27, 2021 at 12:10 AM Michael Torrie wrote: > On 1/26/21 8:37 PM, C W wrote: > > I have a naive question. How do I use traceback or trace the stack? In > > particular, I'm using VS Cod

Re: How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Thanks for your replies. My apologies for the poor indent. I'm rewriting the code below. class NEODatabase: def __init__(self, id, created_at, name, attend_date, distance): self._id = id self.created_at = created_at self.name = name self.attend_date = attend_date self.distance = distance @classme

How do you debug in Python? Coming from a Matlab and R user. I'm already aware of pdb.

2021-01-26 Thread C W
Hello everyone, I'm a long time Matlab and R user working on data science. How do you troubleshooting/debugging in Python? I ran into this impossible situation to debug: class person: def __init__(self, id, created_at, name, attend_date, distance): """Create a new `person`. """ self._id = id self

Re: Getting rid of virtual environments with a better dependency system

2020-11-11 Thread j c
On Wednesday, 11 November 2020 at 12:22:24 UTC+1, Chris Angelico wrote: > On Wed, Nov 11, 2020 at 10:06 PM j c wrote: > > > > Hello all, > > > > I don't know if this suggestion is missing some point, or it's part of > > something already propos

Getting rid of virtual environments with a better dependency system

2020-11-11 Thread j c
Hello all, I don't know if this suggestion is missing some point, or it's part of something already proposed. In a professional environment, we've came to a point in which most people use virtual environments or conda environments to avoid "polluting a global environment". However, I think th

Getting rid of virtual environments with a better dependency system

2020-11-11 Thread j c
Hello all, I don't know if this suggestion is missing some point, or it's part of something already proposed before. In a professional environment, we've came to a point in which most people use virtual environments or code environments to avoid "polluting a global environment". However, I th

Re: new feature in Python.

2020-09-30 Thread Jason C. McDonald
ators and abuse them thusly, that's a consenting adults situation. Introducing this new syntax into the language creates a trip hazard for the user. Third, that proposed operator, .=  oww that's hard to see. It looks like a typo, and could easily be typed as one, or overlooked altogether (ag

Re: I was really uncomfort with any programming...

2020-06-06 Thread Jason C. McDonald
well, but that doesn't mean they'll necessarily enjoy it. I'm actually rather curious why you *need* to become "efficient" (proficient?) in Python? Work requirement? By the way, you should put your message the the BODY of the email, not in the subject line. Keep subject lin

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
On Sat, 09 May 2020 17:24:41 +0200, Python wrote: > Joydeep C wrote: >> On Sat, 09 May 2020 15:46:27 +0200, Python wrote: >> >>> Joydeep C wrote: >>>> On Sat, 09 May 2020 14:42:43 +0200, Python wrote: >>>> >>>>> Joydeep wrote: >

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
On Sat, 09 May 2020 15:46:27 +0200, Python wrote: > Joydeep C wrote: >> On Sat, 09 May 2020 14:42:43 +0200, Python wrote: >> >>> Joydeep wrote: >>>> I have a Pandas dataframe like below. >>>> >>>> XY >>>> 0 12

Re: Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
On Sat, 09 May 2020 14:42:43 +0200, Python wrote: > Joydeep wrote: >> I have a Pandas dataframe like below. >> >> XY >> 0 1234567890 1 54321N/A 2 67890123456 >> >> I need to make these numbers comma formatted. For example, 12345 => >> 12,345. > > >>> value = 12345 f

Pandas Dataframe Numbers Comma Formatted

2020-05-09 Thread Joydeep C
I have a Pandas dataframe like below. XY 0 1234567890 1 54321N/A 2 67890123456 I need to make these numbers comma formatted. For example, 12345 => 12,345. Please help. Thanks. -- https://mail.python.org/mailman/listinfo/python-list

Re: Logistic Regression Define X and Y for Prediction

2019-11-14 Thread Mike C
Hi Jason, I will try it out... Nothing in the documentation tells a person. Thanks From: Python-list on behalf of Jason Friedman Sent: Wednesday, November 13, 2019 7:19 PM Cc: python-list@python.org Subject: Re: Logistic Regression Define X and Y for Predicti

Logistic Regression Define X and Y for Prediction

2019-11-12 Thread Mike C
ure.dpi'] = 400 ​ import matplotlib.pyplotas plt ​ ​ # Importing the df​ # Importing the df​ os.chdir('c:\directory\data')# Location of data files​ df = pd.read_csv('blahblahfile.csv')​ ​ from sklearn.preprocessing import LabelEncoder​ hostip = Label

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-04 Thread Mike C
mmendation? Rhodri James wrote: ... > I completely agree. I too have come from a background in C, and still > do most of my day job in C or assembler. It took a while before I was > writing idiomatic Python, never mind efficient Python (arguably I still > don't, but as Rob says, who car

Re: Python indentation (3 spaces)

2018-10-07 Thread C W Rose via Python-list
Ryan Johnson wrote: > The point that OP is trying to make is that a fixed standard that is > distinguishable from the even-spacing Tab-length convention in code and > text editors will establish a level of trust between the end developer and > upstream developers or co-developers who may not have

Re: Why list.reverse() modifies the list, but name.replace() does not

2018-09-05 Thread Mike C
Mark Lawrence Sent: Monday, September 3, 2018 2:21:36 PM To: python-list@python.org Subject: Re: Why list.reverse() modifies the list, but name.replace() does not modify the string? On 03/09/18 18:49, C W wrote: > Hello all, > > I am learning the basics of Python. How do I know when a m

Why list.reverse() modifies the list, but name.replace() does not

2018-09-05 Thread C W
Hello all, I am learning the basics of Python. How do I know when a method modifies the original object, when it does not. I have to exmaples: Example 1: > L = [3, 6, 1,4] > L.reverse() > L [4, 1, 6, 3] This changes the original list. Example 2: > name = "John Smith" > name.replace("J", j") > nam

Re: Why list.reverse() modifies the list, but name.replace() does not modify the string?

2018-09-03 Thread Mike C
f of Mark Lawrence Sent: Monday, September 3, 2018 2:21:36 PM To: python-list@python.org Subject: Re: Why list.reverse() modifies the list, but name.replace() does not modify the string? On 03/09/18 18:49, C W wrote: > Hello all, > > I am learning the basics of Python. How do I know

Why list.reverse() modifies the list, but name.replace() does not modify the string?

2018-09-03 Thread C W
Hello all, I am learning the basics of Python. How do I know when a method modifies the original object, when it does not. I have to exmaples: Example 1: > L = [3, 6, 1,4] > L.reverse() > L [4, 1, 6, 3] This changes the original list. Example 2: > name = "John Smith" > name.replace("J", j") > nam

Re: Python list vs google group

2018-06-15 Thread C W
I recently posted two questions, but never got any replies. I am still wondering if it was ever posted, or maybe the question was too trivial? I think someone would have at least shouted if it was too trivial or off-topic, right? On Fri, Jun 15, 2018 at 12:03 PM, Mark Lawrence wrote: > On 15/06

What data types does matplotlib pyplot take?

2018-06-13 Thread C W
Hi everyone, I'm curious what data types pyplot takes. It seems that it can take numpy series, pandas series, and possibly pandas dataframe? How many people data types are out there? Is that true for all functions in like hist(), bar(), line(), etc? Is there an official documentation that lists t

In Pandas, can you do groupby in on two different datasets?

2018-06-09 Thread C W
Dear all, I want find the average ratings of movies by movieId. Below is ratings.head() of the dataset. > ratings.head() userId movieId rating timestamp parsed_time 0 12 3.5 1112486027 2005-04-02 23:53:47 1 1 29 3.5 1112484676 2005-04-02 23:31:16 2

EuroPython 2018: First list of accepted sessions available

2018-05-31 Thread Alexander C. S. Hendorf
We have received an amazing collection of 376 proposals. Thank you all for your contributions! Given the overwhelming quality of the proposals, we had some very difficult decisions to make. Nonetheless we are happy to announce we have published the first 120+ sessions. https://ep2018.europython.eu

Re: Spam levels.

2018-05-22 Thread C W Rose via Python-list
m wrote: > W dniu 10.02.2018 o 15:57, C W Rose pisze: >> No other groups (in the limited set which I read) have the problem, >> and I don't understand why the spammers neither spam a range of >> groups, nor change their adddresses more frequently. It may be >> tha

Re: In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-02 Thread C W
Thanks, Chris. That makes sense. The len() example is great! On Tue, May 1, 2018 at 10:37 PM, Chris Angelico wrote: > On Wed, May 2, 2018 at 12:22 PM, C W wrote: > > It's interesting how mean() can be implemented, but median() will break > > other packages. > > > &

Re: In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-01 Thread C W
tuple has tuple methods, etc. Now, the default way in numpy is to use function instead of methods? I'm confused. What happened to object-oriented programming? Thanks, -M On Tue, May 1, 2018 at 3:38 PM, Thomas Jollans wrote: > On 01/05/18 19:57, C W wrote: > > matrix.median()

In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()?

2018-05-01 Thread C W
Hello everyone, In numpy, why is it ok to do matrix.mean(), but not ok to do matrix.median()? To me, they are two of many summary statistics. So, why median() is different? Here's an example code, import numpy as np matrix = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) # find the mean np.mean(ma

Re: Filtering computer.lang.python

2018-04-11 Thread C W Rose via Python-list
Thomas Jollans wrote: > > Welcome to python-list/comp.lang.python! > > This isn't originally a Google group. Google just mirrors the old USENET > group, which is awash with spam. > > There is also a mailing list version of this group (posts are mirrored > both ways) at https://mail.python.org/m

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
shift])) How to debug a particular chunk of code? Everything in OOP is self.myDict, self.shift_dict. So, I must run the entire code to test. I just want to try myDict('hello', 4), shift_dict(4), like how you would do in C language. Thank you! On Sun, Apr 1, 2018 at 11:13 PM, Steven D

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
no < steve+comp.lang.pyt...@pearwood.info> wrote: > On Sun, 01 Apr 2018 20:52:35 -0400, C W wrote: > > > Thank you all for the response. > > > > What if I have myDict = {'a': 'B', 'b': 'C',...,'z':'A' }? So

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
I am using Python 3.6. I ran the those lines and got a sorted dictionary by keys. On Sun, Apr 1, 2018 at 9:38 PM, Chris Angelico wrote: > On Mon, Apr 2, 2018 at 11:34 AM, C W wrote: > > A different but related question: > > > > myDict = dict(zip(string.ascii_lowercase + s

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
A different but related question: myDict = dict(zip(string.ascii_lowercase + string.ascii_uppercase, string.ascii_lowercase + string.ascii_uppercase)) >myDict {'A': 'A', 'B': 'B', 'C': 'C',...,'w': 'w', 'x&#x

Re: How to fill in a dictionary with key and value from a string?

2018-04-01 Thread C W
Thank you all for the response. What if I have myDict = {'a': 'B', 'b': 'C',...,'z':'A' }? So now, the values are shift by one position. key:abcdefghijklmnopqrstuvwxyz value: BCDEFGHIJKLMNOPQRSTUVWXYZA Can I fill in a key and its

How to fill in a dictionary with key and value from a string?

2018-03-30 Thread C W
Hello all, I want to create a dictionary. The keys are 26 lowercase letters. The values are 26 uppercase letters. The output should look like: {'a': 'A', 'b': 'B',...,'z':'Z' } I know I can use string.ascii_lowercase and string.ascii_uppercase, but how do I use it exactly? I have tried the foll

Re: Which part of the loop is it going through in this class frame?

2018-03-08 Thread C W
__init__(self, time): self.time = time def print_time(self): time = '6:30' print(self.time) clock = Clock('5:30') clock.print_time() 5:30 Thank you! On Thu, Mar 8, 2018 at 6:30 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info>

Which part of the loop is it going through in this class frame?

2018-03-07 Thread C W
Hello, I am new to OOP. I'm a bit confused about the following code. class Clock(object): def __init__(self, time): self.time = time def print_time(self): time = '6:30' print(self.time) clock = Clock('5:30') clock.print_time() 5:30 I set time to 6:30, but it's co

Respam levels.

2018-02-13 Thread C W Rose via Python-list
Having run a check for straightforward spam, I now find that there's a site editing and reposting non-spam posts. An example of the changed headers follows: Original post headers: > > From c...@seckford.org Sun Feb 11 23:23:22 2018 > Path: > eternal-september.org!reader02.eter

Spam levels.

2018-02-10 Thread C W Rose via Python-list
I've been reading a limited range of Usenet groups since the late 1980s, and until the recent problems in comp.lang.python had never bothered with any sort of filtering; it's easier just to ignore people. However, the sheer volume of spam in comp.lang.python finally defeated me, so I set up a fil

Why does Jupyter Notebook searches files in folders, but PyCharm and Sublime Text does not?

2017-12-14 Thread C W
Hi all, I am confused why Jupyter Notebook searches files in subfolder, but PyCharm and Sublime Text 3 does not. Is there a rule? For example, I have a module or file called lr_utils.py in the current folder. If I run the following line in Jupyter, it's fine. > import lr_utils But in PyCharm, I

I have anaconda, but Pycharm can't find it

2017-11-27 Thread nospam . C W
Hello all, I am a first time PyCharm user. I have Python 3 and Anaconda installed. They work together on Sublime Text, but not on Pycharm. Pycharm tells me it cannot find modules numpy, matplotlib, etc. What should I do? I tried to set the interpreter environment, and a few other options, none s

I have anaconda, but Pycharm can't find it

2017-11-26 Thread C W
Hello all, I am a first time PyCharm user. I have Python 3 and Anaconda installed. They work together on Sublime Text, but not on Pycharm. Pycharm tells me it cannot find modules numpy, matplotlib, etc. What should I do? I tried to set the interpreter environment, and a few other options, none s

Re: h5py.File() gives error message

2017-10-25 Thread C W
wow, thanks so much! I don't know how you figured that it's HTML, but that's awesome! Mike On Wed, Oct 25, 2017 at 5:20 AM, Peter Otten <__pete...@web.de> wrote: > C W wrote: > > > Oh, I was running a debug file, that's why the path is differen

Re: h5py.File() gives error message

2017-10-25 Thread C W
Oh, I was running a debug file, that's why the path is different. The file is here, https://www.dropbox.com/s/6jx4rzyg9xwl95m/train_catvnoncat.h5?dl=0 Is anyone able to get it working? Thank you! On Tue, Oct 24, 2017 at 10:37 PM, Dennis Lee Bieber wrote: > On Tue, 24 Oct 2017 18:02:26 -0700, R

h5py.File() gives error message

2017-10-24 Thread C W
Dear list, The following Python code gives an error message # Python code starts here: import numpy as np import h5py train_dataset = h5py.File('datasets/train_catvnoncat.h5', "r") # Python code ends The error message: train_dataset = h5py.File('train_catvnoncat.h5', "r") Traceback (most recen

make test on Centos 7.4 fails

2017-10-19 Thread Decker, Ryan C.
56\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 88) = 0 accept4(3, NULL, NULL, SOCK_CLOEXEC)= 4 sendto(4, "abc", 3, 0, NULL, 0) = -1 ENOKEY (Required key not available) +++ exited with 2 +++ Any

How to run self-contained Python scripts who don't need Python installation?

2017-06-08 Thread Juan C.
I need to run some Python 3.6.0 scripts on the users' machines (W7 and W10) in an enterprise environment, but I can't install Python on those machines. I tried looking for those "py to exe", but sadly they don't support Python 3.6.0. Then I found out about "Windows x86/x86-64 embeddable zip file" t

Re: How to create a Python 3.6 traceroute without SOCK RAW?

2017-02-23 Thread Juan C.
On Thu, Feb 23, 2017 at 7:42 PM, Irmen de Jong wrote: > > import os > os.system("traceroute www.google.com") Indeed, that would work, but it isn't a great approach in my opinion because I would rely on a system command, in this case Windows uses tracert while UNIX uses traceroute, one could fix t

How to create a Python 3.6 traceroute without SOCK RAW?

2017-02-23 Thread Juan C.
I need to implement a traceroute inside my script but I can't escalate privileges.  Unix uses UDP for traceroute, but I didn't find any material regarding UDP traceroute in Python. -- https://mail.python.org/mailman/listinfo/python-list

memory access ordering between processes in python 3.6

2017-02-14 Thread c . curtit
Hi everyone, I'm looking at building an application that allows lockless interprocess data passing using a ring buffer style (sorta) shared memory zone. My initial plan is to create a shared memory zone (probably using C functions thru ctypes), then write data to it with a writer process,

Re: What library/package to use for parsing XML?

2017-01-30 Thread Juan C.
On Mon, Jan 30, 2017 at 3:58 PM, Chris Green wrote: > I want to parse some XML data, it's the address book data from the > linux program osmo. The file I want to parse is like this:- Just like Irmen said, use the default xml.etree.ElementTree, it's amazing and very simple to use. -- https://mai

Re: What are your opinions on .NET Core vs Python?

2017-01-30 Thread Juan C.
On Sun, Jan 29, 2017 at 1:06 AM, Juan C. wrote: > > As you guys might know, .NET Core is up and running, promising a > "cross-platform, unified, fast, lightweight, modern and open source > experience" (source: .NET Core official site). What do you guys think about > it

What are your opinions on .NET Core vs Python?

2017-01-28 Thread Juan C.
As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource med

Re: Choosing a Python IDE. what is your Pythonish recommendation? I do not know what to choose.

2017-01-02 Thread Juan C.
On Mon, Jan 2, 2017 at 9:38 AM, Antonio Caminero Garcia < tonycam...@gmail.com> wrote: > The thing with the from-the-scratch full featured IDEs (Eclipse, IntelliJ, Pycharm) is that they look like a space craft dashboard and that unwarranted resources consumption and the unnecessary icons. I want my

Re: Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify (was: The right way to 'call' a class attribute inside the same class)

2016-12-12 Thread Juan C.
he class, the next one found in the class's Method Resolution Order will be called." - http://www.diveintopython3.net/iterators.html "The __init__() method is called immediately after an instance of the class is created. It would be tempting — but technically incorrect — to call this

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
- http://www.diveintopython3.net/iterators.html "The __init__() method is called immediately after an instance of the class is created. It would be tempting — but technically incorrect — to call this the “constructor” of the class. It’s tempting, because it looks like a C++ constructor (by con

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
neral consensus is that `__init__` shouldn't be called constructor as it isn't really a constructor (like Java/C# constructors). Some source: - http://stackoverflow.com/questions/4859129/python-and-python-c-api-new-versus-init - http://stackoverflow.com/questions/674304/pythons-u

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Juan C.
On Sun, Dec 11, 2016 at 11:34 PM, Steve D'Aprano wrote: > So... in summary: > > > When *assigning* to an attribute: > > - use `self.attribute = ...` when you want an instance attribute; > > - use `Class.attribute = ...` when you want a class attribute in > the same class regardless of which sub

The right way to 'call' a class attribute inside the same class

2016-12-11 Thread Juan C.
I'm watching a Python course and was presented a topic regarding classes. One of the examples were: box.py class Box: serial = 100 def __init__(self, from_addr, to_addr): self.from_addr = from_addr self.to_addr = to_addr self.serial = Box.serial Box.serial

Re: How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-03 Thread Juan C.
On Thu, Dec 1, 2016 at 10:07 PM, Juan C. wrote: > It works, but it has a big issue: it gets all data from all units/courses/assignments at the same time, and this isn't very useful as I don't care about data from units from 1-2 years ago. How can I change the logic so it just gets th

How to properly retrieve data using requests + bs4 from multiple pages in a site?

2016-12-01 Thread Juan C.
I'm a student and my university uses Moodle as their learning management system (LMS). They don't have Moodle Web Services enabled and won't be enabling it anytime soon, at least for students. The university programs have the following structure, for example: 1. Bachelor's Degree in Computer Scien

Fwd: Error message

2016-11-10 Thread Keenan C
To whom this may concern, I am continuously receiving this error after the installation of Python 3.5.2. The purpose of using this program is for a class I am currently enrolled in at a University. (I am running Windows 7 Home Premium 64-bit paired with an i3-2100 processor and 6 gb of ram. I d

Creating Dict of Dict of Lists with joblib and Multiprocessing

2016-04-20 Thread Sims, David (NIH/NCI) [C]
Hi, Cross posted at http://stackoverflow.com/questions/36726024/creating-dict-of-dicts-with-joblib-and-multiprocessing, but thought I'd try here too as no responses there so far. A bit new to python and very new to parallel processing in python. I have a script that will process a datafile an

Re: Pythonic love

2016-03-08 Thread Javier Novoa C.
justin walters writes: > Sorry about the top posting. I'm new to mailing lists. I should just reply > to the python-list@python.org address then? > > Also, thank you for the generator clarification. > On Mar 8, 2016 9:09 AM, "jmp" wrote: ^ that's top posting always reply inline or at the bo

Re: 2.7.9: PhotoImage get/put

2015-10-20 Thread C Smith
>> def process(): # Ordinarily this would be process(photo,wdth,hgt) >>global wdth # but I ran into problems calling it from a button If you want to pass arguments to a command called when a button is clicked, you have to use 'lambda' in tkinter. >>global hgt #command with parameters... >

Re: Problem with lists

2015-09-15 Thread C Smith
b' > elif lin == 6 or lin == 7: > peca['cor'] = 'p' > if lin == 1 or lin == 6: > peca['nome'] = 'p' > elif col == 0 or col == 7: >

Questions on Pandas

2015-06-25 Thread Tommy C
343 Q 340 M 338 J 337 F 335 K 334 H 330 [/code] I couldn't run the Series function successfully... is there something missing in this code? 4. [code] Data can also be exported to delimited format. Let's consider one of the CSV files read above: In [878]: data = pd.read_csv('ch06

New Python student needs help with execution

2015-06-10 Thread c me
I installed 2.7.9 on a Win8.1 machine. The Coursera instructor did a simple install then executed Python from a file in which he'd put a simple hello world script. My similar documents folder cannot see the python executable. How do I make this work? -- https://mail.python.org/mailman/listinf

Re: How to properly apply OOP in the bouncing ball code

2015-05-11 Thread Tommy C
.jpg") patrick.speed[0] = 5 patrick.speed[1] = 8 patrick.control() patrick.settings() jaws = BALL("jaws.jpg") jaws.speed[0] = 1 jaws.speed[1] = 10 jaws.control() jaws.settings() On Friday, May 8, 2015 at 11:40:46 AM UTC-4, Tommy C wrote: > I'm trying to apply OOP in this bou

  1   2   3   4   5   6   7   8   9   10   >