Re: Python Question re Executing a Script

2022-04-30 Thread Mike Dewhirst

On 1/05/2022 8:37 am, Brent Hunter wrote:

Hello,

I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 
bit).  I can't figure out from your documentation, how do I:


   1.  Run a python script that is located in the same directory ( 
C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 
3.10 )


   1.  How do I automatically run a python app at Windows startup?


https://www.windowscentral.com/how-launch-apps-automatically-during-login-windows-11

Personally, I write a batch file containing the 'python 
/location/of/script.py' command line and call that batch file. That 
assumes python.exe is on the Windows path.


Once tested and working it lets me edit the batch file to adjust the 
payload without having to touch the Windows stuff again.







Thank you!

Brent Hunter




--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.



OpenPGP_signature
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Question re Executing a Script

2022-04-30 Thread Dennis Lee Bieber
On Sat, 30 Apr 2022 22:37:35 +, Brent Hunter 
declaimed the following:

>Hello,
>
>I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 
>bit).  I can't figure out from your documentation, how do I:
>
>
>  1.  Run a python script that is located in the same directory ( 
> C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 
> 3.10 )
>

ONE: that path indicates that you installed Python "for current user
only".

TWO: that is the path for the short cut entry that shows up on the
Windows "Start Menu" (whatever that looks like on Win11). It is NOT a
location for user scripts.

Python, at heart, is a language interpreter that is invoked from a
command line shell. (Use  to exit the interpreter if you are trying
the below examples -- otherwise you'd add the path/name of the script file
to the command line)

-=-=-
Microsoft Windows [Version 10.0.19044.1645]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Wulfraed>python
Python ActivePython 3.8.2 (ActiveState Software Inc.) based on
 on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

C:\Users\Wulfraed>py
Python ActivePython 3.8.2 (ActiveState Software Inc.) based on
 on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

C:\Users\Wulfraed>
-=-=-

It can run from scripts invoked by double-clicking on the file in the
"file explorer" but often the results are not as desired (it will pop up a
console window -- but that window closes as soon as the script exits!).
Scripts written using one of the graphical libraries (Tkinter, wxPython,
etc.) are typically given a .pyw extension -- .pyw is normally associated
with an alternate start-up module which suppresses the console window.

Editing of scripts can be done with one's favorite programming text
editor. If one can't live without having some sort of IDE, look for
something called IDLE to be on your start menu (IDLE is actually a Python
script using Tkinter).

>
>  1.  How do I automatically run a python app at Windows startup?

Short answer: the same way you would run ANY application at start-up. 

Longer answer: this is a feature of the OS, not Python. You will need
to learn how to use the OS. Maybe start with
https://www.google.com/search?q=run+application+at+startup+windows+11=hp=t1htYpm0K5OtqtsPiMKMwAc=AJiK0e8AYm1mx0aL7YbWlEj0j-yPiL8J4H8HFoxo=0ahUKEwjZ6-T3j7z3AhWTlmoFHQghA3gQ4dUDCAk=5=run+application+at+startup+windows+11_lcp=Cgdnd3Mtd2l6EAMyBQghEKsCMgUIIRCrAjIFCCEQqwIyCAghEBYQHRAeOgUIABCABDoOCC4QgAQQsQMQgwEQ1AI6CAgAEIAEELEDOhEILhCABBCxAxCDARDHARDRAzoICC4QgAQQsQM6CwgAEIAEELEDEIMBOggILhCxAxCDAToFCC4QgAQ6EQguEIAEELEDEIMBEMcBEKMCOgsILhCABBDHARCjAjoICC4QgAQQ1AI6CwguEIAEELEDEIMBOgsILhCABBCxAxDUAjoOCC4QsQMQgwEQxwEQowI6DgguEIAEELEDEMcBENEDOg4ILhCABBCxAxCDARDJAzoICAAQsQMQgwE6BwgAEIAEEAo6CAgAEIAEEMkDOgYIABAWEB46BQgAEIYDUL0NWNRZYO9caAFwAHgBgAHYAYgBpx6SAQcyNC4xMi4xmAEAoAEBsAEA=gws-wiz

>
>Thank you!
>
>Brent Hunter


-- 
Wulfraed Dennis Lee Bieber AF6VN
wlfr...@ix.netcom.comhttp://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Question re Executing a Script

2022-04-30 Thread dn
On 01/05/2022 10.37, Brent Hunter wrote:
> Hello,
> 
> I just purchased a new Windows 11 computer and installed Python 3.10.4 (64 
> bit).  I can't figure out from your documentation, how do I:
> 
> 
>   1.  Run a python script that is located in the same directory ( 
> C:\Users\Brent\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 
> 3.10 )
> 
> 
>   1.  How do I automatically run a python app at Windows startup?
> 
> Thank you!
> 
> Brent Hunter


Please start with https://docs.python.org/3/using/windows.html

-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-13 Thread Michael Torrie
On 3/12/20 4:19 PM, Mike Dewhirst wrote:
> I'm not sure I understand what you are saying. How is gmail
> behaviour breaking things?

The problem is if I post to a mailing list from gmail (either the web
interface or Thunderbird via Google's SMTP servers), Google will
silently discard my own message when the list serv echos it back to me.
In the web-based "conversation" view, Google puts my own sent message in
the conversation. However via IMAP I see nothing.  Thus when looking at
my list mail on Thunderbird, my own messages to the list never show up.

Does that make sense?  There was a lot of fuss about this when gmail
first started doing this, but Google ignored it and continues to ignore
this issue. They regard this sort of email use as "legacy."

Here's an old message describing the problem and showing Google's
non-response:
https://support.google.com/mail/forum/K7un8RUduyrfxS01ac/?hl=en

The only way to prevent this is to send your message via a non-Gmail
SMTP server, and not to put those messages in your Gmail Sent folder.
This runs the risk of messages being flagged as untrustworthy, but as
long as Python's smtp server accepts them, it works.  Of course python's
list messages going out are often flagged as suspicious because they
have our own "from" addresses on them but come through Python's servers.

> I do have a gmail account but don't use it.
> 
> As background, I signed up to the Django google-group list and
> traffic there arrives in my Thunderbird client. I also occasionally
> use Roundcube web client for my accounts when travelling. I think
> that might be a php thing.
> 
> Maybe there is a case for developing a gmail-like web client?

No the problem has nothing to do with the web interface or the client.
It's a bug/feature of the Google back end.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-12 Thread Michael Torrie
On 3/11/20 8:47 PM, DL Neil via Python-list wrote:
> Didn't someone once claim "do no harm"?
> 
> There are two sides to every story! Rather than changing the (Discussion 
> List) server, which affects everyone; ask those who don't like Google's 
> tactics/behavior to change their (email) client!

In Gmail's case it's a matter of not using gmail at all, as their
mailing list -breaking behavior happens whether you use IMAP and
thunderbird.  I work around gmail's breakage right now by using my own
SMTP server for sending messages to the list, so gmail won't recognize
my messages and discard them.

I could leave gmail, but it's not worth it for me at this point.  Python
is the only mailing list left of all the open source projects I used to
follow. It's pretty sad how they all abandoned a format that works very
well for web based formats.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-12 Thread Souvik Dutta
Ya at least I thought that.

On Thu, Mar 12, 2020, 12:45 PM Mike Dewhirst  wrote:

> On 12/03/2020 1:47 pm, DL Neil via Python-list wrote:
> > On 12/03/20 3:03 AM, Rhodri James wrote:
> >> On 11/03/2020 04:06, Michael Torrie wrote:
> >>> On 3/10/20 6:49 PM, Souvik Dutta wrote:
>  What about moving on to a social media app completely made in
>  pythoj for
>  python?
> >>> No thanks. I don't want to be on yet another web forum.  I don't need
> >>> "social media" or a "social media app."  Email works exceedingly well
> >>> for this sort of thing, despite Google's antics.
> >>
> >> +10
> >>
> >> The best response to "This system breaks when I abuse it" is almost
> >> always "Well stop abusing it then."
> >
> >
> > +1
> >
> > Didn't someone once claim "do no harm"?
> >
> > There are two sides to every story! Rather than changing the
> > (Discussion List) server, which affects everyone; ask those who don't
> > like Google's tactics/behavior to change their (email) client!
> >
>
> I agree email is better than social media, but I suspect Souvik was
> merely expressing a desire to do something in Python since this is a
> Python list. That's the motivation of a Python enthusiast and perhaps
> should be encouraged.
>
>
>
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-12 Thread Mike Dewhirst

On 12/03/2020 1:47 pm, DL Neil via Python-list wrote:

On 12/03/20 3:03 AM, Rhodri James wrote:

On 11/03/2020 04:06, Michael Torrie wrote:

On 3/10/20 6:49 PM, Souvik Dutta wrote:
What about moving on to a social media app completely made in 
pythoj for

python?

No thanks. I don't want to be on yet another web forum.  I don't need
"social media" or a "social media app."  Email works exceedingly well
for this sort of thing, despite Google's antics.


+10

The best response to "This system breaks when I abuse it" is almost 
always "Well stop abusing it then."



+1

Didn't someone once claim "do no harm"?

There are two sides to every story! Rather than changing the 
(Discussion List) server, which affects everyone; ask those who don't 
like Google's tactics/behavior to change their (email) client!




I agree email is better than social media, but I suspect Souvik was 
merely expressing a desire to do something in Python since this is a 
Python list. That's the motivation of a Python enthusiast and perhaps 
should be encouraged.







--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-11 Thread DL Neil via Python-list

On 12/03/20 3:03 AM, Rhodri James wrote:

On 11/03/2020 04:06, Michael Torrie wrote:

On 3/10/20 6:49 PM, Souvik Dutta wrote:

What about moving on to a social media app completely made in pythoj for
python?

No thanks. I don't want to be on yet another web forum.  I don't need
"social media" or a "social media app."  Email works exceedingly well
for this sort of thing, despite Google's antics.


+10

The best response to "This system breaks when I abuse it" is almost 
always "Well stop abusing it then."



+1

Didn't someone once claim "do no harm"?

There are two sides to every story! Rather than changing the (Discussion 
List) server, which affects everyone; ask those who don't like Google's 
tactics/behavior to change their (email) client!


--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-11 Thread Grant Edwards
On 2020-03-11, Michael Torrie  wrote:
> On 3/10/20 6:49 PM, Souvik Dutta wrote:
>> What about moving on to a social media app completely made in pythoj for
>> python?
>
> No thanks. I don't want to be on yet another web forum.  I don't need
> "social media" or a "social media app."  Email works exceedingly well
> for this sort of thing, despite Google's antics.

For me, "news" works even better than email, which is why I read all
my email lists via the gmane NNTP server using a news client (slrn). :)

