python3 package import difference?

2024-08-07 Thread Tobiah via Python-list
I have an old library from 20 some years ago for use with python2, that is structured like this: rcs ├── dbi │   ├── __init__.py │   ├── dbi.py │   └── regos.py └── __init__.py -- *empty* the __init__.py file under 'rcs' is empty. The one under rcs.dbi contains:

Re: python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
I see the literal 'escape' character + 'k', when it should let me edit previous commands. I did have to compile my own python because I'm using 2.7 on this machine. I figured it out. I needed to apt install libreadline-dev. -- https://mail.python.org/mailman/listinfo/python-list

Re: python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
For this to work, the Python implementation should use the same readline library as your shell, I guess. It works in python3, so I guess my problem is that I'm compiling python (I think kubuntu dropped python2), but I don't see any relevant options in the configure help. -- https://m

Problem using mysql library

2024-07-11 Thread Tobiah via Python-list
sinewave:toby ~(1)> python Python 2.7.18 (default, Jul 8 2024, 12:49:12) [GCC 13.2.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. import MySQLdb Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/site-packages/MySQLdb/

python repl vi mode line editing not working.

2024-07-11 Thread Tobiah via Python-list
Kubuntu 24.04. sinewave:toby ~(1)> cat .inputrc set editing-mode vi set keymap vi sinewave:toby ~(1)> cat .editrc bind -v bind \\t rl_complete sinewave:toby ~(1)> python Python 2.7.18 (default, Jul 8 2024, 12:49:12) [GCC 13.2.0] on linux2 Type "help", "copyright", "credits" or "license" for mor

Re: Configuring an object via a dictionary

2024-03-18 Thread Tobiah via Python-list
I should mention that I wanted to answer your question, but I wouldn't actually do this. I'd rather opt for your self.config = config solution. The config options should have their own namespace. I don't mind at all referencing foo.config['option'], or you could make foo.config an object by its

Re: Configuring an object via a dictionary

2024-03-18 Thread Tobiah via Python-list
On 3/15/24 02:30, Loris Bennett wrote: Hi, I am initialising an object via the following: def __init__(self, config): self.connection = None self.source_name = config['source_name'] self.server_host = config['server_host'] However, with a view to asking forg

Using pydal for standalone scripts

2023-06-07 Thread Tobiah via Python-list
I am looking into creating a database abstraction library using pydal and mysql as the engine. I noticed that I have to specify a 'folder' with the connection string to tell pydal where to save "table files". So I'll have hundreds of different databases and install this library on many machines.

Re: Log File

2023-05-31 Thread Tobiah
On 5/31/23 00:22, ahsan iqbal wrote: Why we need a log file ? If i read a large text file than how log file help me in this regard? If you were parsing each line of this text file looking for information, perhaps some of the lines would not be formatted correctly, and you would be unable to g

Re: ok, I feel stupid, but there must be a better way than this! (finding name of unique key in dict)

2023-01-20 Thread Tobiah
On 1/20/23 07:29, Dino wrote: let's say I have this list of nested dicts: [   { "some_key": {'a':1, 'b':2}},   { "some_other_key": {'a':3, 'b':4}} ] I need to turn this into: [   { "value": "some_key", 'a':1, 'b':2},   { "value": "some_other_key", 'a':3, 'b':4} ] This doesn't look like

Re: Passing information between modules

2022-11-18 Thread Tobiah
On 11/18/22 02:53, Stefan Ram wrote: Can I use "sys.argv" to pass information between modules as follows? in module A: import sys sys.argv.append( "Hi there!" ) in module B: import sys message = sys.argv[ -1 ] Kind of seems like a code smell. I think you would normally just inj

Re: UTF-8 and latin1

2022-08-18 Thread Tobiah
You configure the web server to send: Content-Type: text/html; charset=... in the HTTP header when it serves HTML files. So how does this break down? When a person enters Montréal, Quebéc into a form field, what are they doing on the keyboard to make that happen? As the string sits ther

Re: UTF-8 and latin1

2022-08-18 Thread Tobiah
Generally speaking browser submisisons were/are supposed to be sent using the same encoding as the page, so if you're sending the page as "latin1" then you'll see that a fair amount I should think. If you send it as "utf-8" then you'll get 100% utf-8 back. The only trick I know is to use . Woul

Re: UTF-8 and latin1

2022-08-17 Thread Tobiah
That has already been decided, as much as it ever can be. UTF-8 is essentially always the correct encoding to use on output, and almost always the correct encoding to assume on input absent any explicit indication of another encoding. (e.g. the HTML "standard" says that all HTML files must be UTF-

Re: UTF-8 and latin1

2022-08-17 Thread Tobiah
On 8/17/22 08:33, Stefan Ram wrote: Tobiah writes: I get data from various sources; client emails, spreadsheets, and data from web applications. I find that I can do some_string.decode('latin1') Strings have no "decode" method. ("bytes" objects do.) I&

UTF-8 and latin1

2022-08-17 Thread Tobiah
I get data from various sources; client emails, spreadsheets, and data from web applications. I find that I can do some_string.decode('latin1') to get unicode that I can use with xlsxwriter, or put in the header of a web page to display European characters correctly. But normally UTF-8 is recom

Re: Which linux distro is more conducive for learning the Python programming language?

2022-08-04 Thread Tobiah
On 8/3/22 19:01, Turritopsis Dohrnii Teo En Ming wrote: Subject: Which linux distro is more conducive for learning the Python programming language? You might try Pythontu. Not really. Get the distro that looks appealing to you. One won't be better than the other with regard to learning pytho

Re: Changing calling sequence

2022-05-11 Thread Tobiah
On 5/11/22 06:33, Michael F. Stemper wrote: I have a function that I use to retrieve daily data from a home-brew database. Its calling sequence is; def TempsOneDay( year, month, date ): After using it (and its friends) for a few years, I've come to realize that there are times where it would be

Re: How to test input via subprocess.Popen with data from file

2022-03-11 Thread Tobiah
Why not just have scripts that echo out the various sets of test data you are interested in? That way, Popen would always be your interface and you wouldn't have to make two cases in the consumer script. In other words, make program that outputs test data just like your main data source program.

Pandas or Numpy

2022-01-23 Thread Tobiah
I know very little about either. I need to handle score input files for Csound. Each line is a list of floating point values where each column has a particular meaning to the program. I need to compose large (hundreds, thousands, maybe millions) lists and be able to do math on, or possibly sort

Re: strptime for different languages

2019-12-18 Thread Tobiah
t datetime would throw in this case. It crossed my mind when posting, but I was illustrating an idea rather than submitting usable code. 2. Why use 'continue' instead of 'pass'? No reason. Does one have a benefit over the other? Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: 3rd party mail package

2019-12-18 Thread Tobiah
a business transaction.” I know. I admitted that the Wikipedia article disagreed with me, forcing me into a retraction of my previous assertion. I didn't post that link to reinforce my original argument. Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: strptime for different languages

2019-12-18 Thread Tobiah
having to edit your code in a messy way. Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: 3rd party mail package

2019-12-18 Thread Tobiah
On 12/14/19 1:13 AM, Barry wrote: I guess the 2nd party is the user. I think of the user as the first party. 1) I want a thing for python. 2) Python doesn't have a very good one 3) Someone else will give it to you Barry On 13 Dec 2019, at 21:13, Abdur-Rahmaan Janhangeer wrote: Wond

Re: 3rd party mail package

2019-12-18 Thread Tobiah
On 12/18/19 9:27 AM, Tobiah wrote: On 12/14/19 1:13 AM, Barry wrote: I guess the 2nd party is the user. I think of the user as the first party. 1) I want a thing for python. 2) Python doesn't have a very good one 3) Someone else will give it to you Wikipedia disagrees with me:

Re: Odd delays when cwd is on a network mount

2019-10-14 Thread Tobiah
On 10/11/19 6:04 PM, Gregory Ewing wrote: Cameron Simpson wrote: Python's default sys.path includes the current working directory. Only in an interactive session, where it usually makes sense. I was only using the REPL for demonstration. The same delay happens when I import a module in a s

Re: Odd delays when cwd is on a network mount

2019-10-11 Thread Tobiah
On 10/11/19 10:56 AM, Tobiah wrote: I have a directory mounted with sshfs over a 5mb connection. It's quite usable under most circumstances. When I run python from a directory under that mount, imports from local directories are quite slow: $ python2.7 import my_module ## takes 25 se

Odd delays when cwd is on a network mount

2019-10-11 Thread Tobiah
local/dir/not/on/mount/my_module.py When I do the same thing from my home directory there is no delay. $ wc -l /local/dir/not/on/mount/my_module.py 156 /local/dir/not/on/mount/my_module.py Thanks for any help. Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Delay in python startup.