-- 
Grant Edwards   grant.b.edwardsYow! Now I'm concentrating
  at   on a specific tank battle
  gmail.comtoward the end of World
   War II!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-11 Thread Rhodri James

On 11/03/2020 04:06, Michael Torrie wrote:

On 3/10/20 6:49 PM, Souvik Dutta wrote:

What about moving on to a social media app completely made in pythoj for
python?

No thanks. I don't want to be on yet another web forum.  I don't need
"social media" or a "social media app."  Email works exceedingly well
for this sort of thing, despite Google's antics.


+10

The best response to "This system breaks when I abuse it" is almost 
always "Well stop abusing it then."


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-10 Thread Michael Torrie
On 3/10/20 6:49 PM, Souvik Dutta wrote:
> What about moving on to a social media app completely made in pythoj for
> python?

No thanks. I don't want to be on yet another web forum.  I don't need
"social media" or a "social media app."  Email works exceedingly well
for this sort of thing, despite Google's antics.

Sadly a lot of open source projects are abandoning the good old list and
moving to awkward web forums like Discourse.

With e-mail lists, everything is right here in my email client
(Thunderbird), separated out into folders with procmail (or whatever
filtering system you want), and with proper nesting of messages.  No web
forum I've seen offers this convenience or proper nesting.  Electronic
communication is fraught enough. "Social media" (whatever that means)
seems to just make it harder.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-10 Thread Souvik Dutta
What about moving on to a social media app completely made in pythoj for
python?

On Wed, 11 Mar, 2020, 12:36 am DL Neil via Python-list, <
python-list@python.org> wrote:

> On 11/03/20 7:34 AM, Michael Torrie wrote:
> > On 3/10/20 6:40 AM, Chris Angelico wrote:
> >> On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list
> ...
>
> >> I'm also reading this in Gmail, and I didn't get any such warning. I'm
> >> going to call that a spurious warning, a false positive.
> >
> > Gmail often reports this about Python list messages because they are
> > being sent through Python's mailing list servers but have the From
> > address showing up as the poster's email address.
> >
> > Shows that Google's "my way or the highway" approach to security is
> > problematic when it comes to traditional internet services like
> > listservs.  To say nothing of how they break mailing lists by throwing
> > out your own messages to the list. Google products are definitely
> > getting more and more frustrating for us traditional users.
>
> +1
>
> ...and any right-of-reply is basically-hidden and then swathed in all
> manner of bureaucracy - which is why it not worth our long-suffering
> ListAdmins' (thanks guys!) time to attempt a fix!
>
> OT: Google is not the only over-large and over-bearing outfit...
>
> --
> Regards =dn
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-10 Thread DL Neil via Python-list

On 11/03/20 7:34 AM, Michael Torrie wrote:

On 3/10/20 6:40 AM, Chris Angelico wrote:

On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list

...


I'm also reading this in Gmail, and I didn't get any such warning. I'm
going to call that a spurious warning, a false positive.


Gmail often reports this about Python list messages because they are
being sent through Python's mailing list servers but have the From
address showing up as the poster's email address.

Shows that Google's "my way or the highway" approach to security is
problematic when it comes to traditional internet services like
listservs.  To say nothing of how they break mailing lists by throwing
out your own messages to the list. Google products are definitely
getting more and more frustrating for us traditional users.


+1

...and any right-of-reply is basically-hidden and then swathed in all 
manner of bureaucracy - which is why it not worth our long-suffering 
ListAdmins' (thanks guys!) time to attempt a fix!


OT: Google is not the only over-large and over-bearing outfit...

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-10 Thread Michael Torrie
On 3/10/20 6:40 AM, Chris Angelico wrote:
> On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list
>> I would reply, but I was already too much off topic. I want only to
>> write what Gmail reports to me about the last message of the person
>> that started this discussion:
>>
>>> This message seems dangerous
>>> Many people marked similar messages as phishing scams, so this might 
>>> contain unsafe content. Avoid clicking links, downloading attachments or 
>>> replying with personal information.
>>
>> I never saw this message before in Gmail. Didn't your Gmail warned
>> about this, Souvik Dutta?
>>
> 
> I'm also reading this in Gmail, and I didn't get any such warning. I'm
> going to call that a spurious warning, a false positive.

Gmail often reports this about Python list messages because they are
being sent through Python's mailing list servers but have the From
address showing up as the poster's email address.

Shows that Google's "my way or the highway" approach to security is
problematic when it comes to traditional internet services like
listservs.  To say nothing of how they break mailing lists by throwing
out your own messages to the list. Google products are definitely
getting more and more frustrating for us traditional users.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-10 Thread Chris Angelico
On Tue, Mar 10, 2020 at 11:22 PM Marco Sulla via Python-list
 wrote:
>
> On Fri, 6 Mar 2020 at 17:30, Souvik Dutta  wrote:
> > And you cannot form opinions for
> > other people's by saying them not to support a person. That is injustice
> > and rude.
>
> I would reply, but I was already too much off topic. I want only to
> write what Gmail reports to me about the last message of the person
> that started this discussion:
>
> > This message seems dangerous
> > Many people marked similar messages as phishing scams, so this might 
> > contain unsafe content. Avoid clicking links, downloading attachments or 
> > replying with personal information.
>
> I never saw this message before in Gmail. Didn't your Gmail warned
> about this, Souvik Dutta?
>

I'm also reading this in Gmail, and I didn't get any such warning. I'm
going to call that a spurious warning, a false positive.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-10 Thread Marco Sulla via Python-list
On Fri, 6 Mar 2020 at 17:30, Souvik Dutta  wrote:
> And you cannot form opinions for
> other people's by saying them not to support a person. That is injustice
> and rude.