2019-09-30 Thread Tobiah
On 9/30/19 9:54 AM, Chris Angelico wrote: On Tue, Oct 1, 2019 at 1:56 AM Tobiah wrote: I don't have a lot of information, so here goes a shot in the dark. One day I started experiencing a delay when starting python. I'm on Ubuntu 16.04. It takes three seconds to get a prompt w

Re: Hi how do I import files inside a txt file?

2019-09-30 Thread Tobiah
On 9/2/19 3:32 AM, Spencer Du wrote: Hi How do i import files inside a txt file if they exist in the current directory? Once you've read the module names you can use: new_module = __import__(modulename) So you'd read the name from your file into modulename and import the name contained in

Delay in python startup.

2019-09-30 Thread Tobiah
I don't have a lot of information, so here goes a shot in the dark. One day I started experiencing a delay when starting python. I'm on Ubuntu 16.04. It takes three seconds to get a prompt when I type 'python' on the command line (Python 2.7.12). When I run a script that imports packages, it t

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Tobiah
ended_style = 0 in my ~/.vimrc and my problem was elegantly solved. I continued here with the answer so that those that find my original post by Googling the same question would not be left hanging. Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT(?)] Ubuntu 18 vim now defaults to 4-space tabs

2019-09-10 Thread Tobiah
Your subject missed a critical word: vim. It's there! Run vim. Then ':set' to see what's set different than default. Then, if it is tabstop you want to know about, ':verbose set tabstop?' will tell you where that setting was last altered. Nothing that seems to point to space indent: backg

[OT(?)] Ubuntu 18 now defaults to 4-space tabs

2019-09-09 Thread Tobiah
We upgraded a server to 18.04 and now when I start typing a python file (seems to be triggered by the .py extension) the tabs default to 4 spaces. We have decades of code that use tab characters, and it has not been our intention to change that. I found a /usr/share/vim/vim80/indent/python.vim a

Re: How to remove a string from a txt file?

2019-09-04 Thread Tobiah
On 9/4/19 8:08 AM, Spencer Du wrote: Hi I want to remove a string from a txt file and then print out what I have removed. How do I do this. The txt file is in this format and should be kept in this format. txt.txt: laser,cameras, Thanks Do you want to remove one of the fields by using an

Re: itertools cycle() docs question

2019-08-21 Thread Tobiah
On 8/21/19 11:38 AM, Rob Gaddi wrote: On 8/21/19 11:27 AM, Tobiah wrote: In the docs for itertools.cycle() there is a bit of equivalent code given: def cycle(iterable): # cycle('ABCD') --> A B C D A B C D A B C D ... saved = [] for element in iterable: yield element saved.a

itertools cycle() docs question

2019-08-21 Thread Tobiah
In the docs for itertools.cycle() there is a bit of equivalent code given: def cycle(iterable): # cycle('ABCD') --> A B C D A B C D A B C D ... saved = [] for element in iterable: yield element saved.append(element) while saved:

Re: Handle foreign character web input

2019-06-28 Thread Tobiah
On 6/28/19 1:33 PM, Chris Angelico wrote:> On Sat, Jun 29, 2019 at 6:31 AM Tobiah wrote: A guy comes in and enters his last name as RÖnngren. So what did the browser really give me; is it encoded in some way, like latin-1? Does it depend on whether the name was cut and pasted from a W

Handle foreign character web input

2019-06-28 Thread Tobiah
A guy comes in and enters his last name as RÖnngren. So what did the browser really give me; is it encoded in some way, like latin-1? Does it depend on whether the name was cut and pasted from a Word doc. etc? Should I handle these internally as unicode? Right now my database tables are latin-1

Re: How to pass username and password in the curl requests using requests python module

2019-05-02 Thread Tobiah
On 5/2/19 4:30 AM, Pradeep Patra wrote: Can anyone pls help in this regard? Something like this?: requests.get('https://api.github.com/user', auth=('user', 'pass')) -- https://mail.python.org/mailman/listinfo/python-list

Email blast management?

2019-01-09 Thread Tobiah
wn to recommendations on some good supporting libraries that will help me with any of these tasks. Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Are all items in list the same?

2019-01-08 Thread Tobiah
On 1/8/19 9:20 AM, Alister wrote: On Tue, 08 Jan 2019 17:15:17 +, Alister wrote: On Tue, 08 Jan 2019 16:48:58 +0200, Serhiy Storchaka wrote: 08.01.19 11:07, Peter Otten пише: Bob van der Poel wrote: I need to see if all the items in my list are the same. I was using set() for this, but

@staticmethod or def function()?

2018-10-31 Thread Tobiah
My IDE (pycharm) suggests that I mark my class methods with @staticmethod when they don't use 'self'. Sounds good. I did that then it suggested I had the option to make a regular function instead, at the file level. That's a possibility. I was thinking that I'd leave the method in the class unl

MIDI note timing

2018-09-18 Thread Tobiah
I'd like to do some algorithmic composing using python. I've seen various libraries that seem to be capable of sending a MIDI message to a MIDI port, but I don't know where to get the timing from. Normally, with something like CSOUND, the program locks itself to the timing of the soundcard and pr

Checking whether type is None

2018-07-24 Thread Tobiah
Consider: >>> type({}) is dict True >>> type(3) is int True >>> type(None) is None False Obvious I guess, since the type object is not None. So what would I compare type(None) to? >>> type(None) >>> type(None) is NoneType

Sorting and spaces.

2018-05-31 Thread Tobiah
>>> a = ['Awards', 'Award Winners'] >>> sorted(a) ['Award Winners', 'Awards'] So python evaluated the space as a lower ASCII value. Thoughts? Are there separate tools for alphabetizing rather then sorting? Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Undocumented unescape() method in HTMLParser?

2018-05-25 Thread Tobiah
I came across its usage in StackOverflow somewhere, but didn't see it in the docs. I'm using 2.7. I needed it while writing a class for generating text documents out of HTML documents for attaching to emails, which lowers spam scores. I lifted the basis for this from the top answer here: https

Re: why does list's .remove() does not return an object?

2018-05-17 Thread Tobiah
On 05/17/2018 09:25 AM, Ned Batchelder wrote: On 5/17/18 11:57 AM, Abdur-Rahmaan Janhangeer wrote: x = [0,1] x.remove(0) new_list = x Just call the original list 'new_list' to begin with. new_list = [0, 1] new_list.remove(0) There you are! -- https://mail.python.org/mailman/listinfo/pyt

Re: syntax oddities

2018-05-17 Thread Tobiah
Top posting is awesome for the reader plowing through a thread in order. In that case the cruft at the bottom is only for occasional reference. Ok, I yield! I know the bottom-posting party has congress right now. On 05/17/2018 06:29 AM, Grant Edwards wrote: On 2018-05-17, Abdur-Rahmaan Janhan

Re: what does := means simply?

2018-05-17 Thread Tobiah
On 05/16/2018 08:54 PM, Steven D'Aprano wrote: On Thu, 17 May 2018 05:33:38 +0400, Abdur-Rahmaan Janhangeer wrote: what does := proposes to do? Simply, it proposes to add a new operator := for assignment (or binding) as an expression, as an addition to the = assignment operator which operates

syntax oddities

2018-05-15 Thread Tobiah
Why is it len(object) instead of object.len? Why is it getattr(object, item) rather then object.getattr(item)? etc... Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: semicolon at end of python's statements

2018-04-03 Thread Tobiah
On 04/03/2018 09:48 AM, kar...@gmail.com wrote: Semicolon is optional. If you put a semicolon at the end of the of a statement, you can keep writing statements. a=3;b=2 PyCharm still complains about two statements on one line and sites Pep 8. I never used to pay much attention to Pep 8, but

Re: semicolon at end of python's statements

2018-04-03 Thread Tobiah
On 04/01/2018 11:31 PM, dlt.joaq...@gmail.com wrote: El miércoles, 28 de agosto de 2013, 21:18:26 (UTC-3), Mohsen Pahlevanzadeh escribió: Dear all, I'm C++ programmer and unfortunately put semicolon at end of my statements in python. Quesion: What's really defferences between putting semico

Re: ***URGENT CONTRACT OPPORTUNITY***

2018-03-28 Thread Tobiah
On 03/28/2018 06:45 AM, cagdenw...@gmail.com wrote: opportunity in Tours, France starting ASAP!!! and able to start ASAP!!! contact me ASAP When should I apply? -- https://mail.python.org/mailman/listinfo/python-list

Re: Putting Unicode characters in JSON

2018-03-23 Thread Tobiah
On 03/22/2018 12:46 PM, Tobiah wrote: I have some mailing information in a Mysql database that has characters from various other countries.  The table says that it's using latin-1 encoding.  I want to send this data out as JSON. So I'm just taking each datum and doing 'name&#

Re: Putting Unicode characters in JSON

2018-03-22 Thread Tobiah
On 03/22/2018 01:09 PM, Chris Angelico wrote: On Fri, Mar 23, 2018 at 6:46 AM, Tobiah wrote: I have some mailing information in a Mysql database that has characters from various other countries. The table says that it's using latin-1 encoding. I want to send this data out as JSON. S

Putting Unicode characters in JSON

2018-03-22 Thread Tobiah
I have some mailing information in a Mysql database that has characters from various other countries. The table says that it's using latin-1 encoding. I want to send this data out as JSON. So I'm just taking each datum and doing 'name'.decode('latin-1') and adding the resulting Unicode value ri

MySQLdb and conn.select_db()

2017-11-15 Thread Tobiah
yet my new machine is supporting it from the MySQLdb library. Are the docs lagging? Can I download the 'better' MySQLdb package and install it on the 8.04 machine? Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Sequence MIDI events from python. (Posting On Python-List Prohibited)

2017-10-26 Thread Tobiah
On 10/26/2017 4:30 PM, Lawrence D’Oliveiro wrote: On Friday, October 27, 2017 at 12:02:40 PM UTC+13, Tobiah wrote: I know that there are a few good MIDI libraries out there. The examples that I've seen for real-time triggering of events rely on a sleep function to realize the timing. Th

Sequence MIDI events from python.

2017-10-26 Thread Tobiah
er in python? I imagine I'd have to sync to an audio device to get the timing right. Thank for any help. Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Creating a MIDI file

2017-10-04 Thread Tobiah
What would be the best library to use for creating MIDI files that I could import into a DAW like Reaper? Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Assertions

2017-09-21 Thread Tobiah
rned off with -O? Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about modules documentation