I would reply, but I was already too much off topic. I want only to
write what Gmail reports to me about the last message of the person
that started this discussion:

> This message seems dangerous
> Many people marked similar messages as phishing scams, so this might contain 
> unsafe content. Avoid clicking links, downloading attachments or replying 
> with personal information.

I never saw this message before in Gmail. Didn't your Gmail warned
about this, Souvik Dutta?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-08 Thread Peter J. Holzer
On 2020-03-05 20:49:14 -0800, Mr. Lee Chiffre wrote:
> > 2. he does not trust binaries from pip.
> 
> What is the point of open source if you cannot compile from source code?

You can get the source code from pypi. I don't see any option for pip to
do that, but you can easily do it manually.

If you don't trust the binaries from pypi, don't trust the source code
either! Malware has been found on npm, for example. So to be sure there
are no backdoors you have to (carefully) read the source of each module
you use (which makes the time for downloading them manually trivial).

Oh, and you have read "Reflections on Trusting Trust", I presume?


> Not unusual. People use open source because they dont trust closed source.
> Binaries that someone else compiled is not open source.

It's still open source if the source is available (under the usual
conditions). Whether you trust somebody else to compile the software is
a question of trust, not of openness. Do you trust the person who
compiled your compiler?

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-07 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn 
and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is 
working on a cryptocurrency project and he might use our original code in his 
final project I don't think offering money is bad. After all there have been 
times when a person demands his name to included in the credits page. Our sole 
task is to help. And you cannot form opinions for other people's by saying them 
not to support a person. That is injustice and rude.

On Fri, 6 Mar, 2020, 9:14 pm Mr. Lee Chiffre,  wrote:

> Thank you Marco for at least taking the time to read my message even if
> you do not agree with me on things. And no disrespect to you. But I came
> here for python related questions and help. Not to be called suspicious
> and untrustworthy only because I am concerned about security of users and
> for being a advocate of privacy. Then to call for me to be censored is
> just ludicrous.
>
>
> > People of Python List, I strongly discourage you to support this user.
> > He is quite suspicious for the following reasons:
> >
> > 1. he go so far as he offers money for, IMHO, a trivial task
>
> I said I am a python noob. This is why I asked for help. And I see no
> issue in offering payment for a programming task.
>
> > 2. he does not trust binaries from pip.
>
> What is the point of open source if you cannot compile from source code?
>
> > code. A lack of trust in open source projects that is quite unusual
> > 3. I don't trust any cryptocurrency.
>
> Not unusual. People use open source because they dont trust closed source.
> Binaries that someone else compiled is not open source.
>
> > I believe in privacy,  but not in financial privacy. Yes,
> > cryptocurrencies can be useful for circumvent bans from tyrannic
> > states. But they can, and _are_ used, primarily to:
> >  - wash dirty money, by criminals and mafias
> >  - evade taxes
> >  - buy highly unethical "products", like weapons... and who know what
> > other
> >  - finance tyrannies.
>
> Roads and cars are used by drug dealers. Stop using roads and cars. Cash
> is used by criminals. Stop using cash. Internet is used by child abusers.
> Stop supporting the internet. I am offended that you group me with
> criminals and baddies because I support technological privacy.
>
>
> >
> > I do _not_ think that all people that uses cryptocurrencies are
> > criminals. I had, for example, some co-workers that invested in
> > BitCoins, only for profit.
> >
> > But I do not trust this man, and I hope no one will offer support to
> > him. By my side, I'll report this discussion to moderators.
>
> That is fine if you dont like something. You dont have to help me out if
> you dont want to. But trying to censor me is unethical. Hopefully other
> people will have the logic to make decisions for themselves and give me
> help on python if they choose to do so.
>
> I hope my reply does not get censored. I am being reasonable here. And if
> you are wondering why I am "paranoid", you would be too if you are dealing
> with a server that might host a hot wallet. I dont want my server getting
> hacked just because I was too lazy to compile my own code. And it is not
> uncommon for binaries of open source projects to be injected with malware.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-06 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn 
and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is 
working on a cryptocurrency project and he might use our original code in his 
final project I don't think offering money is bad. After all there have been 
times when a person demands his name to included in the credits page. Our sole 
task is to help. And you cannot form opinions for other people's by saying them 
not to support a person. That is injustice and rude.

On Fri, 6 Mar, 2020, 9:14 pm Mr. Lee Chiffre,  wrote:

> Thank you Marco for at least taking the time to read my message even if
> you do not agree with me on things. And no disrespect to you. But I came
> here for python related questions and help. Not to be called suspicious
> and untrustworthy only because I am concerned about security of users and
> for being a advocate of privacy. Then to call for me to be censored is
> just ludicrous.
>
>
> > People of Python List, I strongly discourage you to support this user.
> > He is quite suspicious for the following reasons:
> >
> > 1. he go so far as he offers money for, IMHO, a trivial task
>
> I said I am a python noob. This is why I asked for help. And I see no
> issue in offering payment for a programming task.
>
> > 2. he does not trust binaries from pip.
>
> What is the point of open source if you cannot compile from source code?
>
> > code. A lack of trust in open source projects that is quite unusual
> > 3. I don't trust any cryptocurrency.
>
> Not unusual. People use open source because they dont trust closed source.
> Binaries that someone else compiled is not open source.
>
> > I believe in privacy,  but not in financial privacy. Yes,
> > cryptocurrencies can be useful for circumvent bans from tyrannic
> > states. But they can, and _are_ used, primarily to:
> >  - wash dirty money, by criminals and mafias
> >  - evade taxes
> >  - buy highly unethical "products", like weapons... and who know what
> > other
> >  - finance tyrannies.
>
> Roads and cars are used by drug dealers. Stop using roads and cars. Cash
> is used by criminals. Stop using cash. Internet is used by child abusers.
> Stop supporting the internet. I am offended that you group me with
> criminals and baddies because I support technological privacy.
>
>
> >
> > I do _not_ think that all people that uses cryptocurrencies are
> > criminals. I had, for example, some co-workers that invested in
> > BitCoins, only for profit.
> >
> > But I do not trust this man, and I hope no one will offer support to
> > him. By my side, I'll report this discussion to moderators.
>
> That is fine if you dont like something. You dont have to help me out if
> you dont want to. But trying to censor me is unethical. Hopefully other
> people will have the logic to make decisions for themselves and give me
> help on python if they choose to do so.
>
> I hope my reply does not get censored. I am being reasonable here. And if
> you are wondering why I am "paranoid", you would be too if you are dealing
> with a server that might host a hot wallet. I dont want my server getting
> hacked just because I was too lazy to compile my own code. And it is not
> uncommon for binaries of open source projects to be injected with malware.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-06 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn 
and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is 
working on a cryptocurrency project and he might use our original code in his 
final project I don't think offering money is bad. After all there have been 
times when a person demands his name to included in the credits page. Our sole 
task is to help. And you cannot form opinions for other people's by saying them 
not to support a person. That is injustice and rude.

On Fri, 6 Mar, 2020, 9:14 pm Mr. Lee Chiffre,  wrote:

> Thank you Marco for at least taking the time to read my message even if
> you do not agree with me on things. And no disrespect to you. But I came
> here for python related questions and help. Not to be called suspicious
> and untrustworthy only because I am concerned about security of users and
> for being a advocate of privacy. Then to call for me to be censored is
> just ludicrous.
>
>
> > People of Python List, I strongly discourage you to support this user.
> > He is quite suspicious for the following reasons:
> >
> > 1. he go so far as he offers money for, IMHO, a trivial task
>
> I said I am a python noob. This is why I asked for help. And I see no
> issue in offering payment for a programming task.
>
> > 2. he does not trust binaries from pip.
>
> What is the point of open source if you cannot compile from source code?
>
> > code. A lack of trust in open source projects that is quite unusual
> > 3. I don't trust any cryptocurrency.
>
> Not unusual. People use open source because they dont trust closed source.
> Binaries that someone else compiled is not open source.
>
> > I believe in privacy,  but not in financial privacy. Yes,
> > cryptocurrencies can be useful for circumvent bans from tyrannic
> > states. But they can, and _are_ used, primarily to:
> >  - wash dirty money, by criminals and mafias
> >  - evade taxes
> >  - buy highly unethical "products", like weapons... and who know what
> > other
> >  - finance tyrannies.
>
> Roads and cars are used by drug dealers. Stop using roads and cars. Cash
> is used by criminals. Stop using cash. Internet is used by child abusers.
> Stop supporting the internet. I am offended that you group me with
> criminals and baddies because I support technological privacy.
>
>
> >
> > I do _not_ think that all people that uses cryptocurrencies are
> > criminals. I had, for example, some co-workers that invested in
> > BitCoins, only for profit.
> >
> > But I do not trust this man, and I hope no one will offer support to
> > him. By my side, I'll report this discussion to moderators.
>
> That is fine if you dont like something. You dont have to help me out if
> you dont want to. But trying to censor me is unethical. Hopefully other
> people will have the logic to make decisions for themselves and give me
> help on python if they choose to do so.
>
> I hope my reply does not get censored. I am being reasonable here. And if
> you are wondering why I am "paranoid", you would be too if you are dealing
> with a server that might host a hot wallet. I dont want my server getting
> hacked just because I was too lazy to compile my own code. And it is not
> uncommon for binaries of open source projects to be injected with malware.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-06 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other
learn and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since
he is working on a cryptocurrency project and he might use our original
code in his final project I don't think offering money is bad. After all
there have been times when a person demands his name to included in the
credits page. Our sole task is to help. And you cannot form opinions for
other people's by saying them not to support a person. That is injustice
and rude.

On Fri, 6 Mar, 2020, 9:14 pm Mr. Lee Chiffre, 
wrote:

> Thank you Marco for at least taking the time to read my message even if
> you do not agree with me on things. And no disrespect to you. But I came
> here for python related questions and help. Not to be called suspicious
> and untrustworthy only because I am concerned about security of users and
> for being a advocate of privacy. Then to call for me to be censored is
> just ludicrous.
>
>
> > People of Python List, I strongly discourage you to support this user.
> > He is quite suspicious for the following reasons:
> >
> > 1. he go so far as he offers money for, IMHO, a trivial task
>
> I said I am a python noob. This is why I asked for help. And I see no
> issue in offering payment for a programming task.
>
> > 2. he does not trust binaries from pip.
>
> What is the point of open source if you cannot compile from source code?
>
> > code. A lack of trust in open source projects that is quite unusual
> > 3. I don't trust any cryptocurrency.
>
> Not unusual. People use open source because they dont trust closed source.
> Binaries that someone else compiled is not open source.
>
> > I believe in privacy,  but not in financial privacy. Yes,
> > cryptocurrencies can be useful for circumvent bans from tyrannic
> > states. But they can, and _are_ used, primarily to:
> >  - wash dirty money, by criminals and mafias
> >  - evade taxes
> >  - buy highly unethical "products", like weapons... and who know what
> > other
> >  - finance tyrannies.
>
> Roads and cars are used by drug dealers. Stop using roads and cars. Cash
> is used by criminals. Stop using cash. Internet is used by child abusers.
> Stop supporting the internet. I am offended that you group me with
> criminals and baddies because I support technological privacy.
>
>
> >
> > I do _not_ think that all people that uses cryptocurrencies are
> > criminals. I had, for example, some co-workers that invested in
> > BitCoins, only for profit.
> >
> > But I do not trust this man, and I hope no one will offer support to
> > him. By my side, I'll report this discussion to moderators.
>
> That is fine if you dont like something. You dont have to help me out if
> you dont want to. But trying to censor me is unethical. Hopefully other
> people will have the logic to make decisions for themselves and give me
> help on python if they choose to do so.
>
> I hope my reply does not get censored. I am being reasonable here. And if
> you are wondering why I am "paranoid", you would be too if you are dealing
> with a server that might host a hot wallet. I dont want my server getting
> hacked just because I was too lazy to compile my own code. And it is not
> uncommon for binaries of open source projects to be injected with malware.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-26 Thread Steve D'Aprano
On Sun, 26 Mar 2017 10:35 pm, Cameron Simpson wrote:

> On 26Mar2017 20:55, Steve D'Aprano  wrote:
>>On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote:
>>> 1: He BCCed the list, not us individually. Look at the headers.
>>
>>BCCed addresses aren't visible in the headers. That's why they're BLIND
>>CC.
> 
> Of course, but the received headers etc show it passed though the list.

Sending to the list is not a bad thing. We know the OP sent to the list,
because his post appeared on the list :-)

The question is whether he BCCed a bunch of regulars or not.

[...]
> If the headers say it went though the list, _that_ copy went through the
> list, _not_ to your personal address (well, not from him; of course the
> list delivered it to you).

Unfortunately I deleted the email so I can't look at the headers, but
nevertheless I can categorically say that it didn't come from the mailing
list, because the python-list@python.org mailing list doesn't have my
address. I've always read this though the newsgroup.

I do still have the relevant mail logs:

Mar 25 03:08:36 ando postfix/smtpd[24188]: connect from
  mail-wr0-f194.google.com[209.85.128.194]
Mar 25 03:08:37 ando postfix/smtpd[24188]: 2093D1204E2:
  client=mail-wr0-f194.google.com[209.85.128.194]
Mar 25 03:08:37 ando postfix/cleanup[24192]: 2093D1204E2:
  message-id=
Mar 25 03:08:37 ando postfix/qmgr[3004]: 2093D1204E2:
  from=, size=3258, nrcpt=1 (queue active)
Mar 25 03:08:38 ando postfix/smtpd[24188]: disconnect from
  mail-wr0-f194.google.com[209.85.128.194]

I'm not an expert, but to me that looks pretty convincing that the email
came directly from Google, not from the mailing list. Am I wrong?


>>Your interpretation doesn't explain why I received a copy sent to my
>>personal email address. I read this via the newsgroup comp.lang.python,
>>not the mailing list, and I'm not subscribed to the email mailing list. If
>>the OP had merely BCCed the mailing list, I wouldn't have received a copy
>>in my personal inbox.
> 
> Fair point. Though I thought I only got one copy, might be wrong.

Maybe you weren't one of the people he BCCed :-)





-- 
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


Re: Python question

2017-03-26 Thread Cameron Simpson

On 26Mar2017 20:55, Steve D'Aprano  wrote:

On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote:

1: He BCCed the list, not us individually. Look at the headers.


BCCed addresses aren't visible in the headers. That's why they're BLIND CC.


Of course, but the received headers etc show it passed though the list.


The lack of personal email addresses in the headers doesn't prove they
weren't there. All the headers tell us is that he definitely posted to the
list. (But we knew that!)


If the headers say it went though the list, _that_ copy went through the list, 
_not_ to your personal address (well, not from him; of course the list 
delivered it to you).



Your interpretation doesn't explain why I received a copy sent to my
personal email address. I read this via the newsgroup comp.lang.python, not
the mailing list, and I'm not subscribed to the email mailing list. If the
OP had merely BCCed the mailing list, I wouldn't have received a copy in my
personal inbox.


Fair point. Though I thought I only got one copy, might be wrong.

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-26 Thread Steve D'Aprano
On Sun, 26 Mar 2017 01:55 pm, c...@zip.com.au wrote:

> 1: He BCCed the list, not us individually. Look at the headers.

BCCed addresses aren't visible in the headers. That's why they're BLIND CC.
The lack of personal email addresses in the headers doesn't prove they
weren't there. All the headers tell us is that he definitely posted to the
list. (But we knew that!)

Your interpretation doesn't explain why I received a copy sent to my
personal email address. I read this via the newsgroup comp.lang.python, not
the mailing list, and I'm not subscribed to the email mailing list. If the
OP had merely BCCed the mailing list, I wouldn't have received a copy in my
personal inbox.



-- 
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


Re: Python question

2017-03-25 Thread cs

On 26Mar2017 00:11, Erik  wrote:

On 25/03/17 20:26, MRAB wrote:

On 2017-03-25 20:10, Terry Reedy wrote:

On 3/25/2017 6:50 AM, Steve D'Aprano wrote:

they BCC or CC me without a good excuse. As I was in this case: the OP
BCCed me in his post. I'm not *that* special, so my guess is that he
did a
mass BCC of many regulars here, which makes this spam.