2017-09-15 Thread Tobiah
>> 'next sentence' is the operative piece. I think that if the bit >> about placement was moved to the end of the paragraph the whole >> thing would be more readable and I wouldn't have stumbled on it. > > If it had meant "the imported module's names" or indeed "the imported > modules' names", I

Re: Question about modules documentation

2017-09-15 Thread Tobiah
On 09/15/2017 09:25 AM, Stefan Ram wrote:> Tobiah writes: >> Modules can import other modules. It is customary but not >> required to place all import statements at the beginning >> of a module (or script, for that matter). The imported >> module na

Re: Question about modules documentation

2017-09-15 Thread Tobiah
Re-reading I guess the plural refers to the multiple modules referenced in the first sentence. It was probably written that way before someone inserted the bit about the customary placement, which greatly clouds the connection. On 09/15/2017 09:03 AM, Tobiah wrote: > In this

Question about modules documentation

2017-09-15 Thread Tobiah
In this doc: https://docs.python.org/2/tutorial/modules.html Near the top it states: Modules can import other modules. It is customary but not required to place all import statements at the beginning of a module (or script, for that matter). The imported m

Midi output timing?

2017-09-07 Thread Tobiah
I'd like to use a python program to send out MIDI events to another program. I've done in the past by generating scores for csound which would do the MIDI output. The apparent hurdle is the timing bit. I've seen packages that allow the creation of MIDI events, but given a list of events of arb

Re: API Help

2017-06-16 Thread Tobiah
> I still think it _could_ be the output of a Python repr() or similar > (something that is expected to be evaluated as a Python expression). It may be valid fodder for python eval(), but if it came from repr() It would have used single quotes, yes? -- https://mail.python.org/mailman/listinfo/

Find out which module a class came from

2017-04-07 Thread Tobiah
I was viewing the python source for a program at work and came across a class name that I knew my company had written: import mycmp1 import mycmp2 import mycmp3 import mycmp4 import mycmp5 foo = FooClass() So I knew that FooClass was defined in on

Re: Who are the "spacists"?

2017-03-20 Thread Tobiah
> I wonder whether the tabs versus spaces divide is closely aligned to the > Windows versus Unix/Linux divide? > > It seems to me that Unix users are typically going to be using Unix tools > which often assume spaces are used for indentation, and consequently cope > badly with tabs. I can't thin

Re: The ternaery operator

2017-03-16 Thread Tobiah
On 03/16/2017 01:12 AM, Gregory Ewing wrote: > Stefan Ram wrote: > >> a if c else b >> >> Guido has invented something totally new. Why? > > It's arguably closer to the way you would say such a > thing in English. > > Consider the following sentences: > > "I wear my red shirt if it's Tuesday,

Re: The ternaery operator

2017-03-16 Thread Tobiah
drugs['choice'] else 'pot' Then I'm tempted to do: chosen = drugs['choice'] chosen if chosen else 'pot' I sometimes feel like doing: drugs['choice'] else 'pot' Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Extract items from string in db

2017-03-15 Thread Tobiah
On 03/14/2017 03:26 PM, DFS wrote: > I have a SQLite database with TEXT columns containing strings of the format: > > ['Item1: Value1 has,comma','Item2: has'apostrophe','Item3: Value3'] > > The brackets are part of the string. > > How can I unpack and access each item? > Item1: Value1 has,comma

importing down in code rather than at top of file.

2016-08-29 Thread Tobiah
amount of processing power and memory to import a module, so it seems like I'd save those resources with the above pattern. The down side would be that it's nice to see all of the imports at the top which would follow convention. Should I care? Tobiah -- https://mail.python.org/mailma

Re: windows and file names > 256 bytes

2015-07-07 Thread Tobiah
the prefix) My questions: 1. How can I get the file size of very long paths under XP? As a workaround, could you use multiple calls to os.chdir() to get to where you need to do your operations, then use relative paths from there? Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Bitten by my C/Java experience