I got the BCC also and was puzzled why.

Same here.

Me too, and I'm hardly a prolific poster compared to some of you lot.


Guys guys guys,

1: He BCCed the list, not us individually. Look at the headers.

2: I got a perfectly civil and informative response from him.

So treat him as up front!

Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-25 Thread Abdul Abdul
Hi Cameron,

Thanks for your kind reply and suggestion. Sure, please find my question
below. I also show the different edits made and what errors emerged after
those edits. Thanks for your support!

I have the following code portion for a convolutional neural network:

import numpy as np
import matplotlib.pyplot as plt
import cifar_tools
import tensorflow as tf

data, labels = cifar_tools.read_data('C:\\Users\\abc\\Desktop\\temp')

x = tf.placeholder(tf.float32, [None, 150 * 150])
y = tf.placeholder(tf.float32, [None, 2])

w1 = tf.Variable(tf.random_normal([5, 5, 1, 64]))
b1 = tf.Variable(tf.random_normal([64]))

w2 = tf.Variable(tf.random_normal([5, 5, 64, 64]))
b2 = tf.Variable(tf.random_normal([64]))

w3 = tf.Variable(tf.random_normal([6*6*64, 1024]))
b3 = tf.Variable(tf.random_normal([1024]))

w_out = tf.Variable(tf.random_normal([1024, 2]))
b_out = tf.Variable(tf.random_normal([2]))

def conv_layer(x,w,b):
conv = tf.nn.conv2d(x,w,strides=[1,1,1,1], padding = 'SAME')
conv_with_b = tf.nn.bias_add(conv,b)
conv_out = tf.nn.relu(conv_with_b)
return conv_out

def maxpool_layer(conv,k=2):
return tf.nn.max_pool(conv, ksize=[1,k,k,1], strides=[1,k,k,1],
padding='SAME')

def model():
x_reshaped = tf.reshape(x, shape=[-1,150,150,1])

conv_out1 = conv_layer(x_reshaped, w1, b1)
maxpool_out1 = maxpool_layer(conv_out1)
norm1 = tf.nn.lrn(maxpool_out1, 4, bias=1.0, alpha=0.001/9.0, beta=0.75)

conv_out2 = conv_layer(norm1, w2, b2)
maxpool_out2 = maxpool_layer(conv_out2)
norm2 = tf.nn.lrn(maxpool_out2, 4, bias=1.0, alpha=0.001/9.0, beta=0.75)

maxpool_reshaped = tf.reshape(maxpool_out2,
[-1,w3.get_shape().as_list()[0]])
local = tf.add(tf.matmul(maxpool_reshaped, w3), b3)
local_out = tf.nn.relu(local)

out = tf.add(tf.matmul(local_out, w_out), b_out)
return out

model_op = model()

cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(model_op,
y))
train_op = tf.train.AdamOptimizer(learning_rate=0.001).minimize(cost)

correct_pred = tf.equal(tf.argmax(model_op, 1), tf.argmax(y,1))
accuracy = tf.reduce_mean(tf.cast(correct_pred,tf.float32))

I'm reading `150x150` grayscale images, but couldn't understand the
following error I'm having:

EPOCH 0
Traceback (most recent call last):
  File
"C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line
1021, in _do_call
return fn(*args)
  File
"C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line
1003, in _run_fn
status, run_metadata)
  File "C:\Python35\lib\contextlib.py", line 66, in __exit__
next(self.gen)
  File
"C:\Python35\lib\site-packages\tensorflow\python\framework\errors_impl.py",
line 469, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to
reshape is a tensor with 92416 values, but the requested shape requires a
multiple of 2304
 [[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32,
_device="/job:localhost/replica:0/task:0/cpu:0"](MaxPool_1,
Reshape_1/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "cnn.py", line 70, in 
_, accuracy_val = sess.run([train_op, accuracy], feed_dict={x:
batch_data, y: batch_onehot_vals})
  File
"C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line
766, in run
run_metadata_ptr)
  File
"C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line
964, in _run
feed_dict_string, options, run_metadata)
  File
"C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line
1014, in _do_run
target_list, options, run_metadata)
  File
"C:\Python35\lib\site-packages\tensorflow\python\client\session.py", line
1034, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to
reshape is a tensor with 92416 values, but the requested shape requires a
multiple of 2304
 [[Node: Reshape_1 = Reshape[T=DT_FLOAT, Tshape=DT_INT32,
_device="/job:localhost/replica:0/task:0/cpu:0"](MaxPool_1,
Reshape_1/shape)]]

Caused by op 'Reshape_1', defined at:
  File "cnn.py", line 50, in 
model_op = model()
  File "cnn.py", line 43, in model
maxpool_reshaped = tf.reshape(maxpool_out2,
[-1,w3.get_shape().as_list()[0]])
  File
"C:\Python35\lib\site-packages\tensorflow\python\ops\gen_array_ops.py",
line 2448, in reshape
name=name)
  File
"C:\Python35\lib\site-packages\tensorflow\python\framework\op_def_library.py",
line 759, in apply_op
op_def=op_def)
  File
"C:\Python35\lib\site-packages\tensorflow\python\framework\ops.py", line
2240, in create_op
original_op=self._default_original_op, 

Re: Python question

2017-03-25 Thread Erik

On 25/03/17 20:26, MRAB wrote:

On 2017-03-25 20:10, Terry Reedy wrote:

On 3/25/2017 6:50 AM, Steve D'Aprano wrote:

they BCC or CC me without a good excuse. As I was in this case: the OP
BCCed me in his post. I'm not *that* special, so my guess is that he
did a
mass BCC of many regulars here, which makes this spam.


I got the BCC also and was puzzled why.


Same here.


Me too, and I'm hardly a prolific poster compared to some of you lot.

E.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-25 Thread MRAB

On 2017-03-25 20:10, Terry Reedy wrote:

On 3/25/2017 6:50 AM, Steve D'Aprano wrote:

On Sat, 25 Mar 2017 10:09 am, Cameron Simpson wrote:


On 24Mar2017 18:08, Abdul Abdul  wrote:

I hope you are doing fine. I have added a question on StackOverflow and
thought you might have an idea on it. This is the question



Hi Adbul,

Please just post the question here, with a nice descriptive Subject: line.

It is quite possible for people to be reading this list when they do not
have web access (eg offline on a train, as I sometimes do) and it is
anyway annoying to have to open a web browser to see what you are asking
about, and doubly annoying to copy from that question into the list for
replies.



I solve that problem by hitting Delete on the original post, ESPECIALLY if
they BCC or CC me without a good excuse. As I was in this case: the OP
BCCed me in his post. I'm not *that* special, so my guess is that he did a
mass BCC of many regulars here, which makes this spam.


I got the BCC also and was puzzled why.


Same here.

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-25 Thread Terry Reedy

On 3/25/2017 6:50 AM, Steve D'Aprano wrote:

On Sat, 25 Mar 2017 10:09 am, Cameron Simpson wrote:


On 24Mar2017 18:08, Abdul Abdul  wrote:

I hope you are doing fine. I have added a question on StackOverflow and
thought you might have an idea on it. This is the question



Hi Adbul,

Please just post the question here, with a nice descriptive Subject: line.

It is quite possible for people to be reading this list when they do not
have web access (eg offline on a train, as I sometimes do) and it is
anyway annoying to have to open a web browser to see what you are asking
about, and doubly annoying to copy from that question into the list for
replies.



I solve that problem by hitting Delete on the original post, ESPECIALLY if
they BCC or CC me without a good excuse. As I was in this case: the OP
BCCed me in his post. I'm not *that* special, so my guess is that he did a
mass BCC of many regulars here, which makes this spam.


I got the BCC also and was puzzled why.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-25 Thread Steve D'Aprano
On Sat, 25 Mar 2017 10:09 am, Cameron Simpson wrote:

> On 24Mar2017 18:08, Abdul Abdul  wrote:
>>I hope you are doing fine. I have added a question on StackOverflow and
>>thought you might have an idea on it. This is the question
>>
> 
> Hi Adbul,
> 
> Please just post the question here, with a nice descriptive Subject: line.
> 
> It is quite possible for people to be reading this list when they do not
> have web access (eg offline on a train, as I sometimes do) and it is
> anyway annoying to have to open a web browser to see what you are asking
> about, and doubly annoying to copy from that question into the list for
> replies.


I solve that problem by hitting Delete on the original post, ESPECIALLY if
they BCC or CC me without a good excuse. As I was in this case: the OP
BCCed me in his post. I'm not *that* special, so my guess is that he did a
mass BCC of many regulars here, which makes this spam.

Judging from the question on Stackoverflow, I think he's just trying to
drive eyeballs to the question so he can get higher reputation. It is a
silly question: he says he has a pickle file containing an image file, and
he's asking (1) what's in the pickle file, and (2) how can he create an
identical pickle file containing a different image.

The answer to (1) is "Whatever you put in it".

Or possibly malware: he links to an actual pickle file he has put up on-line
somewhere. Anyone brave enough to unpickle it in a sandbox and report on
whether it contains what he says it contains? Remember that pickles can
contain arbitrary executable code.




-- 
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


Re: Python question

2017-03-25 Thread dieter
Abdul Abdul  writes:
> I hope you are doing fine. I have added a question on StackOverflow and
> thought you might have an idea on it. This is the question
> 

I do not want to go into the details of your concrete problem --
just give some general remarks about "pickle".

"pickle" is used for serialization/deserialization of (most) Python objects:
i.e. it can transform a Python object into a string (called a "pickle")
and (later) reconstruct the object from the pickle.

You should not be interested in the internal pickle structure --
keep at the Python level.


For your concrete problem: unpickle your pickle file to get
a Python object; construct a similar Python object with the new data;
pickle that Python object.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2017-03-24 Thread Cameron Simpson

On 24Mar2017 18:08, Abdul Abdul  wrote:

I hope you are doing fine. I have added a question on StackOverflow and
thought you might have an idea on it. This is the question



Hi Adbul,

Please just post the question here, with a nice descriptive Subject: line.

It is quite possible for people to be reading this list when they do not have 
web access (eg offline on a train, as I sometimes do) and it is anyway annoying 
to have to open a web browser to see what you are asking about, and doubly 
annoying to copy from that question into the list for replies.


Thank you,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


Re: PYTHON QUESTION

2015-06-14 Thread Laurent Pointal
adebayo.abra...@gmail.com wrote his student exercise as raw text:

 Help with this problem!
 
 Temperature converter
 Description
 
 Write two functions that will convert temperatures back and forth from the
 Celsius and Fahrenheit temperature scales. The formulas for making the
 conversion are as follows:
 
   Tc=(5/9)*(Tf-32)
   Tf=(9/5)*Tc+32
 
 where Tc is the Celsius temperature and Tf is the Fahrenheit temperature.
 More information and further descriptions of how to do the conversion can
 be found at this NASA Webpage. If you finish this assignment quickly, add
 a function to calculate the wind chill. Input
 
 Your program should ask the user to input a temperature and then which
 conversion they would like to perform.

One link to help you: http://www.catb.org/esr/faqs/smart-questions.html

You have just to add the Python syntax for functions declaration and return 
value around your expressions (writing let as an exercise)… just care of a 
small difference between Python2 et Python3 with the division operator, 
which may makes you discover a tricky issue with integers manipulation 
(common to many programming languages).

A+

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: PYTHON QUESTION

2015-06-11 Thread David Palao
2015-06-11 12:44 GMT+02:00  adebayo.abra...@gmail.com:
 Help with this problem!

 Temperature converter
 Description

 Write two functions that will convert temperatures back and forth from the 
 Celsius and Fahrenheit temperature scales. The formulas for making the 
 conversion are as follows:

   Tc=(5/9)*(Tf-32)
   Tf=(9/5)*Tc+32

 where Tc is the Celsius temperature and Tf is the Fahrenheit temperature. 
 More information and further descriptions of how to do the conversion can be 
 found at this NASA Webpage. If you finish this assignment quickly, add a 
 function to calculate the wind chill.
 Input

 Your program should ask the user to input a temperature and then which 
 conversion they would like to perform.
 --
 https://mail.python.org/mailman/listinfo/python-list

Hello,
While people here is kindly helping others, it doesn't work the way
you are posing it: we will not do your homeworks.
If you want some help, please, present some code that you wrote and
does not work, or a specific question about the problem. For instance,
how can I write a function in python?
BTW, probably your questions should go to the tutor mailing list...

Best
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python question

2011-02-02 Thread Benjamin Kaplan
On Wed, Feb 2, 2011 at 4:08 PM, Robin r...@thevoid1.net wrote:

 how do you acccess a hash element in python 3? It completely changed
 from version 2 and earlier, I think.


What do you mean by accessing a hash element? Do you mean the hash of
an object? Because that's stayed the same: hash(obj). Do you mean
accessing the values in a dict? Because that's also stayed the same:
dictionary[obj]. Or is it something else that you're looking for?

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


Re: Python question

2010-04-12 Thread DreiJane
Hello,

Python and gtk are ambulant (portable plus intallable by mere
copying without admin rights). gtk only needs to have the path to its /
bin on the PATH . The latter could - and possibly should be - done by
the Python scripts using it, for example:

s = os.environ['PATH']
if s.find(gtkBinDir) == -1: os.putenv(PATH, os.getenv(PATH)+
os.pathsep + gtkBinDir)

for gtkBinDir from some GlobalConstants.py.

Pygtk breaks that ambulance - its parts use the registry, but only
for finding Python during installation. Afterwards such a Python is
ambulant again - that means with its pygtk (this little flaw is a
minor reason for me to work on my depikt). I am on Windows normally,
but never considered pywin.

Good luck, Joost
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python question

2010-04-12 Thread DreiJane
Rereading my sent answer i wondered, what the variable s was used for
besides that find and found nothing. Without it also the layout is
better:

if os.environ['PATH'].find(gtkBinDir) == -1:
nbsp;nbsp;nbsp;nbsp; os.putenv(PATH, os.getenv(PATH)+
os.pathsep + gtkBinDir)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python question

2010-04-09 Thread Gabriel Genellina
En Fri, 09 Apr 2010 14:14:34 -0300, Binary  
nos...@news.eternal-september.org escribió:


How much space approximately is required to install the following packs  
on Windows XP?


pycairo-1.4.12-2.win32-py2.6.exe
python-2.6.1.msi
pygobject-2.14.2-2.win32-py2.6.exe
pygtk-2.12.1-3.win32-py2.6.exe
pywin32-213.win32-py2.6.exe
gtk-2.12.9-win32-2.exe


You might estimate it by the size of those files; use a factor of 2 or 3  
due to compression.



Does all this packs requires installation,


python and gtx must be installed as any other Windows program, and  
probably require administrator rights. I don't know all of the remaining  
files, but they look like Python packages; the installer typically drop  
some files into c:\python26\lib\site-packages and register something.


or it's possible just extract and place them in to C: drive, then to set  
environment variables properly?

Does this packs installs dynamic libraries and writes to registry?


Python and Gtk, yes. The other packages, maybe not.

--
Gabriel Genellina

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


Re: python question

2009-05-22 Thread Craig

I use python 2.6.2 and i useing ubuntu 9.04 not windows.

--- On Thu, 5/21/09, Dave Angel da...@ieee.org wrote:

 From: Dave Angel da...@ieee.org
 Subject: Re: python question
 To: Craig fasteliteprogram...@yahoo.com
 Cc: python-list@python.org
 Date: Thursday, May 21, 2009, 2:22 PM
 Craig wrote:
  How do i install this.i never seen a python write in c
 before.
  
  
    
 Well, I've never seen a snake program in any language,
 python or otherwise.  And I believe python was named
 after Monty Python, not the snake.  But once it got its
 name, snake puns abound.
 
 Anyway, why not tell you what you want to install, and on
 what platform?  If it's Python 2.6.2 on MS Windows XP,
 just download and run the msi file.
    On web page:   http://www.python.org/download/, you'd choose Python
 2.6.2 Windows installer 
 http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi 
 and it'd give you file python-2.6.2.msi
 
 
 
 


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


Re: python question