2015-05-04 Thread Tobiah
On 05/04/2015 08:20 AM, Cecil Westerhof wrote: Potential dangerous bug introduced by programming in Python as if it was C/Java. :-( I used: ++tries that has to be: tries += 1 Are there other things I have to be careful on? That does not work as in C/Java, but is correct syntax. One

subprocess and stdin.write(), stdout.read()

2015-03-24 Thread Tobiah
() print p.stdout.read() Is that vulnerable to deadlock? Is there a better way to write to and read from the same process? Thanks! Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Syncing audio and video for casual recording

2014-11-08 Thread Tobiah
7;t find out much in a very quick search. Aside from that, could I feed a decent audio signal into the camera and get the audio in that way? I've never done any video, so I'm quite in the dark about the camera part. Thanks, Tobiah --- This email is free from viruses and malware be

Re: [OFF-TOPIC] It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code?

2014-11-04 Thread Tobiah
On 11/04/2014 08:45 AM, françai s wrote: I intend to write in lowest level of computer programming as a hobby. It is true that is impossible write in binary code, the lowest level of programming that you can write is in hex code? What is the lowest level of programming computers that you can wr

Re: (test) ? a:b

2014-10-24 Thread Tobiah
On 10/24/2014 10:27 AM, Chris Angelico wrote: On Sat, Oct 25, 2014 at 4:23 AM, Tobiah wrote: Out of all of the replies, I don't think anyone actually offered the answer: a if condition else b Jean-Michel did, the very first response. ChrisA I had to search for it. For

Re: (test) ? a:b

2014-10-24 Thread Tobiah
On 10/22/2014 01:29 AM, ast wrote: Hello Is there in Python something like: j = (j >= 10) ? 3 : j+1; as in C language ? thx Out of all of the replies, I don't think anyone actually offered the answer: a if condition else b -- https://mail.python.org/mailman/listinfo/python-list

Re: I am out of trial and error again Lists

2014-10-23 Thread Tobiah
On 10/22/2014 01:30 PM, Seymore4Head wrote: def nametonumber(name): lst=[""] for x,y in enumerate (name): lst=lst.append(y) print (lst) return (lst) a=["1-800-getcharter"] print (nametonumber(a))#18004382427837 The syntax for when to use a () and when to use [] stil

Re: Python Basics

2014-10-09 Thread Tobiah
for i in range(1,10): print (str(i)*i) Seymour, please don't do this. When you "help" someone by just giving him the answer to a homework problem, you get him past his immediate issue of "I need to submit my homework for this problem". That lets him get through his course without understand

Re: Python Basics

2014-10-03 Thread Tobiah
Hi Chris I can't get the code to display the output as it should. I can get it to display like this: 1223335 or I can get it to display like this: 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 but not as has been asked in the question. Cheers Diarmuid Hint: 'a' * 4 '' -- https://mail.python

Re: how to write a html to automatically display the dictionary?

2014-09-23 Thread Tobiah
On 09/23/2014 07:18 AM, luofeiyu wrote: x={'f1':1,'f2':2,'f3':3} how can i create the following html file automatically with python to display x ? f1 f2 f3 1 2 3 def tablefy(values): print "" for value in values: print "%s" % value pri

Re: PEP8 and 4 spaces

2014-07-03 Thread Tobiah
Anyway, I gave up the 80 char line length long ago, having little feeling for some dolt Same to you. Haha, the language was too strong. The code I'm talking about is only going to be seen by a small group of programmers. The current trio has all been here for over 20 years. I'd be more co

Re: PEP8 and 4 spaces

2014-07-03 Thread Tobiah
tkc I think your suggestion of having GIT handle the transformations is the way we'll go. nothing to quibble or worry about. Well put spaces in the repository since it still seems to be the community's preference and I'll convert to tabs with GIT on the fly. Problem solved. Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

PEP8 and 4 spaces

2014-07-03 Thread Tobiah
days that are configurable to show tabs a four characters. Any evidence out there that this part of PEP8 is becoming more optional or even obsolete, as I've heard others say about the 80 char line length? Just need ammo for when the hammer of code unification comes down. Thanks, Tobia

Re: python obfuscate

2014-04-10 Thread Tobiah
On 4/10/2014 6:29 PM, Wesley wrote: > Hi all, Does python has any good obfuscate? > > Currently our company wanna release one product developed by python > to our customer. But dont's wanna others see the py code. > > I googled for a while but mostly just say using pyc. Any better one? Does that

Re: Geezer learns python

2014-03-04 Thread Tobiah
On 03/04/2014 03:03 PM, notbob wrote: I'm trying to learn python. I'm doing it via Zed Shaw's Learn Python the Hard Way. Sure enough, 16 lessons in and I've run aground. Is it OK for a painfully stupid ol' fart to ask painfully stupid noob questions, here? I'm a long time usenet fan and prefe

Re: How does python know?

2014-02-12 Thread Tobiah
On 02/12/2014 12:17 PM, Tobiah wrote: I do this: a = 'lasdfjlasdjflaksdjfl;akjsdf;kljasdl;kfjasl' b = 'lasdfjlasdjflaksdjfl;akjsdf;kljasdl;kfjasl' print print id(a) print id(b) And get this: True 140329184721376 140329184721376 This works for longer strings. Does

How does python know?

2014-02-12 Thread Tobiah
string I've made in order to determine whether it needs to create a new object? Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: dictionary with tuples

2014-01-14 Thread Tobiah
On 01/14/2014 01:21 PM, YBM wrote: Le 14/01/2014 22:10, Igor Korot a écrit : Hi, ALL, C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdb>python Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more infor

Python and MIDI

2013-12-17 Thread Tobiah
Is there a module out there that would let me send a predetermined list of midi messages to a MIDI device in such a way that the timing would be precise enough for music? Thanks, Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Question RE urllib

2013-12-17 Thread Tobiah
g/2.7/howto/urllib2.html#id6 It must be a network problem, cuz your code works fine: :w !python http://www.amazon.com/ http://google.com http://tobiah.org http://notavalidurl.com http://superreallyforsurenotavalidurlnokidding.com is down Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Help me with this code PLEASE

2013-11-05 Thread Tobiah
All this problem arises because MySQL's hasn't got a datatype able to store an array of elements, a list. Um, yes it does. It's called a table. -- https://mail.python.org/mailman/listinfo/python-list

Re: urllib2 timeout issue

2013-10-16 Thread Tobiah
the same results? If so, I'd say you have a DNS problem. Maybe you have two DNS servers listed in /etc/resolv.conf or similar, and the first one is unavailable, so it takes 10 seconds to fail over to the second working server. Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: basic maze problem with turtle

2013-10-14 Thread Tobiah
On 10/13/2013 04:44 PM, Gary Herron wrote: On 10/13/2013 03:03 PM, Denis McMahon wrote: Except perhaps Nikos. Nikos can probably write you extremely elegant one line python solutions to any coding problem you describe to him. His solutions might suffer the very minor flaw of not working, but the

Re: Code golf challenge: XKCD 936 passwords

2013-10-08 Thread Tobiah
nge: Use it for generating all your passwords :) [1] https://en.wikipedia.org/wiki/Code_golf [2] http://xkcd.com/936/ ChrisA So how about finding the last word that starts with each lower case letter of the alphabet in turn: azures bywords czars ... Tobiah -- https://mail.python.org/mailman/listinfo/python-list

Re: Code golf challenge: XKCD 936 passwords

2013-10-08 Thread Tobiah
On 10/08/2013 09:07 AM, Tim Chase wrote: On 2013-10-08 15:36, Denis McMahon wrote: On Tue, 08 Oct 2013 08:33:48 -0400, Roy Smith wrote: In the old days, it used to be /usr/dict/words. Port Python to v6, and save another 6 characters :-) Doesn't matter where it is, a link to it exists at "/w"

  1   2   3   >