2009-05-22 Thread Tim Wintle
On Fri, 2009-05-22 at 05:51 -0700, Craig wrote:
 I use python 2.6.2 and i useing ubuntu 9.04 not windows.

What are you trying to install?

is it available in Synaptic package manager?


If it's a program written in python, then there may be a file called
setup.py. If there is then open a terminal, cd to that directory, and
then type:

python setup.py install

(you may need to do sudo before it) - that will normally automatically
compile any extensions written in C

hope that helps.


Tim W

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


Re: python question

2009-05-21 Thread Dave Angel

Craig wrote:

How do i install this.i never seen a python write in c before.


  
Well, I've never seen a snake program in any language, python or 
otherwise.  And I believe python was named after Monty Python, not the 
snake.  But once it got its name, snake puns abound.


Anyway, why not tell you what you want to install, and on what 
platform?  If it's Python 2.6.2 on MS Windows XP, just download and run 
the msi file.
   On web page:   http://www.python.org/download/, you'd choose Python 
2.6.2 Windows installer 
http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi  and it'd give 
you file python-2.6.2.msi




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


Re: python question!!

2007-11-22 Thread Mike Kent
On Nov 22, 8:23 pm, bruce [EMAIL PROTECTED] wrote:

 is there a function/feature/etc.. that i can run on foo.py that would walk
 through the entire list of files that make up foo.py, so i could see the
 list of *.py files that are required to run foo.py.

There's this:
http://www.tarind.com/depgraph.html

It generates a nice chart showing the 'tree' of imports for your
program.  I found it valuable for helping me resolve a circular import
problem.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python question (PyNoob)

2007-08-20 Thread Carl Banks
On Aug 19, 8:33 pm, Anonymous [EMAIL PROTECTED] wrote:
 I have exp with C/C++ (and a few other langs). I want to use Python to
 start doing the ff:

 1). Data Munging (text processing) - instead of Perl
 2). Automating my build process
 3). (Possibly) some web data retrieval jobs

 Can anyone point me to resurces/possibly scripts that can get me up to
 speed (to do these 3 things) ASAP, without having to learn the basics of
 programming?

You want the Python Library Reference (quod googla).

If you know the basics of programming already, any old Python tutorial
will do, so just skim through the official one (q.g.) to pick up the
syntax and semantic rules.  Then refer to the Library Reference, which
is well organized and make it easy to track down what you need.  The
libraries come with very good built-in support for tasks 1 and 3; for
2 Python supports timestamp checking and subprocess calling and
whatnot, but stuff like dependency trees you'll have to work out
yourself.

(BTW, if make is failing or annoying you, you might want to consider
SCons, which for me has been a lot more intelligent and
straightforward than make ever was.)


Carl Banks

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


Re: Python question (PyNoob)

2007-08-20 Thread Carl Banks
On Aug 19, 10:18 pm, Benjamin [EMAIL PROTECTED] wrote:
 On Aug 19, 7:33 pm, Anonymous [EMAIL PROTECTED] wrote:

  I have exp with C/C++ (and a few other langs). I want to use Python to
  start doing the ff:

  1). Data Munging (text processing) - instead of Perl
  2). Automating my build process
  3). (Possibly) some web data retrieval jobs

  Can anyone point me to resurces/possibly scripts that can get me up to
  speed (to do these 3 things) ASAP, without having to learn the basics of
  programming?

 I think if you've chosen Python as a language to use for these things,
 you could invest some time in learning the language. It is after all
 very easy to learn and you just have to do it once and many of your
 programming task will be taken care of.


I think you and several others are misunderstanding the OP: the OP
wants to learn some details of Python without having to *relearn* the
basics of programming.  It's a reasonable request.


Carl Banks

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


Re: Python question (PyNoob)

2007-08-20 Thread Ant
On Aug 20, 1:33 am, Anonymous [EMAIL PROTECTED] wrote:
...
 1). Data Munging (text processing) - instead of Perl

Check out the re module (regexes) in the standard library, and the
pyparsing third party library: http://pyparsing.wikispaces.com/ for
more complex stuff.

 2). Automating my build process

You'll want to look into the os, sys and subprocess modules. The PMOTW
this week was subprocess: 
http://www.oreillynet.com/onlamp/blog/2007/08/pymotw_subprocess_1.html.
A few weeks back it covered os: 
http://blog.doughellmann.com/2007/05/pymotw-os.html.
In fact one of Doug Hellmann's previous articles on the getopt module
may also be useful if you want your build scripts to be controlled by
command line args: http://blog.doughellmann.com/2007/08/pymotw-getopt.html
(Though I prefer optparse personally).

 3). (Possibly) some web data retrieval jobs

urllib, urllib2 and cookielib in the standard library should do most
of what you want, perhaps with the addition of beautiful soup if you
need to scrape the pages for data: http://www.crummy.com/software/BeautifulSoup/

HTH.

--
Ant...

http://antroy.blogspot.com/


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


Re: Python question (PyNoob)

2007-08-19 Thread Erik Max Francis
Anonymous wrote:

 I have exp with C/C++ (and a few other langs). I want to use Python to 
 start doing the ff:
 
 1). Data Munging (text processing) - instead of Perl
 2). Automating my build process
 3). (Possibly) some web data retrieval jobs
 
 Can anyone point me to resurces/possibly scripts that can get me up to 
 speed (to do these 3 things) ASAP, without having to learn the basics of 
 programming?

That isn't possible without saying what it is that you actually want done.

Besides, the point of specifically choosing Python here for such tasks 
would be your ability to manipulate them and write your own.  If tools 
already exist that do what you need, which languages they were written 
in would be completely irrelevant.

-- 
Erik Max Francis  [EMAIL PROTECTED]  http://www.alcyone.com/max/
  San Jose, CA, USA  37 20 N 121 53 W  AIM, Y!M erikmaxfrancis
   Never had very much to say / Laugh last, laugh longest
-- Des'ree
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python question (PyNoob)

2007-08-19 Thread Pablo Torres
On Aug 19, 7:33 pm, Anonymous [EMAIL PROTECTED] wrote:
 I have exp with C/C++ (and a few other langs). I want to use Python to
 start doing the ff:

 1). Data Munging (text processing) - instead of Perl
 2). Automating my build process
 3). (Possibly) some web data retrieval jobs

 Can anyone point me to resurces/possibly scripts that can get me up to
 speed (to do these 3 things) ASAP, without having to learn the basics of
 programming?

Sure. Go here: http://www.google.com, then type all that and hit
Google Search. That should turn up a wealth of information.

P.S  You can't do all that without learning the basics of programming.

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


Re: Python question (PyNoob)

2007-08-19 Thread Benjamin
On Aug 19, 7:33 pm, Anonymous [EMAIL PROTECTED] wrote:
 I have exp with C/C++ (and a few other langs). I want to use Python to
 start doing the ff:

 1). Data Munging (text processing) - instead of Perl
 2). Automating my build process
 3). (Possibly) some web data retrieval jobs

 Can anyone point me to resurces/possibly scripts that can get me up to
 speed (to do these 3 things) ASAP, without having to learn the basics of
 programming?

I think if you've chosen Python as a language to use for these things,
you could invest some time in learning the language. It is after all
very easy to learn and you just have to do it once and many of your
programming task will be taken care of.

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


Re: Python question (PyNoob)

2007-08-19 Thread Terry Reedy

Anonymous [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
|I have exp with C/C++ (and a few other langs). I want to use Python to
| start doing the ff:
|
| 1). Data Munging (text processing) - instead of Perl
| 2). Automating my build process
| 3). (Possibly) some web data retrieval jobs
|
| Can anyone point me to resurces/possibly scripts that can get me up to
| speed (to do these 3 things) ASAP, without having to learn the basics of
| programming?

Your first sentence suggests that you already know the basics of 
programming, so perhaps you meant something a bit different?  such as not 
figure out for yourself the basic idioms of Python, but learn them from 
code?

In any case, item 1 seems too broad for specific help.  As to item three, 
there are modules and indeed programs available.  Check PyPI on the Python 
site, or search this newsgroup's archives (groups.google.com) or the web 
generally.

tjr



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


Re: Python Question About Compiling.

2006-12-01 Thread Paul Boddie
Fredrik Lundh wrote:
 yndesai wrote:

  Is it that no compiling facility is hindering the growth of python
  in commercial circuit . . . ?

I can see the point of people who are confused about single file
executables for Python programs, who are possibly new to the technology
and don't know where to look [1] or which questions to ask, and I can
also see the need in various situations for people to make such
executables. That said, I don't buy into the kind of hypothetical ISVs
need this and that pontification seen on places like Planet GNOME,
written by people who work at companies like Novell. The commercial
circuit will use a technology (and, in fact, have been using Python
for some time) when they recognise the genuine benefits of the
technology, and if the technology doesn't deliver exactly what they had
in mind, they'll either put in some effort to shape it to their liking
or they'll look elsewhere. If none of this activity has any community
benefit, I'd argue that there's only so much the community should be
prepared to do to fix such commercial objections - if what a business
wants is valuable enough, that business should be prepared to pay for
it.

 (why are you blaming you inability to use Linux installation tools on
 Python, btw?  most basic Python libraries are only an apt-get away if
 you're using a sane Linux distribution.)

This is true enough, and by packaging one's programs correctly, Python
gets automatically brought into the picture when the user asks to
install those programs. It's interesting to consider this in the
context of the recent Linux Standard Base discussions on python-dev:
LSB potentially mitigates issues with shipping executables across
different distributions and would be beneficial to those wanting to
deploy Python applications in such a way. I notice, however, that the
discussion has taken the peanut gallery position of name-calling and
mock outrage at the packaging practices of various distributions [2],
presumably whilst advocating Python-only solutions like setuptools -
something which really isn't going to work well with any large
heterogeneous collection of software packages. Moreover, the
distributions have to more urgently deal with various issues not yet
sufficiently addressed by the Python core developers, particularly
architecture issues [3] and licensing issues [4].

Freezing applications has been a fairly well-understood process for the
last ten years, but more cooperation with heterogeneous packaging
technologies would be far preferable. After all, distributions are
actually responsible for a large amount of Python usage, and it would
be far better if people actually tried to work with them to resolve
some of the supposedly inflammatory aspects of their packaging
practices rather than just shouting bad things at them from a distance
[5]. A bit of not invented here [6] suppression would also be quite
welcome, along with taking the needs of vendors [7] other than Apple
Computer Inc. into account.

Paul

P.S. And while a frank discussion [7] did appear to result in a
comprehensive exchange of views between Debian and setuptools
developers, I'd like to see a bit more understanding for end-users and
people who don't want to ignore their system's package management.
Python plays well with others is a frequent claim, after all.

[1] http://wiki.python.org/moin/DistributionUtilities
[2]
http://mail.python.org/pipermail/python-dev/2006-November/070032.html
[3]
http://mail.python.org/pipermail/python-dev/2006-November/070043.html
[4]
http://mail.python.org/pipermail/python-dev/2006-November/070054.html
[5]
http://mail.python.org/pipermail/python-dev/2006-November/070055.html
[6]
http://mail.python.org/pipermail/python-dev/2006-November/070101.html
[7]
http://mail.python.org/pipermail/distutils-sig/2005-November/005500.html

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


Re: Python Question About Compiling.

2006-11-30 Thread Tim Roberts
Scheol Service [EMAIL PROTECTED] wrote:

Im just unsure on how to compile python code into .exe executionable
files.  Is there a simple way to do this?

Sort of.  Python code is not compiled to machine language.  Instead, it is
compiled to an intermediate language that is then interpreted.  That means
that, at run-time, there must be an interpreter available.

However, there are several packages that will gather up a copy of the
interpreter, your script, and whatever scripts and libraries it might need,
and pack them all into a .exe.  To the end user, it looks like a compiled
program.  py2exe is one example.
-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza  Boekelheide, Inc.
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: Python Question About Compiling.

2006-11-30 Thread yndesai
I got attracted to python since I heard about PythonCAD,
while I used Fortran and Basic during graduation
days  VBA for some macros in Office.

I liked the python as it seems smart. But without compiling it is
a trouble to end user.

I downloaded PythonCAD and am still searching for the libraries
GLIB GTK PYGTK and what not. Then there are dependancies
issues of these libs on LINUX.

I am scratching my head on how I would get the PythonCAD
running.

Is it that no compiling facility is hindering the growth of python
in commercial circuit . . . ?

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


Re: Python Question About Compiling.

2006-11-30 Thread Fredrik Lundh
yndesai wrote:

 Is it that no compiling facility is hindering the growth of python
 in commercial circuit . . . ?

good thing most commercial Python developers haven't noticed this, then. 
  if you don't know that some random guy on the internet thinks that 
some- thing doesn't exist, there's nothing that keeps you from using it ;-)

(why are you blaming you inability to use Linux installation tools on 
Python, btw?  most basic Python libraries are only an apt-get away if 
you're using a sane Linux distribution.)

/F

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


Re: Python Question About Compiling.

2006-11-29 Thread Gabriel Genellina

At Thursday 30/11/2006 02:02, Scheol Service wrote:


Im just unsure on how to compile python code into .exe executionable
files.  Is there a simple way to do this?


py2exe


--
Gabriel Genellina
Softlab SRL 


__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python Question About Compiling.

2006-11-29 Thread Fredrik Lundh
Scheol Service wrote:

 Im just unsure on how to compile python code into .exe executionable
 files.  Is there a simple way to do this?

typing compile python code into google gives you

 http://effbot.org/zone/python-compile.htm

which gives you some background, and links to a bunch of bundling tools.

/F

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


Re: Python Question About Compiling.

2006-11-29 Thread Gabriel G

At Thursday 30/11/2006 03:40, Scheol Service wrote:


i know this. Is there better directions on how to use it?


Have you tried it? What's your actual problem? See http://www.py2exe.org/


--
Gabriel Genellina
Softlab SRL 


__
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: Python question

2006-06-26 Thread Bruno Desthuilliers
Harry wrote:
 Hi All,
(snip)
 I have the following object which is like a list of tuples

 row= [('name', 'x1'), ('min', 15.449041129349528), ('max',
 991.6337818245629), ('range', 976.18474069521335), ('mean',
 496.82174193958127), ('stddev', 304.78275004920454), ('variance',
 92892.524727555894), ('mode', '46.5818482111'), ('unique_count', '99'),
 ('count', 99.0), ('count_missing', 0.0), ('sum_weight', 99.0)]

FWIW, it *is* a list of tuples.

 What command

ot What's a 'command' ? /ot

 do I use to get the value corresponding to 'min'?
(see below...)

 This object seems to be non-indexable

It is - just like any other list. Try :
 print row[0]
 print row[1]
 # etc...

Now if you want keyword access, try this:
 print dict(row)['min']



-- 
bruno desthuilliers
python -c print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python question

2006-06-25 Thread Erik Max Francis
Harry wrote:

   It is nice to join the python group. Can someone please help me with
 a python question?
 I have the following object which is like a list of tuples
 What command do I use to get the value corresponding to 'min'?
 This object seems to be non-indexable
 
 
 row= [('name', 'x1'), ('min', 15.449041129349528), ('max',
 991.6337818245629), ('range', 976.18474069521335), ('mean',
 496.82174193958127), ('stddev', 304.78275004920454), ('variance',
 92892.524727555894), ('mode', '46.5818482111'), ('unique_count', '99'),
 ('count', 99.0), ('count_missing', 0.0), ('sum_weight', 99.0)]

Iterating would be the best way.  There are shorter ways of writing it, 
for instance with list comprehensions, but it's still iteration::

for key, value in row:
if key == 'min':
print value
break

or::

results = [v for k, v in row if k == 'min']
print results[0]

Another way, if you plan to access this same data structure in this way 
multiple times before moving on to the next one, would be to turn it 
into a dictionary first::

d = dict(row)
print d['min']

Note that all of these solutions assume that the key you want is indeed 
in there.  If it might not be, then you'll have to gracefully handle errors.

-- 
Erik Max Francis  [EMAIL PROTECTED]  http://www.alcyone.com/max/
  San Jose, CA, USA  37 20 N 121 53 W  AIM erikmaxfrancis
   Divide the fire, and you will the sooner put it out.
-- Publilius Syrus
-- 
http://mail.python.org/mailman/listinfo/python-list